Creating transformations for structures and calling them in programs
In this recipe, we will see how we can create transformations that correspond to a nested structure defined within an ABAP program. We will create a transformation, then call the transformation from a program using the CALL TRANSFORMATION
statement and pass it to a populated ABAP structure corresponding to the root element of the transformation. We will then see how serialization will generate the XML stream.
How to do it...
We will now see the steps needed to create a transformation corresponding to a structure:
Call the transaction
XSLT_TOOL
. Then, enter a suitable name for your transformation. We gave it the nameZST6_FOR_STRUCTURE
.Click on the Create button. Then, on the Create Transformation dialog box that appears, choose the option Simple Transformation and proceed further.
Enter the following code within the transformation editor:
- When done, click on the Activate () button.
Next, we will create the program that will...