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

Copy one table to another

aasim_khan
Participant
0 Likes
15,912

Dear Experts !

Could anyone tell me how to copy one table to another along with its data? Is there any TCode available for this?

--

Aasim

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
8,088

HI,

1) while copying the one table to another table we have the COPY(cntl +f5) option in the SE11.

2) for copying the entries from one DB table to another DB table we have 2opptions.

a) slect all your table entries into one request and move to another table.

b) select all your first table entries into one internal table then insert those entries into second DB table with the INSERT statemnt.

hope this will useful to you..

Regards,

Prasanth

10 REPLIES 10
Read only

Former Member
0 Likes
8,088

There's copy option provided in se11 (ctrl + f5).

A search on sdn would have given u the answer faster so next time do use the search option

кu03B1ятu03B9к

Edited by: kartik tarla on Dec 29, 2008 12:43 PM

Read only

0 Likes
8,088

Hi.

you can copy only schema of a table to another table in se11.

its not possible to copy data ..

Read only

0 Likes
8,088

Well guys, just wanted to know whether any option is available for this in SAP. I know how to copy the table thru SE11 and Swati is right only the schema gets copied, but wanted to know for the "data" part as well.

Thanks anyways

Cheerz!

Aasim

Read only

Former Member
0 Likes
8,088

once u copy ur table using se11 u can use this code.

select * from tab1 
into table itab 
where .....

insert tab2 from table itab accepting duplicate keys.

This will copy all the data from tab1 to tab2

Edited by: kartik tarla on Dec 29, 2008 12:47 PM

Read only

0 Likes
8,088

Hi frends, I have used function "F4_FILENAME" and "GUI_UPLOAD" to upload a text file in notepad on my desktop to an internal table in SAP.after that i used the folowing code suggested by GUEST to copy data from one table to other:

insert tab2 from table itab accepting duplicate keys.

But my problem is that in tab2 i have total 5 fields.In notepad file i have written following two words:

achal

mehra

now when i copy the data from itab to tab2 , it shows word "achal" in the field 1 of 1st row and "mehra" in field 1 of 2nd row only.

what i want is to store "a" in field1 "c" in field2 and so on in row 1.

similarly "m" in the second row and field1.

PLZ guide me.I am new to ABAP.

Edited by: achalmehra on Sep 9, 2009 8:16 AM

Read only

Former Member
0 Likes
8,089

HI,

1) while copying the one table to another table we have the COPY(cntl +f5) option in the SE11.

2) for copying the entries from one DB table to another DB table we have 2opptions.

a) slect all your table entries into one request and move to another table.

b) select all your first table entries into one internal table then insert those entries into second DB table with the INSERT statemnt.

hope this will useful to you..

Regards,

Prasanth

Read only

0 Likes
8,088

Execute function module "SE16N_INTERFACE" with Edit option. Copy source data shown in SE16N_INTERFACE and just paste it for other table and do save.

Thanks

Amol Lohade

Read only

0 Likes
8,088

Hi Amol,

Could you give me a sample code on this FM?

Read only

0 Likes
8,088

You don't need to write any code. Just execute the function module through SE37 by passing Table name and EDIT = 'X'.

Thanks

Amol Lohade

Read only

matt
Active Contributor
0 Likes
8,088

1. Really old question already answered

2. They also wanted to copy the data