SAP DATA REFERENCE TYPE



Get Example source ABAP code based on a different SAP table
  



Data References
Data references can point to any data objects or to their parts (components, lines of internal tables, or subareas determined by offset or length specifications). The static type of their reference variables is either the built-in generic type data or any non-generic data type. Data reference variables can be used with the instance operator NEW for static and in the statement CREATE DATA for dynamic creation of data objects. The statement GET REFERENCE and the reference operator REF can be used to write references to existing data objects in data reference variables. When internal tables are processed, most statements have the addition REFERENCE INTO, to set references to table lines.
The dereferencing operator ->* is used to access the data object to which a data reference points.
Data references can be heap references or stack references.

ABAP_PGL
Using field symbols and data references appropriately
ABAP_PGL_END

ABAP_EXAMPLE_VX5
Inline declaration of a data reference variable dref with the static type scarr on the left side of a corresponding anonymous data object created on the heap. Uses the dereferencing operator ->* to access the entire data object and the object component selector -> to access a component.
ABEXA 00988
ABAP_EXAMPLE_END