on 03-14-2016 12:46 PM
I need a response as shown above.
Thanks & Regards,
Thejus Singh J
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Thejus,
Below will give an idea. (Create your own entities with meaningful names)
Create 3 entities :
Header, Item1 & Item2
Create association between Header & Item1 with cardinality 1 to N
Create association between Item1 & Item2 with cardinality 1 to N
Create Navigation Item1 between Header & Item1
Create Navigation Item2 between Item1 & Item2
Implement Expand Entity Set method.
Inside this define a deep structure and a table type which represents the above data model.
Fill the data accordingly in it and return the final table as GW response.
At the end append the navigation property ITEM1/ITEM2 to et_expanded_tech_clauses
Your URL would like this :
/sap/opu/odata/sap/<ServiceName>/HeaderSet?$expand=Item1/Item2
This way you will get the nested response which you want. This holds all your headers and their corresponding items data.
Check this for the technical help.
Regards,
Ashwin
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.