‎2008 Jun 17 10:01 AM
Hai friends,
I am getting the data matnr : 13235,12124,34234
and maktx : aaaa,bbbb , cccc
and lgort : 234, 345, 456
But I have taken the structure as begin of itab
matnr like -
,
maktx like -
,
lgort like-----,
end of itab.
now the data as i need to append first row as 13235 to matnr
aaaa to maktx
234 to lgort,
and second row as 12124 to matnr
bbbb to maktx
345 to lgort
and same as third row
Iam spliting the data but the problem is here matnr is variable i.e based on counter of matnr it should append those no of rows
please give the solution,
prasad.
‎2008 Jun 17 10:14 AM
Hi Prasad,
Loop at i_matnr.
itab-matnr = i_matnr-matnr.
Read table i_maktx with key matnr = i_matnr-matnr.
if sy-subrc = 0.
itab-maktx = i_maktx-maktx.
endif.
Read table i_lgort with key matnr = i_matnr-matnr.
if sy-subrc = 0.
itab-lgort = i_lgort-lgort.
endif.
append itab.
Endloop.
‎2008 Jun 17 10:14 AM
Hi Prasad,
Loop at i_matnr.
itab-matnr = i_matnr-matnr.
Read table i_maktx with key matnr = i_matnr-matnr.
if sy-subrc = 0.
itab-maktx = i_maktx-maktx.
endif.
Read table i_lgort with key matnr = i_matnr-matnr.
if sy-subrc = 0.
itab-lgort = i_lgort-lgort.
endif.
append itab.
Endloop.