Skip to content

ABAP Keyword Documentation →  ABAP − Reference →  Processing Internal Data →  Internal Tables →  Processing Statements for Internal Tables →  DELETE itab 

DELETE itab - itab_line

Quick Reference

Other versions: 7.31 | 7.40 | 7.54

Syntax


... { table_key
 | index }. 

Effect

In this variant, the statement DELETE deletes a row specified by a table key in table_key or a row specified by a row number index.


Example

Deletes individual rows in an internal table. The first DELETE statement uses the primary table key to find the row. The second DELETE statement deletes the row by specifying a row number (here also determined by accessing a key).

DATA itab TYPE SORTED TABLE OF string 
          WITH UNIQUE KEY primary_key COMPONENTS table_line. 

itab = VALUE #( ( `X` ) ( `Y` ) ( `Z` ) ). 

DELETE TABLE itab WITH TABLE KEY 
  primary_key COMPONENTS table_line = `X`. 

DELETE itab INDEX 
  line_index( itab[ KEY primary_key table_line = `Z` ] ). 

Continue

DELETE itab - table_key

DELETE itab - index