cancel
Showing results for 
Search instead for 
Did you mean: 

How to read associated entity

former_member602416
Participant
0 Kudos

Hi,

I need to read associated entity in my application. I got to know below syntax from one of the thread but it doesn't work.  It returns customer entity data only but i need to read both customer and Address entity.

/sap/opu/odata/SAP/TOP/ContactPersons('XXXXXXX')?&?$expand=Address

Any help would be appreciated.

Thanks,

Swati

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member182372
Active Contributor
0 Kudos

Section 4.6

http://www.odata.org/documentation/odata-version-2-0/uri-conventions/

should be

/sap/opu/odata/SAP/TOP/ContactPersons('XXXXXXX')?$expand=Address

scott_stefanich
Active Participant
0 Kudos

Hello Swati,

Perhaps it is a typo in copying the URL, but try removing the extra '?&':

/sap/opu/odata/SAP/TOP/ContactPersons('XXXXXXX')?$expand=Address


If removing '?&' doesn't resolve the issue, you can try directly examining the service metadata and ContactPersons entity to confirm the association and link to Address, respectively.


/sap/opu/odata/SAP/TOP/$metadata


/sap/opu/odata/SAP/TOP/ContactPersons('XXXXXXX')


Regards,

Scott