I am trying to implement deep insert for the multiple tables by doing the associations and navigation. I can able to post the data with parent and subparent values but i am facing the issue with fetching the values for sub parent children.
this is my payload how it looks like.
{
"d": {
"Gjahr": "2019",
"INVTODATE": [{
"Iblnr": " ",
"Zldat": "2019-12-16T00:00:00"
}],
"INVTOITEM": [{
"Material": "254620",
"Item": "1",
"EntryQnt": "200",
"EntryUomIso": "EA",
"ITEMTOSERIALS": [{
"Item": "1",
"Serialno": [{
"Serialno": "233"
}, {
"Serialno": "233"
}]
}]
}]
}
}
in the above payload, "ITEMTOSERIALS" is the children for the "INVTOITEM" subparent. Here I could able to get the posted values till sub parent(deep insert).
This is the code which I am using to fetch the deep insert values
CASE lv_entityset_name.
WHEN 'INVENTORYSet'.
io_data_provider->read_entry_data( IMPORTING es_data = ls_deep ).
ls_inventory-iblnr = ls_deep-iblnr.
ls_inventory-gjahr = ls_deep-gjahr.
LOOP AT ls_deep-INVTODATE INTO ls_date.
ls_dates-zldat = ls_date-zldat.
ENDLOOP.
LOOP AT ls_deep-INVTOITEM INTO ls_item.
IF ls_item-entry_qnt EQ 0.
ls_item-zero_count = 'X'.
ELSE.
ls_item-entry_qnt = ls_item-entry_qnt.
ENDIF.
MOVE-CORRESPONDING ls_item TO ls_items.
APPEND ls_items TO lt_items.
ENDLOOP.
LOOP AT ls_deep-ITEMTOSERIALS INTO ls_serials.
MOVE-CORRESPONDING ls_serials TO ls_serials1.
APPEND ls_serials1 TO lt_serials.
ENDLOOP.
Is there any solution to fetch the sub parent children values? or Is there anything I need add it in Association?