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

How to append a table rows to another table without looping

Former Member
0 Likes
2,135

Hi,

Tab1 has 10 rows and tabl2 has 20 rows.

Is there any process to append all the rows of tab1 to tab2 (tab2 will now contain 30 rows ) with looping. The structure of tab1 and tab2 are same.

Thanks & Regards,

Abhishek

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,545

try this

append lines of itab1 to itab2.

regards

shiba dutta

5 REPLIES 5
Read only

Former Member
0 Likes
1,546

try this

append lines of itab1 to itab2.

regards

shiba dutta

Read only

Former Member
0 Likes
1,545

Hi Sarkar.

loop at tab1.

tab2 = tab1.

append tab2.

clear tab1,tab2.

endloop.

or append klines of tab1 to tab2.

reward points to all helpful answers

kiran.M

Read only

Former Member
0 Likes
1,545

Hello,

append lines of itab1 to itab2.

This will append the records

Please refer the code....

REPORT ZITAB .

  • type Declaration

types : begin of ty_tab,

name(5) type c,

num type i,

end of ty_tab.

  • Type Declaration

data : itab1 type table of ty_tab.

data : itab2 type table of ty_tab.

data : wa_itab1 like line of itab1.

data : wa_itab2 like line of itab2.

*Passing Values to ITABS

do 2 times.

wa_itab1-name = 'ABC'.

wa_itab1-num = 1.

append wa_itab1 to itab1.

enddo.

do 3 times.

wa_itab2-name = 'FGH'.

wa_itab2-num = 2.

append wa_itab2 to itab2.

enddo.

*APPENDING

append lines of itab1 to itab2.

*Displaying

loop at itab2 into wa_itab2.

write : / wa_itab2-name,

write : wa_itab2-num .

endloop.

Regards,

LIJO JOHN

Read only

0 Likes
1,545

Thanks Lijo & Kiran for helping me. Shiba has already given the same solution.

Thanks for your time. I have solved my issue.

Read only

Former Member
0 Likes
1,545

Hi,

You could use: append lines of tab1 to tab2.

Now tab2 will also be consisted of lines from tab1.

Hope this solved your problem.

Regards,

Fandi.