Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Copying table data to another table

Former Member
0 Likes
761

I have a table with data and similar table with no data.

How to copy the table data into another table. Can any one suggest easy method?

I have a table with data and similar table with no data.

How to copy the table data into another table. Can any one suggest easy method?

5 REPLIES 5
Read only

Former Member
0 Likes
722

use this

LOOP AT table 1

MOVE-CORRESPONDING table1 TO table2.

APPEND table2.

ENDLOOP.

Corresponding is used when both the tables have same field names. plz Make sure

thanks

Read only

Former Member
0 Likes
722

For Internal Tables...


T_TABLE2[] = T_TABLE1[].

For dictionary tables...

[Taking good care of Z Data|https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3340] [original link is broken] [original link is broken] [original link is broken];

Greetings,

Blag.

Read only

Former Member
0 Likes
722

itab[ ] = jtab[ ].

Read only

Former Member
0 Likes
722

Those tow are database tables.

Example : Need to copy data from database table ztest1 to another database table ztest2.

Read only

0 Likes
722

Then you have download that data int o an internal table in your program then should update into second internal table.

select * from ztable1 into itab.

if not itab[] is initial.

modify ztable2 from table itab.

endif.

Thanks,

Naren

Edited by: Naren Someneni on Mar 5, 2008 3:44 PM