‎2005 Jun 29 1:18 AM
Hi,
if i have two internal tables itab1, itab2 and if i want to append itab1 to itab2 what would be the best approach.
your help would be appreciated.
Thanks,
kranthi.
‎2005 Jun 29 5:18 AM
Hi,
If ITAB1 and ITAB2 are of same structure,then you can use
<b>Append lines of itab1 to itab2.</b>
If the strutures are different,then
loop at itab1 into wa1.
move-corresponding wa1 to wa2.
append wa2 to itab2.
endloop.
Kindly reward points,if it is useful.Otherwise,get back.
‎2005 Jun 29 4:55 AM
Hi,
Check the following code -
REPORT ZSRI_MERGE_ITAB .
data: begin of itab1 occurs 0 ,
lifnr like lfa1-lifnr ,
land1 like lfa1-land1 ,
name1 like lfa1-name1 ,
end of itab1 .
data: begin of itab2 occurs 0 ,
lifnr like lfa1-lifnr ,
land1 like lfa1-land1 ,
name1 like lfa1-name1 ,
end of itab2 .
select lifnr land1 name1
from lfa1 into itab1 up to 2 rows .
append itab1.
endselect.
select lifnr land1 name1
from lfa1 into itab2 up to 3 rows.
append itab2.
endselect.
.
loop at itab1.
write: / itab1.
endloop.
write: / 'ITAB2'.
loop at itab2.
write: / itab2.
endloop.
write: / 'After appending'.
append lines of itab1 to itab2.
write: / 'ITAB2'.
loop at itab2.
write: / itab2.
endloop.
APPEND LINE OF... --> this will help u
Revert in case of any issues, else reward points.
Regards
‎2005 Jun 29 5:18 AM
Hi,
If ITAB1 and ITAB2 are of same structure,then you can use
<b>Append lines of itab1 to itab2.</b>
If the strutures are different,then
loop at itab1 into wa1.
move-corresponding wa1 to wa2.
append wa2 to itab2.
endloop.
Kindly reward points,if it is useful.Otherwise,get back.