Documentation View

We are hiring and constantly growing! Have a look through our vacancies to find the right role for you!

ABAPMODIFY_ENTITY_ENTITIES_OP - MODIFY ENTITY ENTITIES OP

ABAPMODIFY_ENTITY_ENTITIES_OP - MODIFY ENTITY ENTITIES OP

TXBHW - Original Tax Base Amount in Local Currency   ABAP Short Reference  
This documentation is copyright by SAP AG.
SAP E-Book

MODIFY ENTITY, ENTITIES, operations

... $[CREATE field_spec$]
    $[CREATE BY \_assoc field_spec$]
    $[UPDATE field_spec$]
    $[DELETE field_spec$]
    $[EXECUTE action field_spec $[REQUEST request$] $[ RESULT result_tab$]$] ...


Variants:

1. ... CREATE field_spec

2. ... CREATE BY \_assoc field_spec

3. ... UPDATE field_spec

4. ... DELETE field_spec

5. ... EXECUTE action field_spec

Effect

The EML MODIFY statement supports the following operations:

  • CREATE: Create new RAP BO node instances for root or child entities.
  • CREATE BY: Create target instances for associated entities for which create must be enabled in the BDEF. The creation is not restricted to compositions.
  • UPDATE: Update existing RAP BO node instances.
  • DELETE: Delete existing RAP BO node instances. Note that the deletion also affects node instances along the composition.
  • EXECUTE actions: Carry out self-defined modify operations.

In both, managed and unmanaged implementations, all modify operations must be specified in the CDS behavior definition. See more details in the BDL documentation: Define Behavior, Standard Operations. All nonstandard operations (actions) must be self-implemented in the ABP.

Each modify operation requires an internal table (field_spec) of instances as input parameters after the respective keyword to specify the fields that should be modified.

Notes

  • After the keyword BY for create-by-association operations, a backslash (\) must be inserted in front of the associations are displayed via the code completion.
  • Updating and deleting instances via associations is not possible.
  • In draft scenarios, draft instances are created if the draft indicator %is_draft is set to true. If it is set to false, active instances are created.

Variant 1

... CREATE field_spec


Effect

Used to create new node instances of a RAP BO entity.

For the keywords that must follow the keyword CREATE, see the documentation for field_spec.

Example

The following source code section taken from DEMO_RAP_EML_MODIFY_OP_2 demonstrates a CREATE operation.

Variant 2

... CREATE BY \_assoc field_spec


Effect

Used to create new node instances for associated entities for which create must be enabled in the BDEF. The creation is not restricted to compositions. _assoc is the name of the association as it is specified in the underlying CDS view.

For the keywords that must follow the keyword CREATE, see the documentation for field_spec.

Example

The following source code section taken from DEMO_RAP_EML_MODIFY_OP_2 demonstrates a create-by-association operation.

Variant 3

... UPDATE field_spec


Effect

Used to update node instances of a RAP BO. The UPDATE statement allows delta updates on RAP BO consumer side to be triggered where only key fields and the fields with new values must be provided. On RAP BO provider side, the fields to be overwritten and kept are identified.

For the keywords that must follow the keyword UPDATE, see the documentation for field_spec.

Example

The following source code section taken from DEMO_RAP_EML_MODIFY_OP_2 demonstrates an UPDATE operation.

Variant 4

... DELETE field_spec


Effect

Used to delete instances of a RAP BO. Only key field values or %cid_ref are needed to identify which instances are to be deleted.

For the keywords that must follow the keyword DELETE, see the documentation for field_spec.

Example

The following source code section taken from DEMO_RAP_EML_MODIFY_OP_2 demonstrates a DELETE operation.

Variant 5

... EXECUTE action field_spec $[REQUEST request$] $[RESULT result_tab$]


Additions

1. ... REQUEST request

2. ... RESULT result_tab

Effect

Used to trigger custom actions that are defined to modify data in a self-implemented way. The syntax for executing an action allows requested data (REQUEST request) to be specified and result data (RESULT result_tab) to be exported, each action specified in target variables.

For the keywords that must follow the keyword CREATE, see the documentation for field_spec.

Example

The following source code section taken from DEMO_CDS_PURCHASE demonstrates a modify operation executing an action.

Addition 1

... REQUEST request

Effect

Used to specify whether the result should be returned completely or only parts of it (for example, only the keys) for the purpose of improving performance. request must be typed with the required BDEF derived type TYPE STRUCTURE FOR ACTION REQUEST. The components of the structure are all key and data fields of the RAP BO entity. They are of type ABP_BEHV_FLAG and can be flagged to specify whether the respective fields are included or not.

This is optional and can only be used for actions specified in the BDEF with the addition result selective.

Addition 2

... RESULT result_tab

Effect

Actions can optionally return a result. This can only be used for actions specified in the BDEF with the addition result. The internal table result_tab must be of type TABLE FOR ACTION RESULT bdef~action. See more details in RESULT result_tab.






Vendor Master (General Section)   CL_GUI_FRONTEND_SERVICES - Frontend Services  
This documentation is copyright by SAP AG.

Length: 12266 Date: 20230207 Time: 091359     sap01-206 ( 145 ms )