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 Objects

The example demonstrates the mapping of referenced objects.

Other versions: 7.31 | 7.40 | 7.54

Source Code

    DATA: oref TYPE REF TO serializable,
          xmlstr TYPE xstring.

    CREATE OBJECT oref.

    CALL TRANSFORMATION id
                        SOURCE object = oref
                        RESULT XML xmlstr.

    cl_abap_browser=>show_xml( xml_xstring = xmlstr ).

Description

The attributes of the object referenced by oref are displayed on subelements of the heap element. The connection between the reference variables in the values element and the object in heap takes place using an XML reference mechanism.