11-27-2007 1:08 PM
Hi Experts,
My Internal table has the following structure and data's.
Name age Sex
B 20 MALE
A 22 MALE
B 20 MALE
C 28 MALE
I want to delete the duplicate entries (B) fro my internal table.
Any body help me on this issue.
Thanks,
Points Assured.
11-27-2007 1:10 PM
sort the table and use <b>delete adjacent duplicates comparing all fields</b>
regards
abhishek
11-27-2007 1:10 PM
sort the table and use <b>delete adjacent duplicates comparing all fields</b>
regards
abhishek
11-27-2007 1:20 PM
Hi,
I tried with delete adjacent duplicates comparing all fields.
But its not delete the dupplicate entries.
The think is I used this code in Class[se24].
Thanks.
11-27-2007 1:31 PM
Its possible in Classes also. I tried it in a method of a class.
sort INTERNALTABLE.
delete adjacent duplicates from INTERNALTABLE comparing all fields.
Check in debug whether your data is coming sorted properly before the DELETE statement and also whether there are really any duplicate entries comparing all the fields in the table.
11-27-2007 1:39 PM
Jasmine,
the correct statement in this case is:
DELETE ADJACENT DUPLICATES FROM itab.
you don't need COMPARING...
ec
11-27-2007 1:10 PM
Hi,
Do like this
sort itab by name age sex
DELETE ADJACENT DUPLICATES FROM itab COMPARING name age sex.
Regards,
Prashant
11-27-2007 1:10 PM
Hi,
Sort Itab By Name.
Delete adjacent duplicates From itab Comparing Name.
11-27-2007 1:41 PM
Hi
delete adjacent duplicates from itab comparing names.
Or delete adjacent duplicates from itab comparing all fields.
Regs
Manas
11-27-2007 1:42 PM
Hi Experts,
Thanks for the replies.
My Internal table has the following,
Name age Sex
B 20 MALE
A 22 MALE
B 20 MALE
C 28 MALE
I need to outout as,
Name age Sex
B 20 MALE
A 22 MALE
C 28 MALE
So for this ouput I couldn't use Delete adjacent Duplicate.
My WA has,
Name age Sex
B 20 MALE
How can I do that?
Thanks.
11-27-2007 1:45 PM
use
sort itab by name age sex.
delete adjacent duplicates from itab comparing all fields.
it will work...
Regards
vasu
11-27-2007 4:23 PM