Link related EML operations before a final key is known
Some BOs assign a key during creation, or the consumer may not know it yet. %cid gives the create operation a temporary identifier within one EML request; %cid_ref can refer to that instance in a subsequent operation in the same request.
Create, then update by reference
MODIFY ENTITIES OF ZR_PURCHASE_REQUEST
ENTITY Request
CREATE FIELDS ( RequestId SupplierId Status )
WITH VALUE #( ( %cid = 'new-2208' RequestId = 'PR-2208'
SupplierId = 'SUP-048' Status = 'OPEN' ) )
UPDATE FIELDS ( Status )
WITH VALUE #( ( %cid_ref = 'new-2208' Status = 'IN_REVIEW' ) )
MAPPED DATA(mapped)
FAILED DATA(failed)
REPORTED DATA(reported).
%cid is request-local; it is not a permanent business key. Use a unique content ID for each create in a combined request, and inspect response tables to learn whether operations succeeded. This also helps connect parent and child operations in deep-create scenarios.
The snippet requires a BO that supports these fields and operations. Its key behavior and create permissions come from the BDEF; names shown here are fictional.
Sources
Developer practice · ABAP
Practice: update a just-created request
Create a request with %cid, then update that same not-yet-persisted instance using %cid_ref in the same EML request.
This choice changes the output pattern checked here: WRITE belongs in a classic executable report, while out->write( ) uses the supplied output reference in an ABAP Cloud class-run method. It does not switch the language version of the other code; check release and API availability in your target system.
Complete the task and include the output statement shown for your selected environment. Variable names can differ if you use them consistently. This browser checker checks structure only; it does not compile or run ABAP.
0 required structures detected · 0 checks
Write your solution, then check its structure.
One possible solution
MODIFY ENTITIES OF ZR_PURCHASE_REQUEST
ENTITY Request
CREATE FIELDS ( RequestId SupplierId Status )
WITH VALUE #( ( %cid = 'new-2208' RequestId = 'PR-2208' SupplierId = 'SUP-048' Status = 'OPEN' ) )
UPDATE FIELDS ( Status )
WITH VALUE #( ( %cid_ref = 'new-2208' Status = 'IN_REVIEW' ) )
MAPPED DATA(mapped)
FAILED DATA(failed)
REPORTED DATA(reported).
DATA(result) = 'Create and update are linked within this request'.
WRITE result.out->write( result ).These are context-specific output examples. In your own program, use the result variable from your solution and the output mechanism available in that program.