Professional Documents
Culture Documents
Simple Transformations are SAP programs which are used to convert ABAP data to XML and XML to ABAP data.They are like any other ABAP program and are managed through transport organizer.
Upon clicking, the creation dialog box appears as below. Enter the required information and press ok to create the Simple Transformation.
As shown below, we can use the transformation in our report program to convert XML data to ABAP data. The simple transformation Z_TEST_STRANS42, with below coding is applicable to do the above said functionality.
Inside the transformation, the template is mapped to the header tag and the line item details are read sequentially into the respective fields of the internal table. In our example, it is < teamMember> which is holding the line item details.
We can view how the transformation works in debugger mode via the transaction XSLT. For our example, Lets execute our transformation on debugger mode in XSLT transaction. As said earlier, first the template name as specified in the transformation coding is mapped with the incoming XML string. In our example it is teamMember.
Next, it prepares to read the first tag value inside the template. In our case it is Name tag.
Likewise, it completes reading all the tag values and populates them in the corresponding fields of the internal table GT_PROFILE.
Upon execution of the transformation, the results are mapped into the internal table fields as shown below.
Below is the output of the report, as written from the internal table.