How we can send data to a line type of field in a deep structure?
I got an object in the in badi extension .In that I have to retrieve the serial id from objk table and assign that serial id to the line type SAPPLSEF_SERIAL_ID of table type SAPPLSEF_SERIAL_ID_TT in the field SERIAL_ID of the structure SAPPLSEF_DLV_ITEM_INF and this structure is a line type of a SAPPLSEF_DLV_ITEM_INF of table type SAPPLSEF_DELIVERY_ITEM_INF_TAB for the filed ITEM in the structure SAPPLSEF_DLV_INF
Just create a internal table of the same table type assigned to the field, you can do it as deep as you need. It would be something like this:
ls_structure TYPE SAPPLSEF_DLV_INF,
lt_item TYPE SAPPLSEF_DELIVERY_ITEM_INF_TAB,
lt_obj TYPE SAPPLSEF_SERIAL_ID_TT.
<s_item> TYPE SAPPLSEF_DLV_ITEM_INF,
<s_obj> TYPE SAPPLSEF_SERIAL_ID.
lt_item = ls_structure-item.
LOOP AT lt_item ASSIGNING <s_item>.
lt_obj = <s_item>-SERIAL_ID.
LOOP AT lt_obj ASSIGNING <s_obj>.
<s_obj>-xxx = 'XXXX'.
@Eitan was faster, when I wrote I didn't see his reply.
Message was edited by: Felipe Simionatto