Skip to Content
Feb 24, 2016 at 09:24 AM

OData entity association from CDS view : CX_SADL_CONTRACT_VIOLATION



I created an OData service using SEGW and CDS view thanks to this excellent blog :

Creating Odata services out of CDS views

Everything works fine and I really apreciate building OData service with all the sorting and filtering options automatically generated.

Although I face a problem when I am using CDS and associations. It doesn't work and I get this error :



I created a MATERIALS entity, with entityset MATERIALSSet and mapped to a CDS view ZV_MATERIALS_ASSO which have an association to CDS view ZV_MAT_CARAC.

I created a CARACTERISTICS entity, with entityset CARACTERISTICSSet and mapped to CDS view ZV_MAT_CARAC.

I created an association in segw from materials to caracteristics.

Everything works fine until I mapped the segw association to CDS association like explain in this thread . Then I get this error CX_SADL_CONTRACT_VIOLATION when I request MATERIALSet or CARACTERISTICSSet.

I have the feeling that it is a bug from standard SAP, but maybe there is a special way to build these associations using SEGW and CDS ? Why is it looking for BSA_CARACTERISTICSSet_MATERIALSSet ? What is this entityset ?

If there is no solution, I am open for another way to build oData service easily because coding all filters and sorting properties are very time consuming...

Thank you