ABAP - Keyword Documentation →  ABAP - Programming Language →  Operands →  Data Objects in Operand Positions →  Notations for Single Operands → 

Dereferencing Operator

The content of a data object pointed to by a data reference is accessed using the dereferencing operator:

dref->*

The dereferencing operator ->* can be specified after a data reference variable dref.

If the data reference variable contains the null reference, the uncatchable exception DATREF_NOT_ASSIGNED is raised when the dereferencing operator is used. The exception to this is the dereferencing in the statement ASSIGN.

Hint

The dereferencing operator uses the object component selector.

Example

Uses the dereferencing operator in a general operand position and in the statement ASSIGN. Only in ASSIGN can dref be initial without raising an uncatchable exception.

DATA dref TYPE REF TO data.
dref = NEW i( 111 ).

cl_demo_output=>write( |dref->* { dref->* }| ).

CLEAR dref.
ASSIGN dref->* TO FIELD-SYMBOL(<fs>).
cl_demo_output=>write( |sy-subrc { sy-subrc }| ).

cl_demo_output=>display( ).