ABAP Keyword Documentation → ABAP - Release-Specific Changes → Changes in Releases 6.xx → Changes in Release 6.10
Data References in Release 6.10
1. Typing using TYPE DATA
2. Specifying types for CREATE
3. Uppercase and lowercase in dynamically specified types
4. Defining typed data references
5. Casting data references
6. Additional type information for ASSIGN dref->*
7. Any typing for CREATE DATA
8. Dereferencing in any operand positions
Other versions: 7.31 | 7.40 | 7.54
Modification 1
Typing Using TYPE DATA
TYPE DATA was previously handled like TYPE REF TO DATA and were therefore fully typed. Now TYPE DATA can only be used for formal parameters and field symbols; otherwise a syntax error occurs. A non-generic type can now be specified after REF TO.
Modification 2
Specifying Types for CREATE
A type no longer needs to be specified for the statement CREATE DATA ... if the reference is fully typed. In this case, the new data object is given the type of the reference.
Modification 3
Uppercase and Lowercase in Dynamically Specified Types
In the statement CREATE DATA ...
,
previously only uppercase letters could be used for the field content of dynamically specified types.
In Release 6.10, lowercase letters can also be used. Initially the system searches using the specified
field content; if this search fails, the system searches again using uppercase letters. If this search also fails, a runtime error occurs.
Modification 4
Defining Typed Data References
In the case of the statements TYPES
and DATA
, a fixed type can now be specified for the addition REF TO.
Modification 5
Casting Data References
The introduction of typed data references enables down casts for in assignments between data reference variables. It must be expressed using a special assignment operator, ?=
.
Example
DATA:
d1 TYPE REF TO data, "Generic
d2 TYPE REF TO i. "Typed
d1 = d2.
d2 ?= d1.
Modification 6
Additional Type Information for ASSIGN dref->*
If a data reference has fixed typing, it passes on its additional attributes if it is assigned to an untyped data reference.
dataobj TYPE dtel_1,
dataref_1 TYPE REF TO dtel_2,
dataref_2 TYPE REF TO data.
FIELD-SYMBOLS <fs> TYPE ANY.
GET REFERENCE OF dataobj TO dataref_1.
dataref_2 = dataref_1.
ASSIGN dataref_2->* TO <fs>.
In this case, dataref_1->
, dataref_2->
, and <F> inherit the attributes of the dictionary data element DTEL_2.
Modification 7
Any Typing for CREATE DATA
New types, such as data references and internal tables, can be constructed when data objects are created
using the statement CREATE DATA
. Previously, only references to existing types were possible.
Modification 8
Dereferencing in Any Operand Positions
If a data reference variable is fully typed, it can be dereferenced in any operand position, using the dereferencing operator ->*
.
DATA dref TYPE REF TO i.
...
dref->* = dref->* + 1.