ABAP Keyword Documentation → ABAP − Reference → Processing Internal Data → Assignments → Assigning References
Setting Reference Variables
Special rules apply when setting the reference or pointer of a reference variable:
A reference is always set as an up cast or as a down cast. When a reference variable is assigned to another reference variable, two different assignment operators are used plus a constructor operator.
References in data reference variables can point to existing data objects. Here, a statement and a constructor operator are used.
Like all data objects, reference variables are initialized using the statement CLEAR. The content of an initial reference variable is the
null reference, which does not point to an object and can be assigned to every reference variable.
Other versions:
7.31 | 7.40 | 7.54
Notes
- The same rules apply to references set when objects are created as to assignments.
- When a reference variable containing a heap reference is initialized, this affects Garbage Collector.