Skip to Content
0

$EXPAND multi-level Issues with SAP ODATA

Feb 20, 2017 at 03:23 PM

56

avatar image

We have redefined method to expand entitysets. It works ok until we remain at one level. Following expand is correct:

DATA: BEGIN OF lwa_data.
DATA: network TYPE zcl_z_ps_delivery_imt_mpc_ext=>ts_network.
DATA: milestoneset TYPE zcl_z_ps_delivery_imt_mpc_ext=>TT_MILESTONE.
DATA: siteabsset TYPE zcl_z_ps_delivery_imt_mpc_ext=>TT_SITEABS,

END OF lwa_data.

We expand a collection of networks with their own milestones and site absolutes. It works fine because milestoneset and siteabsset are the names of the navigation properties for entity network.

Now we want to go one step further by adding one more entity PROJECT that contains all other ones => Project has several networks which have several milestones and several site absolutes. We defined deep structure using DDIC and it looks ok at time to execute the COPY back. Data is correctly filled but in the response we can only see the lowest levels (milestones and site abs). Upper levels are present but they contain null values.

We suspect that the names of the elements have some importance but what to do ? Our deep structure now looks like this:

PROJECT => N Networks => N Milestones + N site abs

So we have an expanded collection of projects at 3 levels.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Kuppireddi Sireesh Feb 20, 2017 at 08:13 PM
0

I think we need to create another structure for networks and then include that structure as a table in Project like here. Almost like

data: Begin of lw_project,

include structure zcl_z_ps_delivery_imt_mpc_ext=>ts_project,

data: networks type standard table of ls_networks,

DATA: BEGIN OF ls_networks.
include structure zcl_z_ps_delivery_imt_mpc_ext=>ts_network.
DATA: milestoneset TYPE zcl_z_ps_delivery_imt_mpc_ext=>TT_MILESTONE.
DATA: siteabsset TYPE zcl_z_ps_delivery_imt_mpc_ext=>TT_SITEABS,

END OF ls_networks.

Share
10 |10000 characters needed characters left characters exceeded