Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata

When we have an xml string and that needs to be converted into object, we need to parse the xml string.

Like the other languages in ABAP we have standard ixml interfaces to parse and process the xml, Steps are as follows:

Interface IF_IXML (this is a factory actually) : CL_ixml=>create() – will give me and instance of the Factory. This is the main factory, which will then give me instances of other factories

Then we need to create an XML document (Interface for this is IF_IXML_DOCUMENT) – Use the factory instance obtained above to create the document (……->CREATE_DOCUMENT)

This document is to be parsed. For this we  need:

  • Blank Document instance (obtained from the above factory)
  • Stream – which will then point to the actual XML that we need to parse (….>…>CREATE_ISTREAM_STRING) . No separate factory for this. The STREAM FACTORY has a method which will then help you create the stream. It is in this method that we pass the XML which needs to be parsed.
  • We have to create now a Parser – IF_IXML_PARSER. The main factory itself can be used to create the parser (…….….->CREATE_PARSER : Here we have to pass Document, Stream Factory and the stream instances)

Once the Parser instance is ready, call the method PARSE. Thereafter, use the STREAM instance and call the method CLOSE, in order to close the stream

To point to a Node, we need an instance declaration of node type – IF_IXMl_NODE

Example: Test.xml

***************************Report code



  • No labels


  1. What about a situation when you have 100 fields? Would you still use  IF node->get_value( ) = .... ? I think you should come up with something dynamic.

  2. If possible, use a Simple Transformation (Transaction STRANS), it is much easier.