‎2006 Nov 15 6:48 AM
how to transfer the data from two internal tables into another internal table?
‎2006 Nov 15 6:55 AM
Hi,
Let us have there are three tables ITAB1, ITAB2 AND ITAB3.
The contents of ITAB1 & ITAB2 to be transfered to ITAB3.
APPEND LINES OF ITAB1 TO ITAB3.
APPEND LINES OF ITAB2 TO ITAB3.
Regards,
Irfan Hussain
Note: If useful , Please award the sutiable points,
‎2006 Nov 15 6:51 AM
HI,
LOOP AT itab1.
READ TABLE itab2 WITH KEY field = itab1-field.
IF sy-subrc = 0.
itab3-field = itab1-field.
itab3-field1 = itab2-field1.
itab3-field2 = itab2-field2.
APPEN itab3.
ENDIF.
ENDLOOP.
‎2006 Nov 15 6:51 AM
Loop at itab1 into wa1.
read table itab2 into wa2 with key f1 = wa1-f1
f2 = wa1-fa2.
if sy-subrc eq 0.
move-corresponding wa1 to wa3.
move-corresponding wa2 to wa3.
append wa3 to itab3.
endif.
endloop.null
‎2006 Nov 15 6:52 AM
Hi,
1. If the two internal tables have the same structure as the one to which u want to pass then u can use the command.
APPEND LINES OF ITAB1 TO ITAB3.
APPEND LINES OF ITAB2 TO ITAB3.
2. If the two internal tables have same key fields then u can do a nested loop like this.
Loop at itab1.
loop at itab2 where <Mention the matching key fields>
populate the work area of ITAB3.
APPEND WA TO ITAB3.
ENDLOOP.
ENDLOOP.
‎2006 Nov 15 6:52 AM
Hi,
if the three tables having the same structures then you can use
itab1 = itab2
and then append lines of itab3 to itab2.
if three are having different structures then
loop at itab1.
move the fields to work area of itab3.
append work area to itab3.
endloop.
and do then same itab2,
‎2006 Nov 15 6:55 AM
Hi Sunil,
Loop at one internal Table and Move-corresponding Fields of the First internal Table to the Final Internal table. With in the loop REad the second internal Table with key XXXXXXX = final-XXXXXXX. and move that particular fields from second internal table into final internal table.
Bye
Murthy
‎2006 Nov 15 6:55 AM
Hi,
Let us have there are three tables ITAB1, ITAB2 AND ITAB3.
The contents of ITAB1 & ITAB2 to be transfered to ITAB3.
APPEND LINES OF ITAB1 TO ITAB3.
APPEND LINES OF ITAB2 TO ITAB3.
Regards,
Irfan Hussain
Note: If useful , Please award the sutiable points,