01-11-2007 8:02 AM
hi
how can i get rid of the duplicate records that i have in my internal table? knowing that i already used select distinct ?
01-11-2007 8:04 AM
just sort ur internal table itab via the key field ..as follows -
sort itab by field1
then use -
Delete adjacent duplicates from itab.
01-11-2007 8:04 AM
hi Essa,
Immediately after your select statement use <b>delete adjacent duplicates</b> statemet ..
DELETE ADJACENT DUPLICATES FROM itab.
Additions
1. ... COMPARING f1 f2 ...
2. ... COMPARING ALL FIELDS
Effect
Deletes neighboring, duplicate entries from the internal table itab . If there are n duplicate entries, the first entry is retained and the other n - 1 entries are deleted.
Two lines are considered to be duplicated if their default keys match.
The return code value is set as follows:
SY-SUBRC = 0 At least one duplicate exists, at least one entry deleted.
SY_SUBRC = 4 No duplicates exist, no entry deleted.
Message was edited by:
Santosh Kumar Patha
01-11-2007 8:04 AM
just sort ur internal table itab via the key field ..as follows -
sort itab by field1
then use -
Delete adjacent duplicates from itab.
01-11-2007 8:06 AM
sort itab by field1 field2.
delete adjacent duplicates from itab comparing field1 field2.
01-11-2007 8:07 AM
Sort your internal table with fields and use delete adjacent duplicates ..
SORT i_tab BY field1 field2.
DELETE ADJACENT DUPLICATES FROM i_tab COMPARING field1.
01-11-2007 8:16 AM
01-11-2007 8:17 AM