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:

  1. Call the transaction XSLT_TOOL. Then, enter a suitable name for your transformation. We gave it the name ZST6_FOR_STRUCTURE.
  2. Click on the Create button. Then, on the Create ...

Get SAP ABAP Advanced Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.