2007 Apr 17 1:43 PM
hallow
what is the <b>best</b> way to move data from itab1 to itab2
regards
2007 Apr 17 1:45 PM
Hi Antonio,
Try
itab2[] = itab1[].
if it doesn't work, you have to do this:
loop at itab1.
move-corresponding itab1 to itab2.
append itab2.
clear itab2.
endloop.
Hope this resolves your query.
Reward all the helpful answers.
Regards
2007 Apr 17 1:45 PM
2007 Apr 17 1:45 PM
Hi,
ITAB1[] = ITAB2[]
if both have same structure
or in the loop of one ITAb, read the other ITBA and append the data or use
Move-corresponding from Itab1 to ITAB2. append itab.
reagrds,
Anji
2007 Apr 17 1:45 PM
2007 Apr 17 1:45 PM
Hi Antonio,
Try
itab2[] = itab1[].
if it doesn't work, you have to do this:
loop at itab1.
move-corresponding itab1 to itab2.
append itab2.
clear itab2.
endloop.
Hope this resolves your query.
Reward all the helpful answers.
Regards
2007 Apr 17 1:45 PM
AT a table level,
If they have same structures, then
itab2[] = itab1[]. is the best.
If they have different structures, you have no other way but to move field by field.
Regards,
Ravi
2007 Apr 17 1:53 PM
Let's assume itab1 and itab2 have the same structure. The best way to move data depends on whether you are trying to move all data or just some of the data. If you are trying to move all of the data from itab1 to itab2, then you should use either
itab2[] = itab1[]. "use if itab2 is empty beforehand
or
append lines of itab1 to itab2. "use if itab2 already has data in it
If you only want to move records from itab1 that meet certain conditions, then use this:
loop at itab1 where condition1 and condition2.
move-corresponding itab1 to itab2.
endloop.
I hope this helps.
- April King