... {TABLE itab table_key}
| {itab [INDEX idx]}.
1. ... TABLE itab table_key
2. ... itab [INDEX idx]
These alternatives specify which single line of the internal table itab is to be deleted.
... TABLE itab table_key
If you use the variant with the TABLE addition , you specify the line by using the table key table_key.
... itab [INDEX idx]
This variant can only be used for standard
tables and sorted tables. The line to be deleted, is specified by its table index idx. idx expects a data object of the type
i. An exception that cannot be handled occurs, if idx contains a value smaller than 0.
Deletion of the table line that has the same value as carrid in the key field p_carrid by specifying an index.
PARAMETERS p_carrid TYPE scarr-carrid.
DATA scarr_tab TYPE SORTED TABLE OF scarr
WITH UNIQUE KEY carrid.
SELECT *
FROM scarr
INTO TABLE scarr_tab.
READ TABLE scarr_tab WITH TABLE KEY carrid = p_carrid
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
DELETE scarr_tab INDEX sy-tabix.
ENDIF.