on 11-24-2021 11:23 AM
Hello all,
I have a deep structure that
TYPES : BEGIN OF ty_deep,
lineid TYPE i,I have data to an internal table DATA : lt_deep TYPE TABLE OF ty_deep (deep structure) below,
lineid asset(internal table) operbud(internal table)
10 [ (row1) 10 Asset000110 ] [ (row2) 10 Operbud000110 ]
[ (row2) 10 Asset000210 ] ___________________________
20 [ (row1) 20 Asset000120 ] [ (row2) 20 Operbud000120 ]
___________________ [ (row2) 20 Operbud000220 ]
And I have a flat structure like
TYPES : BEGIN OF ty_flat,
lineid TYPE i,
asset_no TYPE char20,
oper_bud TYPE char20,
END OF ty_flat.
An internal table DATA : lt_flat TYPE TABLE OF ty_flat.
I want my output to be in format below
Lineid asset_no oper_bud
10 Asset000110 Operbud000110
10 Asset000210 Operbud000210
20 Asset000120 Operbud000120
20 Asset000220 Operbud000220
Kindly help me to solve this.
Thank you,
Vidhya V
LOOP AT it_deep
REFERENCE INTO DATA(o_deep_line).
DO.
READ TABLE o_deep_line->asset REFERNCE INTO DATA(o_asset_subline) INDEX sy-index.
IF o_asset_subline IS BOUND.
data(lv_asset_subline) = o_asset_subline->....
ENDIF.
READ TABLE o_deep_line->oper_bud REFERENCE INTO DATA(o_oper_subline) INDEX sy-index.
IF o_oper_subline IS BOUND.
data(lv_oper_bud) = o_oper_subline->....
ENDIF.
if o_oper_subline is not bound and o_asset_subline is not bound.
exit.
else.
append value #( lineid = o_deep_line->lineid
asset = lv_asset_subline
operbud = lv_oper_bud ) to it_flat.
endif.
ENDDO.
ENDLOOP.
something like that (not tested, not re-readed)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
97 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.