06-25-2008 9:28 AM
hi all,
i have sorted an internal table based on 3 fields.
my requirement is i have to delete the unique entries in that internal table and keep the duplicate entries in the table.
06-25-2008 9:31 AM
Hi,
Do one thing first copy the entire table into one temp table then sort that and delete the duplicate entries from temporary table using the DELETE ADJACENT DUPLICATES stmt, now you have unique entries in temparory table. Now delete your original internal table entries using the temparary table, now the unique entries are there in your original table. This is the simpliest way to do...
Rgds,
Bujji
06-25-2008 9:32 AM
hi,
say ur internal table is itab.
create temp table of the same structure itab_temp.
itab_temp[] = itab[].
sort itab_temp by ...
delete adjacent duplicates from itab_temp comparing..
loop at itab.
read table itab_temp with key ..
if sy-subrc = 0.
delete...
endif.
endloop.
itab will have duplicate entries now.
regards,
madhu