Skip to content

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

asXML, Mapping of Objects

This 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_demo_output=>display_xml( xmlstr ).

Description

The attributes of the object referenced by oref are mapped to subelements of the heap element. The association between the reference variables in the values element and the object in heap is made using an XML reference mechanism.