Obsolete Variants of the READ Command

Variants:

1. READ TABLE itab [ additions ].

2. READ TABLE itab WITH KEY key [ additions ].

3. READ TABLE itab WITH KEY = v [BINARY SEARCH] [ additions].

Note

Both variants are obsolete, and can be replaced with variants of the READ<>/ statement that specify the key explicitly in the form "k1 = v1 ... kn = vn" (see also Obsolete statements).

The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas. See Obsolete READ variants not allowed.

Variant 1

READ TABLE itab [additions].

Effect

In an internal table with a header line, you can read a line of the table without specifying the key or index. In this case, the system uses all of the fields in the table header that are not numeric fields (types I, F, P) or tables themselves (see default key of internal tables) as an implicit key as long as their contents are not equal to SPACE. The system looks for the first entry in which all key fields correspond to the header entry, and copies it into the output area.

Variant 2

READ TABLE itab WITH KEY key [additions].

Effect

This variant accesses the first entry (from the left) beginning with key. The type of the specified key key is the basis for the comparison.

Note

The key key may not be a table or a structure containing a table.

Variant 3

READ TABLE itab WITH KEY = v [BINARY SEARCH] [additions].


Effect

Accesses the first entry that corresponds to "v". The entire line of the internal table is interpreted as the component. Instead of this, use an explicit key definition with the pseudocomponent TABLE LINE.

Exceptions

Catchable Exceptions