XML transformation Example SAP ABAP

Hi All,

There are several ways you can create XML outbound files in SAP. The method I have shown is with a simple transformation using XSLT_TOOL. XSLT_TOOL is a SAP provided tool/wizard to create XML transformations.

In this example we are creating a XML file in the application server with sales order information. XML file holds multiple sales order information with sales order number, sales order type and customer information. 

File format.

















You require access to these transaction codes to generate this XML transformation.


1. Create table type.

Depending on the XML file format, matching ABAP table type should be created. 

Go to transaction SE11.

Create underline data type (structure) which match XML "customer" segment.









Create data type which correspond to "Order" segment in XML.








Create table type.






2. Create transformation.

Go to transformation XSLT_TOOL.

Provide name and click create. Set description and transformation type.











Select wizard button "Edit Simple Transformation Graphically".












Right click on root element and select "insert new root".















Provide header root element name and table type name.










Drag and drop data root into simple transformation section.











Double click of each element/node and change the name as desired to be shown in XML.












You can set any element as a attribute of a segment as needed. In this example "order-no' is set as a attribute of segment "Order".

Right click on the element and select "Change to attribute".


















Save and activate.

Final transformation.
















3. Create outbound program.







Outbound driver program consist of,

XML file would be downloaded as below.


SAP ABAP, Simple transformation, transformation, ABAP transformation, XSLT_TOOL, create XML, XML file download, File download, XML, SE11, SE38, Isuru Fernando, XML root, XML node, XML output, Sales order, VBAK, KNA1, Customer master, Download

Labels: , , , , , , , , , , , , , , , , ,