Skip to end of metadata
Go to start of metadata



To retrieve attribute values from XML tags , we can use the Class cl_xml_document.

The above screenshot shows the attribute value and Tag value.

Using CALL TRANSFORMATION, we can retrieve the tag value from XML not the attribute value.


To retrieve the attribute value we can do the following:


1.Upload the XML data from file into SAP as XML_IN(string)


2.Create an Instance for the class cl_xml_document.



3. Parse through the uploaded XML file using Method parse_string.



4. Get the Parent Node. For the above screenshot, the parent node is actionids.


5. Get Attribute Value for actorID under the Node Approval.

6. Find the node Approval under the parent node actionids.


7. Get the node name. If the node name is ‘Approval’, then get the attribute Value for the Attribute : actorID by passing root node.


8. Fill the internal table with the attribute value.