03-19-2007 5:29 PM
Hi,
Hi have two Z tables that I created (Z1 and Z2), and I fill the Z1 in a program. Then, I want to copy the content of Z1 to Z2 in another ABAP program.
Is there any faster way to do it than making:
select * from Z1
into Z1_aux.
insert Z2 from table Z1_aux.
Thanks.
BR,
Sónia Goncalves
03-19-2007 5:38 PM
Hi,
If both the table structures are same...Then you can use the following..
select * from Z1
into table Z1_aux.
MODIFY Z2 from table Z1_aux.
Thanks,
Naren
03-19-2007 6:11 PM
Hi,
If both two ztables have the same structures then you can try this.
select * from Z1
into Z1_aux.
Z2[] = Z1[].
If they don't have the same structures then please try this.
select * from Z1
into Z1_aux.
loop at Z1.
move-corresponding Z1 to Z2.
append Z2.
endloop.
Regards,
Ferry Lianto
03-19-2007 6:16 PM
Hi Sonia,
Use the statement
<b>Z2[] = Z1[].</b>
If you want move the content of Z1_AUX into Z2 then
<b>Z2[] = Z1_AUX[].</b>
Thanks,
Vinay
03-20-2007 3:36 AM
If both tables have the same structure.
Z2[] = Z1[].
If therz a mismatch in the structure then
loop at Z1 into wa_Z1.
move-correponding wa_z1 to wa_z2.
append wa_z2 to z2.
clear : wa_z1,
wa_z2.
endloop.