

The TO addition must occur befor the WHERE condition.Įxample to delete all of the lines between 5 and 36 in a table of names where the entry begins withĭELETE NAMETAB FROM 5 TO 36 WHERE NAME CA 'ABC'.ĭeletes adjacent duplicate entries from the internal table itab. If you omit the addition TO idx2, the system searches Restricts the area searched to the set of lines up to index idx2. The FROM addition must occur before the WHERE condition. If you omit the addition FROM idx1, the system searches Restricts the area searched to the set of lines beginning at index idx1. TO idx2 with index tables (standard or sorted tables). Is itself a reference variable, you can use the attributes of the object to which the reference is pointingĪs comparison values in the WHERE condition (see Attributes of objects as the key of an internal table). If the line type of the internal table contains object reference variables, or the entire line type With any number of IMPORTING parameters and a single RETURNING parameter. Functional methods are methods in ABAP Objects Of the corresponding internal table itab can be replacedīy a functional method call. (See also Optimized Key Operations in Internal Tables).Įach operand in the WHERE condition that is not a component The loop is only processed from the starting point to the point where these sub-conditionsĪre still met. Optimization is similar to the optimization in the READ Using a binary search with the sub-conditions that cover the table key (partially or completely). The starting point for the loop is specified kn = vnĬover at least the first part of the table key. That each sub-condition is linked with AND that no parenthesesĪre used that at least one sub-condition is in the form k = v Īnd that the conditions in the form k1 = v1. Sequential processing can be optimized so that only the entries that actually satisfy the WHERE condition are processed. If you are working with a SORTED TABLE, the partial
DELETE ITAB FULL
Or HASHED table, a full table scan is always required. When you use the WHERE condition with a STANDARD The only restriction is that theįirst field in each comparison must be a component of the line structure of the internal table itab. The condition logexpĬan be almost any logical expression. The starting line idx1 must be greater than 0.ĭeletes all of the entries from the internal table itab TO parameter, the system deletes from line idx1 Lines from the start of the table to idx2. If you omit the FROM parameter, the system deletes the You must specify at least one of the parameters FROM idx1 or TO idx2. With index tables (standard or sorted tables). Variant is only allowed with index tables (standard or sorted tables).ĭeletes the range of lines from index idx1 to idx2įrom the internal table itab. Header line, you can leave out the FROM wa addition the system then takes the key values from the header line. This method allows you toĭelete from a table without the table key having to be known in advance. The values for the table key are taken from the corresponding components After the deletion, the space required for each table entry increases by 8 bytes.īehaves similarly to variant 2. Has to set this up, and therefore has linear costs. Tables with deleted entries require a preceding/following administration. The system uses the hash algorithm and the table key to locate the entry. Generic deletion for tables of this type has a logarithmic cost. The system searches for the entry using the table key. This means that generic deletion has linear costs. The system starts searching for the entry at the start of the table. The costs for deleting one entry depend on the table type with which the table is defined: You can specify it dynamically as the contents of the field fi If a component is not known until runtime, The type of the component before the statement is executed, using MOVE logic. Of a value and the type of the associated key are not compatible, the system converts the value into The specified key, only the first one is deleted. The variant is a single command that deletes the table line with the key values k1 = v1. kn = vn.ĭeletes generically from an internal table.

Once you have deleted the current entry of an internal table in a LOOP, the effect of subsequent changes to the currentĮntry without specifying the INDEX cannot be guaranteed, and the behavior may change in future releases.ĭELETE TABLE itab WITH TABLE KEY k1 = v1. You can only use this variant with index tables (standard or sorted tables). ENDLOOP block, the deletion affects subsequent loop passes.ĭeletes the current entry from an internal table in a LOOP. See Short forms of line operations not allowed.ĭeletes one or more lines from an internal table.
