2008 May 30 4:24 AM
Dear gurus,
I have two same internal table with around 70,000 records in each table now i want to merge both internal table so there will be no repetition of same record in table. Is this statement will work? Internal table has 6 field. 4 field are numc or char and last 2 fields are packed decimal. if there is any other good idea please let me know. If question is not clear let me know.
COLLECT LINES IT_CYD2 TO IT_CYD4.
Thanks in advance.
Dave.
Dear gurus,
I have two same internal table with around 70,000 records in each table now i want to merge both internal table so there will be no repetition of same record in table. Is this statement will work? Internal table has 6 field. 4 field are numc or char and last 2 fields are packed decimal. if there is any other good idea please let me know. If question is not clear let me know.
COLLECT LINES IT_CYD2 TO IT_CYD4.
Thanks in advance.
Dave.
2008 May 30 4:36 AM
Hello Dave
If you intention is to summarize the two itabs then the COLLECT statement is correct.
However, according to the ABAP keyword documentation you can collect only one record at a time.
If you do not want to summarize then you may have a look at my Wiki posting:
[Comparing Two Internal Tables - A Generic Approach|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/comparing%2btwo%2binternal%2btables%2b-%2ba%2bgeneric%2bapproach]
Regards
Uwe
2008 May 30 4:38 AM
Hi,
You can use following code if you do not want to have duplicate entries in itab2 from itab1.
loop at itab1
read table itab2 from itab1.
if sy-subrc ne 0.
append itab2 from itab1.
endif.
endloop.
collect will not work.
2008 May 30 4:38 AM
use
append lines of it2[] to it1[].
Edited by: DEBOPRIYO MALLICK on May 30, 2008 5:39 AM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |