SAP DELETE LINE IDX ABEXA



Get Example source ABAP code based on a different SAP table
  



ABAP_ITAB - Deleting Lines Using the Index
This example demonstrates how lines can be deleted from internal tables using the index.

ABAP_SOURCE_CODE
DEMO CL_DEMO_INT_TBLS_DELETE_IND_1

ABAP_DESCRIPTION
A sorted table itab is filled with five lines. Then an attempt is made to delete the lines with the indexes 2, 3, and 4 using a chained statement. However, after the deletion of each individual line, the index of each subsequent line is lowered by 1. As a result, the second delete operation deletes the line that had the index 4 first. The third deletion fails because the table now has only 4 lines.
To actually delete the lines 2 to 4, the addition FROM TO of the statement DELETE is used.