Documentation View

We are hiring and constantly growing! Have a look through our vacancies to find the right role for you!

ABAPDELETE_ITAB - DELETE ITAB

ABAPDELETE_ITAB - DELETE ITAB

General Data in Customer Master   RFUMSV00 - Advance Return for Tax on Sales/Purchases  
This documentation is copyright by SAP AG.
SAP E-Book

DELETE itab

Short Reference



DELETE ${ itab_line $| itab_lines $| duplicates $}.

Effect

This statement either deletes a line itab_line or multiple lines itab_lines, which can be specified using a table key or a table index, or it deletes adjacent duplicate lines duplicates.

System Fields

sy-subrc Meaning
0 At least one line was deleted.
4 No lines were deleted, since no appropriate line 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 lines, or no duplicate adjacent lines were found.

The system field sy-tabix is not set.

Notes

  • Deleting lines of internal tables using DELETE does not usually release any memory in the internal table. Statements such as CLEAR or FREE must be used to release this memory.
  • An internal table in which all lines have been deleted with DELETE is usually not an initial internal table.
  • When deleting lines in an internal table, costs are incurred for updating all existing table keys and table indexes. The primary key and all unique secondary keys are updated directly, whereas non-unique secondary keys are only updated if the lines to be deleted are contained within an updated part of a relevant index (lazy update). When deleting a line from a standard table and the line is found using a secondary key, the primary table index in particular must be updated, which usually requires a linear search.

  • There is no implicit selection of a suitable key or index. The used table key or table index is always specified uniquely. The syntax check issues a warning if there is a suitable secondary table key but this table key is not used. This warning should be removed through using the key. However, in exceptional cases, it can be bypassed using a pragma.

Example

Deletion of all initial lines of an internal table.

Exceptions

Catchable Exceptions

CX_SY_ITAB_DYN_LOOP

  • Cause: Error in a dynamic WHERE condition
    Runtime Error: DYN_WHERE_PARSE_ERROR






SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up   CPI1466 during Backup  
This documentation is copyright by SAP AG.

Length: 4748 Date: 20221203 Time: 162122     sap01-206 ( 62 ms )