2007 Sep 05 11:12 AM
Please go to the following website:-
http://help.sap.com/saphelp_nw04/helpdata/en/06/aafd54fc4011d195280000e8353423/content.htm
and please scroll down to find:-
<b>Deleting Adjacent Duplicate Entries</b>
To delete adjacent duplicate entries use the following statement:
DELETE ADJACENT DUPLICATE ENTRIES FROM <itab>
[COMPARING <f1> <f 2> ...
|ALL FIELDS].
Then please go to the last example where the code is written as :-
DELETE ADJACENT DUPLICATES FROM ITAB COMPARING ALL FIELDS.
IS THIS CORRECT ?
Regards
abaper.learner
2007 Sep 05 11:16 AM
Hi
The Correct version is:
DELETE ADJACENT DUPLICATES FROM ITAB COMPARING ALL FIELDS.
OR....
DELETE ADJACENT DUPLICATES FROM ITAB COMPARING COL1.
the Otherone may be Mistake in SAP DOCu...
<b>reward if Helpful</b>
2007 Sep 05 11:15 AM
Hi,
YES, there is no problem with the statement
DELETE ADJACENT DUPLICATES FROM ITAB COMPARING ALL FIELDS
<b>ENTRIES is wrongly mentioned in the syntax, its not part of the DELETE syntax.</b>
Regards,
Sesh
2007 Sep 05 11:16 AM
Hi
The Correct version is:
DELETE ADJACENT DUPLICATES FROM ITAB COMPARING ALL FIELDS.
OR....
DELETE ADJACENT DUPLICATES FROM ITAB COMPARING COL1.
the Otherone may be Mistake in SAP DOCu...
<b>reward if Helpful</b>
2007 Sep 05 11:16 AM
Hi,
The statement DELETE ADJACENT DUPLICATES FROM ITAB COMPARING ALL FIELDS.
it is correct.
Regards,
Nagaraj
2007 Sep 05 11:20 AM
Hi learner,
<b>Deleting a sequence of lines</b>
DO 101 TIMES.
DELETE TAB_DEST INDEX 450.
ENDDO.
DELETE TAB_DEST FROM 450 TO 550.
<b>Deleting a set of lines</b>
LOOP AT TAB_DEST
WHERE K = KVAL.
DELETE TAB_DEST.
ENDLOOP
DELETE TAB_DEST WHERE K = KVAL.
<b>DELETE ADJACENT DUPLICATES</b>
As with the ORDER BY clause it could be better to avoid using SELECT DISTINCT, if some of the fields are not part of an index. Instead use ABAP SORT + DELETE ADJACENT DUPLICATES on an internal table, to delete duplicate rows.
LOOP AT TAB1.
READ TABLE TAB2 INDEX SY-TABIX.
IF TAB1 <> TAB2.
TAB_DIFFERENT = 'X'. EXIT.
ENDIF.
ENDLOOP.
ENDIF.
IF TAB_DIFFERENT = SPACE. " ...
ENDIF.
IF TAB1[] = TAB2[]. " ...
ENDIF.
Regards,
Kumar.