‎2005 Sep 08 7:42 AM
Hi All,
Please tell me how to Copy records from itab1 {1,5,6,7} to itab2 {10,16,9,20} in reverse order.
Thanks,
Sri.
‎2005 Sep 08 8:07 AM
Hi Sriram,
You can try something like this -
itab1 - 1 5 6 7.
sort itab descending - 7 6 5 1.
loop at itab1.
append itab1 to itab2.
endloop.
itab2 - 10 16 9 20 7 6 5 1
sort itab1 asscending - 1 5 6 7Regards,
Anand Mandalika.
‎2005 Sep 08 8:07 AM
Hi Sriram,
You can try something like this -
itab1 - 1 5 6 7.
sort itab descending - 7 6 5 1.
loop at itab1.
append itab1 to itab2.
endloop.
itab2 - 10 16 9 20 7 6 5 1
sort itab1 asscending - 1 5 6 7Regards,
Anand Mandalika.
‎2005 Sep 08 8:34 AM
Or (if you don't want to sort).
describe table itab1 lines n.
n2 = n.
do n2 times.
read table itab 1 index n into wa_itab1.
append wa_itab1 to itab2.
n = n - 1.
enddo.
P.S. consider this psuedo code.