ABAP Keyword Documentation → ABAP − Release-Specific Changes → Changes in Releases 4.0 and 4.5
Extended Concept for Field Symbols in Release 4.0:
The extended field symbol concept can be summarized as follows:
- The behavior of typed and untyped field symbols has been standardized.
- New logical expression <fs>
IS ASSIGNED
- New statement
UNASSIGN <fs>
Other versions: 7.31 | 7.40 | 7.54
not
The new logical expression <fs> IS
ASSIGNED allows you to query whether a field has already been assigned to the field symbol <fs>.
The new statement UNASSIGN <fs> sets the field symbol <fs> so that it is not pointing to a field.
The expression IS ASSIGNED,
and the ASSIGN and
UNASSIGN statements allow you to find out and change the state of a field
symbol at any time. This means that you can simplify your ABAP programs, and make them less error-prone.
Further changes
- Dynamic
ASSIGN(ASSIGN (f) TO <fs>.):
If<fs>is an untyped field symbol and the contents offare invalid, ,the field symbol is not set.
ASSIGNwith offset and length forVALUEparameters in FORMS and FUNCTIONS:
A runtime error is triggered if you useASSIGN f+off(len) TO <fs>to address beyond the area of theVALUEparameterf.
- Non-assigned field symbols with
INSERT,SORTandAT:
If the field symbol <fs> has not yet been assigned (usingASSIGN), it is ignored in the following statements:
,,INSERT <fs> INTO fg.
,,SORT BY <fs>.
,,SORT itab BY <fs>.
,,AT NEW <fs>.
,,AT END OF <fs>.