Data reference variables are either completely typed (as of release 6.10) or typed with the generic type data.
An up cast in data references is possible in the following cases:
A down cast in data references is only possible if the static type of the source variable is generic and that of the target variable is completely typed. The syntax check precludes that the static types of the source variable and the target variable are both completely typed, but not identical.
Assigning from dref1 to dref2 is an up cast. Assigning from dref2 to dref1 is a down cast, which in this example below leads to an exception. If the statement CREATE DATA had the addition TYPE i, the down cast would also have been successful.
DATA: dref1 TYPE REF TO i,
dref2 TYPE REF TO data.
CREATE DATA dref1.
dref2 = dref1.
CREATE DATA dref2 TYPE string.
TRY.
dref1 ?= dref2.
CATCH cx_sy_move_cast_error.
...
ENDTRY.