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 /Insert Table in Table

Former Member
0 Likes
438

Hi

How i can insert or append data from a table into in other table. This Example show you, what i mean.


types: begin of tt_table,
        i1 type i,
        i2 type i,
        i3 type i,
       end of tt_table.

data lt_t1 type table of tt_table.
data lt_t2 type table of tt_table.

data ls_st type tt_table.

start-of-selection.

  ls_st-i1 = 3.
  ls_st-i2 = 78.
  ls_st-i3 = 54.
  append ls_st to lt_t1.

  clear ls_st.
  ls_st-i1 = 34.
  ls_st-i2 = 23.
  ls_st-i3 = 92.
  append ls_st to lt_t2.

  insert lt_t1 into table lt_t2.

end-of-selection.

thx marty

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
397

HI,

YOU CAN USE THE FOLLOWING SYNTAX.

1.ITAB1[ ] = ITAB2[ ]

2. APPEND LINES OF ITAB1 FROM 5 TO 8 TO ITAB2.

3. INSERT LINES OF ITAB1 FROM 2 TO 5 INTO ITAB2.

2 REPLIES 2
Read only

Former Member
0 Likes
398

HI,

YOU CAN USE THE FOLLOWING SYNTAX.

1.ITAB1[ ] = ITAB2[ ]

2. APPEND LINES OF ITAB1 FROM 5 TO 8 TO ITAB2.

3. INSERT LINES OF ITAB1 FROM 2 TO 5 INTO ITAB2.

Read only

Former Member
0 Likes
397

Hi,

use

lt_t2 = lt_t1.

This is simple.