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

data transfer between 2 tables

Former Member
0 Likes
956

HI Guys,

i have a table like table1 with 4 fields, and 5 records, data.

i had created another table2 with just copy from table1.

so both tables table1,table2 having same structure.

now the question is how to copy the data i.e, 5 records from table1 to table2.

plz let me know the clear scenario.

Thanks in Advance,

Amit.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
916

select * from table1 into itab.

insert <table2> from table itab.

7 REPLIES 7
Read only

Former Member
0 Likes
916
table2[] = table1[].
Read only

Former Member
0 Likes
916

Hi,

try this way if structures are same

table1[] = table2[].

Cheers,

Kothand

Read only

Former Member
0 Likes
916

table2[] = table1[]

Read only

GauthamV
Active Contributor
0 Likes
916

hi,

use move or move-corresponding statement.

Read only

Former Member
0 Likes
917

select * from table1 into itab.

insert <table2> from table itab.

Read only

0 Likes
916

Hi

if you have created standard internal tables then to copy data from one table tab1 to another table tab2 use

append lines of tab1 to tab2.

if you have created tables in abap dictionary then to copy data from one table tab1 to another table tab2 use

data :itab type table of tab1 with header line.

select * from tab1 into table itab.

loop at itab.

insert tab2 from itab.

endloop.

Read only

Former Member
0 Likes
916

hiiiiiii

use

move itab2 to corresponding fields of itab2.

this will surely help you.