ABAP Keyword Documentation → ABAP - Reference → Data Interfaces and Communication Interfaces → ABAP and XML → asXML - Canonical XML Representation → asXML - Mapping of ABAP Data Types → asXML - Mapping of Reference Variables and Referenced Objects
asXML - Named Reference Variables
A named reference variable is displayed without text content as the only attribute of the associated subelement of values. An attribute for a reference variable has the name href and the content "#key", where key is the unique key of an object in the element heap. An element of an initial reference does not have an attribute href and has no other content. The key key of the ABAP runtime environment is set during serialization; when deserializing, any key can be used.
Note the following special cases when serializing named reference variables:
- Data reference variables that point to data objects whose data type only has one technical name raise the exception CX_XSLT_DESERIALIZATION_ERROR, which can be avoided by the entering
transformation option
technical_types
.
- Data reference variables that point to data objects not created using CREATE
DATA (stack references) are handled like initial reference variables by default during serialization. This can be overriden by specifying the
transformation option
data_refs
.
During deserialization to a reference variable, the reference variable must be the same as or more general than the dynamic type of the object that is stored in the XML document. The associated ABAP data objects or instances of a class are created during deserialization.