cancel
Showing results for 
Search instead for 
Did you mean: 

SAP RAP Custom entity referential constraint error with composition and @OData.property.name

0 Kudos
233

 

Hi Community,

I'm currently working on an SAP RAP unmanaged scenario using Custom Entities in ABAP Cloud, and I’ve run into an issue when trying to expose metadata.

Scenario:

I have two custom entities defined as follows:


Root Entity:

 
@EndUserText.label: 'Custom Root entity for Parent'
define root custom entity ZParent {
  @OData.property.name: 'SessionId'
  key SESSION_ID : abap.int1;

  _Child : composition [1..1] of ZChild;
}

Child Entity:

 

 
@EndUserText.label: 'Custom entity for Child'
define custom entity ZChild {
  @OData.property.name: 'SessionId'
  key SESSION_ID : abap.int1;

  _Parent : association to parent ZParent on _Parent.SESSION_ID = $projection.SESSION_ID;
}

Issue:

When I try to access the $metadata of the service, I receive the following error:

Code: SY/530  
Message: Association assoc_0FCF7701A629F6O035FFE9E6E21380F1: referential constraint property not found in entity ZChildType.

Interestingly, the error does not occur when the @odata.property.name annotation is removed.


Question:

Does the RAP framework not automatically handle property name mapping when using @odata.property.name?

Is there an annotation or recommended approach to handle referential constraints in this case?


Any insights or guidance would be greatly appreciated!

Thanks & Regards,
Aftab

View Entire Topic
former_member206066
Participant
0 Kudos

Hello experts,

Anyone can help me out by telling the program name to update data from MARA table to the data sources 1CL_OMAT003 and 1CL_OMAT006.

Thanks,

Ipsita