1. ... INTO
wa
2a. ...
ASSIGNING <fs>
2b.
... REFERENCE INTO dref
3a.
... COMPARING f1 f2 ...
3b.
... COMPARING ALL FIELDS
4a.
... TRANSPORTING f1 f2 ...
4b. ... TRANSPORTING NO FIELDS
... INTO wa
If the system finds an appropriate entry, it uses the specified work area
wa as the output area. If the table has a header line, you can omit the addition, since the header line is then used as the output area.
... ASSIGNING <fs>
If a corresponding entry is found, the field symbol <fs> is assigned to the entry. This saves
the cost of copying the contents in comparison to the first addition. However, this addition does involve
table administration costs, and it is therefore only worthwile for lines longer than around 300 bytes.
(Example: When you delete a line of a table to which a field symbol is pointing, an UNASSIGN is required for the field symbol.)
The field symbol <fs> accesses the internal table
directly. The key components of a table with the type SORTED
or HASHED must not be changed in this way, since this
could invalidate the sort order of the table. For this reason, all modifying operations on the key fiedls
of these kinds of tables (such as MODIFY,
MOVE, CLEAR),
and all potential modifying operations (such as when the table has been passed as a CHANGING parameter) result in a runtime error.
... REFERENCE INTO dref
If a suitable entry is found, the system returns the reference to that line in
dref. Otherwise, the data reference dref remains
unchanged. Since the reference can be used to directly manipulate the contents of the internal table, the same restrictions apply as to the ASSIGNING addition.
... COMPARING f1 f2 ...
If the system find an entry, the system compares the subfields f1,
f2, ... with the corresponding fields of the work area before they are transported into it.
The return value SY-SUBRC indicates whether any values were found that correspond to the search, and, if so, the result of the comparison:
If you want to instruct the system not to compare any fields (which is the default in any case), you can use the COMPARING NO FIELDS addition.
... COMPARING ALL FIELDS
This is the same as addition 3a, except that the system compares all fields.
... TRANSPORTING f1 f2 ...
If the system finds an entry, it does not transfer all of the subfields (default) into the work area,
but only the specified fields f1 f2 ...; the other subfields
remain unchanged.
If you want to specify that all fields should be transported (the default), you can use the TRANSPORTING ALL FIELDS addition.
... TRANSPORTING NO FIELDS
The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas. See Redundant work areas not allowed.
The output area of the internal table is not changed at all. The only purpose of the READ TABLE statement
is to set the values of SY-SUBRC and SY-TABIX.
Additional help
Processing Internal Tables