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

Append data from Internal table to another

Former Member
0 Likes
629

Hi,

I have two internal tables defined as follows:


data: lt_1 like ztable occurs 0.
data: lt_2 like ztable occurs 0.
data: ls_1 like line of lt_1[].
data: low type i value '1',
hight type i value '20,000',
limit type i.

The logic in my program fills data into lt_1.


describe lt_1.
limit = sy-tfill.

Till high < limit I want to perform following:

APPEND rows from low to high in lt_1 to lt_2.

Then increment both low and high with the value of high.


low = low + high.
high = high + high.

I can read lt_1 into ls_1 and then copy fields from ls_1 to header line of lt_2 and then do append for lt_2.

But can this append be done directly without looping throught lt_1 and doing copy of fields.

Thanks,

CD

1 ACCEPTED SOLUTION
Read only

naimesh_patel
Active Contributor
0 Likes
398

Check help on syntax APPEND specifially for the LINES OF jtab FROM idx1 TO idx2

You can use it like this:


 APPEND LINES OF jtab FROM L_LOW TO L_HIGH TO ITAB.

Regards,

Naimesh Patel

2 REPLIES 2
Read only

Former Member
0 Likes
398

Press F1 on APPEND LINES OF ...

Rob

Read only

naimesh_patel
Active Contributor
0 Likes
399

Check help on syntax APPEND specifially for the LINES OF jtab FROM idx1 TO idx2

You can use it like this:


 APPEND LINES OF jtab FROM L_LOW TO L_HIGH TO ITAB.

Regards,

Naimesh Patel