I have an internal table with 2 million rows that's been uploaded from a file. I want to delete any lines that are duplicates and extract the row numbers of the duplicates and add them to another table. What's the best/most efficient way to do this with ABAP 7.40? Classic ABAP is also fine.
So here's an example of my original table and I want to find duplicates by comparing columns A and B
A | B | C
-----------
a1 | b1 | c1
a1 | b2 | c1
a2 | b1 | C2
a1 | b1 | c2
a2 | b2 | c2
Rows 1 and 4 are duplicates so I'd want to remove both of them to end up with
A | B | C
-----------
a1 | b2 | c1
a2 | b1 | C2
a2 | b2 | c2
and also have another table that stores duplicates:
Row number | Error
-------------------
1 | Duplicate
4 | Duplicate
I've seen similar requests on this site but they work a bit differently to what I need. Thanks.