cancel
Showing results for 
Search instead for 
Did you mean: 

What is the use of %cid in RAP entity?

phoenixming0912
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi all, I'm developing API based on RAP bo.

In batch request, there could be multi entities as import parameter in one changeset, and in RAP internal table, I see a field %cid. I thought it is content id which was provided in batch request body, but after I tried to set it, it was not shown in debugging.

I think this is the field to differentiate the entity with same key in batch. Please correct me if I was wrong.

Regards,
Eric

  • SAP Managed Tags:

Accepted Solutions (0)

Answers (1)

Answers (1)

Sijin_Chandran
Active Contributor
0 Kudos

Hello,

Your understanding is correct! Let me explain further.

Suppose there is a Primary(Root) Entity lets name EntitySet1 and there is a Dependent Child Entity lets name it EntitySet2. And we are Triggering a CREATE operation. So, obviously in the Payload we would be passing values for EntitySet1 and EntitySet2 values using the Navigation Property.

Now you can consider this %CID as part of EML(Entity Manipulation Language) structures as a Temporary Key fields to uniquely identify the records. Temporary in the sense until the real Business Object identifiers are generated. Now, in this you can visualize the below scenario,

Suppose a Payload is passed with Root Entities and Child Entities values and while accessing the Payload say during  a CREATE operation in the  Behavior Pool Class you want to link a Root Entity record with its corresponding Child Entity Records then the same could be done using below link:

ENTITIES_CBA-%cid_ref = ENTITIES-%cid.

Left side is the EML runtime structure for Child Entity and Right side is the EML runtime structure for Root Entity.

Where CBA is for Create By Association.

Please refer the below link for more detail:

https://help.sap.com/docs/abap-cloud/abap-rap/implicit-response-parameters

Thanks,

Sijin