READ TABLE itab
Reference
Syntax
READ TABLE itab
{ {{FROM wa}
|{WITH TABLE KEY {comp_name1|(name1)} = dobj1
{comp_name2|(name2)} = dobj2
...}
| {WITH KEY comp1 = dobj1 comp2 = dobj2 ... [BINARY SEARCH]}
| {INDEX idx} }
| {WITH KEY dobj}
| {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 line from an internal table itab.
Additions
-
FROM wa
Specifies
the line 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 line to be read by static or dynamic specification of components of the table key.
-
WITH KEY comp1 = dobj1 comp2 = dobj2 ... [BINARY SEARCH]
Specifies the line to be read by specification of any components comp1, comp2, ..., and appropriately
sorted tables are searched using a binary search BINARY SEARCH.
-
INDEX idx
Specifies the line to be read by specification of the table index idx.
-
WITH KEY dobj
Obsolete: reads the first line for which the left-aligned content matches the content of the data object dobj, and the table line is
castt to the type of dobj.
-
WITH KEY = dobj [BINARY SEARCH]
Obsolete: reads the first line whose total content matches the content of the data
object dobj, whereby apppropriately sorted tables are sorted using a BINARY SEARCH binary search.
-
INTO wa
Assigns the read line 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 line 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 line to the work area wa.
-
ASSIGNING <fs> [CASTING]>>
Assigns the line read to a field symbol <fs>; casting be carried out.
-
REFERENCE INTO dref
Assigns the reference to the read line to a reference variable dref.
-
TRANSPORTING NO FIELDS
The read line is not assigned.