ABAP - Keyword Documentation →  ABAP - ABAP Release News →  News for ABAP Release 7.5x →  News for ABAP Release 7.57 → 
Mail Feedback

Assignments in ABAP Release 7.57


1. New Dynamic Component Specification in ASSIGN

2. New Addition ELSE UNASSIGN



Modification 1  

New Dynamic Component Specification in ASSIGN

Components of structures can be assigned to field symbols with the new syntax struc-(comp) that largely replaces the variant ASSIGN COMPONENT OF.



Modification 2  

New Addition ELSE UNASSIGN

The new addition ELSE UNASSIGN can be specified for the following variants of the statement ASSIGN:

It can be also specified with the addition ASSIGNING of the following internal table statements:

All these statements have set sy-subrc. If an assignment is not successful, sy-subrc is set to the value 4 or sometimes 8. If the addition ELSE UNASSIGN is specified, the state of the field symbol is set to unassigned in that case. The field symbol is assigned only if the assignment is successful. If ELSE UNASSIGN is not specified, the field symbol keeps its previous state, which was the only behavior up to now. Using ELSE UNASSIGN introduces the same behavior as for the static variant to the above variants. In another way around, one can say that the static variant uses ELSE UNASSIGN implicitly.