2008 May 15 2:17 PM
Hi Experts,
suppose i've declared 2 internal tables and structure is same for both of them i.e.
itab1
f1
f2
f3
f4
itab2
f1
f2
f3
f4
now i want to transfer the data from these internal tables into another internal table (itab3) which is also of same type.
itab3.
f1
f2
f3
f4
suppose itab1 is having 10 records and itab2 is having 20 records. now i want all the records i.e. 30 records into itab3. pls give me the logic.
regards
Faisal
2008 May 16 1:36 AM
Adbul, use this:
APPEND LINES OF itab1 TO itab3.
APPEND LINES OF itab2 TO itab3.
http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb36c8358411d1829f0000e829fbfe/content.htm
Regards
Hi Experts,
suppose i've declared 2 internal tables and structure is same for both of them i.e.
itab1
f1
f2
f3
f4
itab2
f1
f2
f3
f4
now i want to transfer the data from these internal tables into another internal table (itab3) which is also of same type.
itab3.
f1
f2
f3
f4
suppose itab1 is having 10 records and itab2 is having 20 records. now i want all the records i.e. 30 records into itab3. pls give me the logic.
regards
Faisal
2008 May 15 3:22 PM
Hi Abdul,
You said you are having 10 records in itab1,20 records in itab2.You want to move these records into itab3.
try this.
data : begin of itab occurs 0,
f1 type c,
f2 type c,
end of itab.
data : jtab like itab occurs 0 with header line,
ktab like itab occurs 0 with header line.
itab-f1 = '5'. itab-f2 = '6'. append itab.
do 3 times.
move itab to jtab.
append jtab.
enddo.
move itab( ) to ktab( ).
append ktab.
loop at jtab.
append jtab to ktab.
endloop.
loop at ktab.
write : / ktab-f1 , ktab-f2.
endloop.
Award points if useful...
Thanks,
Ravee...
Edited by: ravee on May 15, 2008 7:52 PM
2008 May 15 9:36 PM
Hello Faisal,
If it helps, here's another aproach:
INSERT LINES OF itab1 INTO TABLE itab3.
INSERT LINES OF itab2 INTO TABLE itab3.
The itab3 table will get all itab1 and itab2 records.
Regards,
Bruno
2008 May 16 1:36 AM
Adbul, use this:
APPEND LINES OF itab1 TO itab3.
APPEND LINES OF itab2 TO itab3.
http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb36c8358411d1829f0000e829fbfe/content.htm
Regards
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |