ABAP - Keyword Documentation →  ABAP - Reference →  Processing Internal Data →  Internal Tables →  Processing Statements for Internal Tables → 

DELETE itab

Quick Reference

Syntax

DELETE { itab_line | itab_lines | duplicates }.

Effect

This statement either deletes a row (itab_line) or several rows (itab_lines), which can be specified with a table key or a table index, or it deletes adjacent duplicate rows duplicates.

System Fields

sy-subrc Meaning
0 At least one row was deleted.
4 No rows were deleted, since no appropriate row was found when deleting using a table key or when specifying a logical expression, the index specified when deleting using a table index was greater than the current number of rows, or no duplicate adjacent rows were found.

The system field sy-tabix is not set.

Notes

Example

Deletes all initial rows of an internal table.

DATA itab TYPE HASHED TABLE OF scarr WITH UNIQUE KEY carrid.

...

DELETE itab WHERE table_line IS INITIAL.

Exceptions

Handleable Exceptions

CX_SY_ITAB_DYN_LOOP



Continue
DELETE itab - itab_line
DELETE itab - itab_lines
DELETE itab - duplicates