Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Data Interfaces and Communication Interfaces →  ABAP and XML →  asXML - Canonical XML Representation →  asXML, Examples of Mappings 

asXML, Mapping of Anonymous Data Objects

The example demonstrates the mapping of anonymous data objects.

Other versions: 7.31 | 7.40 | 7.54

Source Code

    DATA dref   TYPE REF TO decfloat34.
    DATA xmlstr TYPE xstring.

    CREATE DATA dref.
    dref->* = '1.23456'.
    CALL TRANSFORMATION id SOURCE dref = dref
                           RESULT XML xmlstr.

    cl_abap_browser=>show_xml( xml_xstring = xmlstr ).

Description

The anonymous data object referenced by dref is mapped to a subelement of the element heap. An XML reference mechanism is used to associate this subelement with the reference variables in the element values. The element name is the XML schema type name precisionDecimal of the predefined ABAP type decfloat34 from the namespace abap="http://www.sap.com/abapxml/types/built-in".