DELETE INDEX sy-tabix inside a LOOP over the same table

 home  single file   example  edit

delete_index_in_loop

Description

Reports DELETE itab INDEX sy-tabix inside a LOOP AT the same table

Extended Information

sy-tabix is the index of the loop's current row only until another statement writes it.
READ TABLE, APPEND, INSERT, COLLECT, a nested LOOP and any method called in the loop body
all set sy-tabix. After that the DELETE removes a different row, and if sy-tabix is 0 it
raises the runtime error TABLE_INVALID_INDEX.

Use DELETE itab WHERE ..., or collect the rows to keep in a second table.

Not reported: DELETE itab INDEX sy-tabix directly after READ TABLE itab, where sy-tabix
is the index the READ just set.

Default Configuration

Hover to see descriptions, Ctrl+Space for suggestions

Examples