SAP NEWS-40-ASSIGN



Get Example source ABAP code based on a different SAP table
  



Extended Concept for Field Symbols in ABAP 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 predicate expression <(><)> IS ASSIGNED
New statement UNASSIGN <(><)>
Like typed field symbols, untyped field symbols are now, by default, not assigned. This means that writes in either case (like <(><)> = f.) produce a runtime error.
At the same time, reads cannot be performed on typed unassigned field symbols.
Reads on untyped unassigned field symbols are only allowed for the sake of compatibility (default value SPACE).
Unassigned field symbols, however, should no longer be accessed.
The new predicate expression <(><)> IS ASSIGNED can be used to query whether a field has already been assigned to the field symbol <(><)>.
The new statement UNASSIGN <(><)> sets the field symbol <(><)> so that it is not pointing to a field.
The expression IS ASSIGNED, and the ASSIGN and UNASSIGN statements enable the state of a field symbol to be established and modified at any time. This makes ABAP programs simpler and less error-prone.
Further changes
Dynamic ASSIGN (ASSIGN (f) TO <(><)>.): If <(><)> is an untyped field symbol and the content of f are invalid, the field symbol is not set.
ASSIGN with offset and length for VALUE parameters in FORMS and FUNCTIONS: A runtime error is produced if ASSIGN f+off(len) TO <(><)> is used to address areas beyond the range of the VALUE parameter f.
Non-assigned field symbols in INSERT, SORT, and AT:
If the field symbol <(><)> was not yet assigned (using ASSIGN), it is ignored in the following statements: INSERT <(><)> INTO fg. SORT BY <(><)>. SORT itab BY <(><)>. AT NEW <(><)>. AT END OF <(><)>.