Ansicht
Dokumentation

ABENDERIVED_TYPES_CID_CIDREF_ABEXA - DERIVED TYPES CID CIDREF ABEXA

ABENDERIVED_TYPES_CID_CIDREF_ABEXA - DERIVED TYPES CID CIDREF ABEXA

BAL_S_LOG - Application Log: Log header data   CL_GUI_FRONTEND_SERVICES - Frontend Services  
This documentation is copyright by SAP AG.
SAP E-Book

Using %cid / %cid_ref

This example demonstrates the use of %cid and %cid_ref with a managed RAP BO. Furthermore, it includes the use of the addition AUTO FILL CID with a RAP create operation.

Data model

The CDS data model consists of the root entity DEMO_MANAGED_ROOT_4 and its child entity DEMO_MANAGED_CHILD_4.

Root entity:

Child entity:

Behavior definition

The CDS behavior definition DEMO_MANAGED_ROOT_4 is defined in CDS BDL as follows:

Behavior implementation

For the above CDS behavior definition, one ABP is created. The global class of the behavior pool is BP_DEMO_MANAGED_ROOT_4. The actual behavior implementation takes place in local classes that are defined and implemented in the BP_DEMO_MANAGED_ROOT_4========CCIMP of the behavior pool. In this case, the behavior pool does not include any implementations that are relevant for the example.

Source Code

Execute

Description

Access with ABAP using EML

There are two modify requests that cover multiple RAP modify operations:

  1. With a RAP create operation, multiple RAP BO instances are created that include self-defined content IDs %cid. In the same request, a create-by-association operation creates RAP BO instances for the child entity while using %cid_ref to refer to the instances that have just been created for the root entity. The RAP BO instances for the child also include content IDs %cid which are not referred to in the example. This operation is followed by an update and delete operation in the same request. Both operations use %cid_ref to refer to the instances that have just been created, too. With a COMMIT ENTITIES statement, the instances are saved to the database. The output shows the database table entries as well as the mapped responses for root and child entity to visualize the mapping of %cid and the keys.
  2. For demonstration purposes, the example also covers the use of AUTO FILL CID in a RAP create and create-by-association operation. When specifying the create operation with the addition AUTO FILL CID, %cid is filled automatically. With a COMMIT ENTITIES statement, the instances are saved to the database. The output shows the database table entries - including the entries from the first modify request - as well as the mapped responses for root and child entity.





ROGBILLS - Synchronize billing plans   BAL_S_LOG - Application Log: Log header data  
This documentation is copyright by SAP AG.

Length: 3803 Date: 20240511 Time: 093324     sap01-206 ( 65 ms )