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 tables

Former Member
0 Likes
1,277

Hiee friends ,

I am new to abap .I copied a standard sap table [sflight ] to zsflight .the table is getting copied but the data in sflight is not getting copied into zsflight .

Is there any ways to copy both the table and its data contents to another customizable table .

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,171

Hi Lokesh,

To copy the data from a database table into a ztable,

you need to select the data from the database table into an internal table and insert the data into the target ztable, through ABAP Program.

Select * from sflight

into table t_sflight.

loop at t_sflight.

insert into <ztab1>....

endloop.

Regards,

Chandra Sekhar

Hiee friends ,

I am new to abap .I copied a standard sap table [sflight ] to zsflight .the table is getting copied but the data in sflight is not getting copied into zsflight .

Is there any ways to copy both the table and its data contents to another customizable table .

8 REPLIES 8
Read only

JozsefSzikszai
Active Contributor
0 Likes
1,171

hi,

unfortunately there is no automatic way. you have to recreate the data through ABAP, or manually.

hope this helps

ec

Read only

0 Likes
1,171

How can we do it through abap ??

Is it possible through bdc ?

Friends i am really new to abap ,so don't have indepth knowledge of abap .plse don't mind as me asking such questions.

Read only

0 Likes
1,171

no problem, we all started somewhere...

you can't use bdc for this!

ABAP way:

1. select all data from sflight into internal table

2. instert all data into zsflight! (check INSERT statement in SAPHelp!)

Read only

Former Member
0 Likes
1,171

Hi,

You can not copy the data of any database table whenever you are copying standard table to Custom table or ztable.

Only the definition is copied not the contents.

For data you have to enter manuallly through table maintenace generator of through program.

Regards,

sujit

Read only

Former Member
0 Likes
1,171

Hi,

Create a program to fetch all the data from sflight, pu it into a internal table and then upload those data into ur ztable.

Thnaks,

Read only

Former Member
0 Likes
1,171

Hi,

There is no direct way.What you can do create a zprogram, in this program create a workarea and an internal table of type sflight. Now fetch the data from sflight table into this internal table. Now with the help of this internal table insert the data into your ztable.

Regards

Abhijeet

Read only

Former Member
0 Likes
1,172

Hi Lokesh,

To copy the data from a database table into a ztable,

you need to select the data from the database table into an internal table and insert the data into the target ztable, through ABAP Program.

Select * from sflight

into table t_sflight.

loop at t_sflight.

insert into <ztab1>....

endloop.

Regards,

Chandra Sekhar

Read only

Former Member
0 Likes
1,171

Thanks friends for all these valuable reply .