SAP NetWeaver AS ABAP Release 740, ©Copyright 2014 SAP AG. All rights reserved.
ABAP Keyword Documentation →
ABAP − Short Reference →
READ TABLE itab - Short Reference
Reference
Syntax
READ TABLE itab
{ {{FROM wa [USING KEY key_name|(name)]}
|{WITH TABLE KEY [key_name|(name) COMPONENTS]
{comp_name1|(name1)} = dobj1
{comp_name2|(name2)} = dobj2
...}
| {WITH KEY comp1 = dobj1 comp2 = dobj2 ... [BINARY SEARCH]}
| {WITH KEY key_name|(name)
COMPONENTS comp1 = dobj1 comp2 = dobj2 ... }
| {INDEX idx [USING KEY key_name|(name)]} }
| {WITH KEY dobj [BINARY SEARCH]}
| {WITH KEY = dobj [BINARY SEARCH]} }
{ {INTO wa
[COMPARING { {comp1 comp2 ...}|{ALL FIELDS}|{NO FIELDS} }]
[TRANSPORTING { {comp1 comp2 ...}|{ALL FIELDS} }]}
| { ASSIGNING <fs> [CASTING] }
| { REFERENCE INTO dref }
| {TRANSPORTING NO FIELDS} }.
Effect
Reads a single row from an internal table itab.
Additions
-
FROM wa
Specifies the row to be read by matching it with the key values of a work area wa.
-
WITH TABLE KEY
{comp_name1|(name1)} = dobj1 {comp_name2|(name2)} = dobj2 ...
Specifies the row to be read by specifying components of the primary table key statically or dynamically.
-
WITH KEY comp1 = dobj1 comp2 = dobj2 ... [BINARY SEARCH]
Specifies the row to be read by specifying components comp1, comp2,
.... Appropriately sorted standard tables are searched using a binary search BINARY SEARCH.
-
WITH KEY [key_name|(name) COMPONENTS] comp1 = dobj1 comp2 = dobj2 ...
Specifies the row to be read by specifying components comp1, comp2, ... for a table key.
-
INDEX idx
Specifies the row to be read by specifying the row number idx of a table index.
-
KEY key_name|(name)
Specifies (statically or dynamically) a (secondary) table key used to find the row to be read.
-
WITH KEY dobj [BINARY SEARCH]
Obsolete: Reads the first row for which the left-aligned content matches the content of the data object dobj. The table row is
cast to the type of
dobj. Tables sorted accordingly are searched using the addition BINARY SEARCH.
-
WITH KEY = dobj [BINARY SEARCH]
Obsolete: Reads the first row whose entire content matches the content of
the data object dobj. Appropriately sorted tables are sorted using a BINARY SEARCH.
-
INTO wa
Assigns the read row to a work area wa.
-
COMPARING { {comp1 comp2 ...}|{ALL FIELDS}|{NO FIELDS} }
Compares the components comp1, comp2, ... , all
components, or no components of a found row with the corresponding components of the work area and sets sy-subrc accordingly.
-
TRANSPORTING { {comp1 comp2 ...}|{ALL FIELDS} }
Assigns the specified components comp1, comp2, ... or all components of the found row to the work area wa.
-
ASSIGNING <fs> [CASTING]
Assigns the row read to a field symbol <fs>; casting is an option.
-
REFERENCE INTO dref
Assigns the reference to the read row to a reference variable dref.
-
TRANSPORTING NO FIELDS
The read row is not assigned.