Application Development 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: 

how to collect an internal table in ABAP

Former Member
0 Kudos

Hi,

I am eager to know, is there a way in ABAP to collect an internal table lines into another itab without looping over the lines of the source itab.

I just want to make sure I am not missing something.

thanks.

ahmet sahan

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Ahment,

You can do this like this:

x_int_table_1[] = x_int_table_2[].

This will copy all the lines of x_int_table_2 to x_int_table_1.

Hope that helps.

Brad

4 REPLIES 4

Former Member
0 Kudos

Hi Ahment,

You can do this like this:

x_int_table_1[] = x_int_table_2[].

This will copy all the lines of x_int_table_2 to x_int_table_1.

Hope that helps.

Brad

Former Member
0 Kudos

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

This link explains the COLLECT with example.

http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/collect.htm

But if you just want to move the lines,you can do so by

APPEND lines of itab1 to itab2.

Former Member
0 Kudos

Hi Ahmet,

If you are talking about using the COLLECT keyword, then you will have to loop at the source table.

But if you have used the word <i>collect</i> as a normal verb, then Brad's answer is the best.

Regards,

Anand Mandalika.