Ansicht
Dokumentation

ABENBDL_STANDARD_OPERATIONS - BDL STANDARD OPERATIONS

ABENBDL_STANDARD_OPERATIONS - BDL STANDARD OPERATIONS

PERFORM Short Reference   SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up  
This documentation is copyright by SAP AG.
SAP E-Book

- Standard Operations

... $[ internal$] create $[($[features:global$]
                      $[,precheck$]
                      $[,authorization:none$])$];
  $| $[internal$] update $[ (${features:instance $| features:global$}
                      $[,precheck$])$];
  $| $[internal$] delete $[ (${features:instance $| features:global$}
                      $[,precheck$]
                      $[,authorization:none$]
                      $[,authorization:update$])$];


Effect

Create, update, and delete are standard operations. They are also known as CRUD operations, which is an acronym for create, read, update, delete. The read operation is always implicitly enabled for each entity listed in a CDS behavior definition (BDEF) and it mustn't be declared explicitly.

In a managed scenario, the CRUD operations don't require an ABAP behavior pool (ABP), since they are completely handled by the managed RAP BO provider. (However, some of the optional additions do require implementation. This is documented in the respective topics.)

In an unmanaged scenario, each standard operation must be implemented in the ABAP behavior pool in the RAP handler method FOR MODIFY.

In a projection BDEF, the standard operations can be reused from the base BDEF. This can be done using the keyword use. For further details, see topic CDS BDL - use, projection BDEF.

create
create is a modifying operation that creates new instances of a business object entity.

  • In a managed RAP BO, create can only be declared for root nodes. Child nodes are implicitly create-enabled for internal usage. That means, an external consumer can only create a new instance of a child entity via its parent, see create-by-association operation. A direct create can only take place from the BO's own implementation in the ABAP behavior pool.
  • In an unmanaged RAP BO, direct creates on child entities are possible but not recommended.

update
update is a modifying operation that changes instances of a business object entity.

delete
delete is a modifying operation that deletes instances of a business object entity.

create, update, and delete are optional components of a BDEF. If, for example, update is defined for an entity, then it is allowed to update this entity. If update is not defined, then a RAP BO consumer is not allowed to perform update calls.

The following CDS BDL operation additions are possible:

  • internal: create, update, and delete can be defined as internal operations.
  • (features:instance): Dynamic feature control can be specified for update or delete, not for create.
  • (features:global): Global feature control can be specified for create, update, or delete.
  • precheck: A precheck can be specified for create, update, or delete.
- Excludes the operation in question from authorization checks.
- Can be specified for create (only for global authorization) and delete and only for the authorization master entity.
- Delegates the authorization control for the authorization in question to the authorization check that is implemented for the update operation.
- Only available for delete.

Development guide for the ABAP RESTful Application Programming Model, section about Standard Operations.

Example - Managed

The following example shows a managed BDEF based on the CDS root view entity DEMO_SALES_CDS_BUPA_2. The transactional behavior of the root view entity is defined by the standard operations create, update, and delete. The read operation is implicitly available for both, parent and child entity. For the composition _BuPa that connects both entities, the create-by-association operation is defined in the entity behavior body.

The program DEMO_SALES_CDS_BUPA_1 accesses the business object using EML and creates, deletes, and updates BO instances. These operations all work without implementation in the ABAP behavior pool.



Example - Unmanaged

The following example shows an unmanaged BDEF based on the CDS root view entity DEMO_RAP_UNMANAGED_AUTH. The transactional behavior of the root view entity is defined by the standard operations create, update, and delete. The read operation is implicitly available for both, parent and child entity. For the composition _child that connects both entities, the create-by-association operation is defined in the entity behavior body.

For the implementation in the ABAP behavior pool, see BP_DEMO_RAP_UNMANAGED_AUTH====CCIMP.

The program DEMO_RAP_EML_UNMANAGED accesses the business object using EML and reads, creates, deletes, and updates BO instances.

ABAP EML - MODIFY, Standard Operations (Unmanaged)






CPI1466 during Backup   RFUMSV00 - Advance Return for Tax on Sales/Purchases  
This documentation is copyright by SAP AG.

Length: 12311 Date: 20240420 Time: 004312     sap01-206 ( 111 ms )