cancel
Showing results for 
Search instead for 
Did you mean: 

how to get a response from odata with a deep structure

naotoxxx
Participant
0 Kudos

Hello i'm looking for some info about how can i get a structure and inside it a internal table? like:
Field1

Field2

Field3

Internaltable (Field1 Field2)

something like the above example

Accepted Solutions (0)

Answers (4)

Answers (4)

Andre_Fischer
Product and Topic Expert
Product and Topic Expert
0 Kudos

If one or more answers have answered your question please click on "✓ Accept"

RalfHandl
Product and Topic Expert
Product and Topic Expert
0 Kudos

OData V4 in addition allows collections of complex values, see the example service TripPin example service. Here AddressInfo is a collection of structured values.

olav_rask2
Explorer
0 Kudos

Hey Ralph,

I realize this is an old answer, but do you have any idea how to make this work int NetWeaver Gatway?

Best,

Olav

mvaibhav
Contributor
0 Kudos

hi Naoto,

You will need to define your Parent entity with Navigation Properties & Association between the Parent Entity to Child Entity in the service.

Then you can implement either the get_Expanded_Entity method of the class or individual Get_entity & Get_EntitySet Method of Parent and Child entity.

Then you can use the $expand request as mentioned by Andre above to get the data in a single request.

Thanks,

Vaibhav Maheshwari

Andre_Fischer
Product and Topic Expert
Product and Topic Expert
0 Kudos

Not sure what exactly you are looking for.

But OData offers to get a hierachial response using the query option $expand.

https://sapes5.sapdevcenter.com/sap/opu/odata/iwbep/GWSAMPLE_BASIC/SalesOrderSet(%270500000001%27)?$...