2007 Aug 13 7:06 AM
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
2007 Aug 13 7:07 AM
2007 Aug 13 7:07 AM
2007 Aug 13 7:29 AM
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
2007 Aug 13 7:47 AM
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
2007 Aug 13 7:50 AM
Thanks Lijo & Kiran for helping me. Shiba has already given the same solution.
Thanks for your time. I have solved my issue.
2007 Aug 13 8:40 AM
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.