SAP DELETE DUP LINES ABEXA



Get Example source ABAP code based on a different SAP table
  



ABAP_ITAB - Deleting Duplicate Lines
This example demonstrates how adjacent duplicate lines in internal tables can be deleted.

ABAP_SOURCE_CODE
DEMO CL_DEMO_INT_TBLS_DELETE_ADJCNT

ABAP_DESCRIPTION
The method main creates and fills a standard table. The first DELETE statement deletes the second line since it has the same content as the first line. The second DELETE statement deletes the second line from the remaining table since the content of the field col1 is the same as in the first line. The third DELETE statement deletes the third and fourth lines of the remaining table since the content of the key field col2 is the same as in the second line. Although the content of the key fields for the first and fifth lines is the same, the fifth line is not deleted because it is not adjacent to the first line.