cancel
Showing results for 
Search instead for 
Did you mean: 

Multilevel Expand / Deep Entity

Former Member
0 Kudos

Hello fellow SAP friends.

I'm trying to see the possibility of a multilevel deep entity for both, expand and create deep entity methods. The current scenario I want to try is as follows:

In an hypotetic case, we have:

-     Loan - Header

     -     Customer - Header

          -     Address

          -     Contacts

               -     Insurance - Header

                    -     Insurance Beneficiary

I have been able to do the first relation from Loan to Customer and to it's related entities, such as Addresses, Contacts and so on.

However whenever I try to do single call to get the relations with the full data from Loan to Insurances, whenever the service responds, the info regarding the insurance level and it's related entity comes empty all the time. This is how I coded the relationships, I have also made sure that the names of the navigations are equal when defining the types.

The question is basically, it's this the right way to define the Types correct or such level of deep entity will not be able to be called in the same service call.

Any input will be good to see if this is doable or not and thank you guys in advance.

Cheers.

Accepted Solutions (1)

Accepted Solutions (1)

AshwinDutt
Active Contributor
0 Kudos

Hello Emmanuel,

Firstly please cross the check the cardinality defined between the entities and the association between them in the GW model.

Can you share that details here ?


Make sure the navigation property names defined in the GW model is same as the ones used while declaring the tables inside the deep structure.

Regards,

Ashwin

Former Member
0 Kudos

Thank you for the Reply Ashwin:

Yeah I checked the navigation properties, the names betwen them and the ones in the code match:

As for the cardinality, this is what's actually in the model:

It seems correct, but perhaps I'm not coding the types correctly.

Thank you for your comments.

AshwinDutt
Active Contributor
0 Kudos

Hello Emmanuel,

Please change the cardinality defined between Customer & Insurance to 1 to M and check.

Can you share how the navigation properties are passed in the URL also ?

Regards,

Ashwin

Former Member
0 Kudos

Thank you for the advice Ashwin, I'll make sure to test out this and will post the results.

Again, thank you!

Former Member
0 Kudos

I tried the change as your said, now it works correctly, thank you very much.

As for how I pass the navigation properties in the URI, I do it as follows:

...&$expand=CustomerSet/AddressSet,CustomerSet/PhoneSet,CustomerSet/ImageSet,CustomerSet/InsuranceSet/InsuranceBeneficiarySet

This retrieves me the full expand collection with the data from all the relationships.

Answers (0)