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

In tables.

Former Member
0 Likes
641

I have an internal table (x) with some columns.

I need to create another internal table (y) consisting of a single

column from table (x).

I loop through the table (x), appending each record to the newly created table (y).

Is there a faster way to do this?

1 ACCEPTED SOLUTION
Read only

gastn_jareo
Active Participant
0 Likes
622

You can use this, but ONLY if the field on Y table is the first one in X table:

APPEND LINES OF x TO y.

That appers to work only when x and y has same structure, but actually when y has less fields then x works too if the fields on y has same structure of the firsts fields on x.

As SAP helps says it's 3 to 4 times faster then a loop.

Hope it helps!

You can use this, but ONLY if the field on Y table is the first one in X table:

APPEND LINES OF x TO y.

That appers to work only when x and y has same structure, but actually when y has less fields then x works too if the fields on y has same structure of the firsts fields on x.

As SAP helps says it's 3 to 4 times faster then a loop.

Hope it helps!

4 REPLIES 4
Read only

Former Member
0 Likes
622

Hi Sachin,

How u can append X table records to the Y table. As fields are in compatiable.

plz tell me what is your exact requirement

Thanks,

Suma.

Read only

Former Member
0 Likes
622

hi

If you loop the Y table, read records in X table and append values from X to Y only for that particular field , you can get the logic you are trying for

Read only

Former Member
0 Likes
622

There are two ways,

first one is,

if the table A is appended from some other table then u can move that column

and append table B.

second one is,

Declare two internal tables

ITAB and ITAB1 9with just one field)

loop at iTAB.

itab1-f1 = itab-f4.

append itab1.

clear itab1.

endloop.

ther is no other faster way than this.

Read only

gastn_jareo
Active Participant
0 Likes
623

You can use this, but ONLY if the field on Y table is the first one in X table:

APPEND LINES OF x TO y.

That appers to work only when x and y has same structure, but actually when y has less fields then x works too if the fields on y has same structure of the firsts fields on x.

As SAP helps says it's 3 to 4 times faster then a loop.

Hope it helps!