I have a requirement where I have to get the Response payload in the following way:
As we can see in the above response body, we have 3 levels of hierarchy.
E1 has E2(Table Type) as one of its fields, and E2 has E3(Table Type) as one of its fields.
I have created three separate entities in Gateway builder and have joined then through associations and Navigation.
How in my DPC_EXT method should I pass the Response structure as mentioned above?
Currently, I have used the below structure but the problem is, each entity appears separately in the Response; whereas I want the above mentioned format with nested entities like E1->E2->E3.
DATA : BEGIN OF lw_detl.
INCLUDE TYPE zcl_timecod_mpc=>ts_e1.
DATA : e2 TYPE STANDARD TABLE OF zcl_timecod_mpc=>ts_e2 WITH DEFAULT KEY,
e3 TYPE STANDARD TABLE OF zcl_timecod_mpc=>ts_e3 WITH DEFAULT KEY,
END OF lw_detl.
URI used : /sap/opu/odata/sap/ZTMSRV/E1SET?$filter=RefreshOnDate eq '2016-04-08'&$expand=E2,E3