Do you often work with transformations for ABAP? If so, you might be keen on to read more about the new source-based transformation XML editor in ABAP Development Tools (ADT). It enables you, for example, to map structures or data elements onto XML documents.
You want to get an impact how the new editor has been integrated in an Eclipse-based IDE? The following screenshot might help you to get to know more about it:
Fig. 1: Example of a Simple Transformation
The new XML editor has been integrated in the similar way as you are used to from the existing ABAP source code editor. Here are the most relevant functionalities, such as syntax check, versioning, and so on, provided.
In comparison to the classic SE80, you can use here the following features in addition:
- Syntax coloring
- Outline view and Quick Outline view to display and navigate to structural elements
- Folding to expand and collapse subsequent code elements
- Breakpoints and soft breakpoints for debugging simple transformations
- Opening objects in several tabs in parallel
In this context, I’d like to highlight the following possibilities to display structural elements of a transformation:
The Outline view displays the internal structure of a transformation that is currently opened in the XML source code editor.
In a tree, the structuring elements, for example, templates and atom links, of a simple transformation are displayed:
- Program type line defined as prefix
- Type definitions with tt:type
- Root elements with tt:transform
- Data declarations with tt:root, tt:parameter, and tt:variable
- Templates with main and subtemplates
- Comments are introduced with !-
- Statements that list elements where attributes or parameters are assigned to, separated by a “|” character
Fig. 2:Outline that displays the structural elements of a ST
When you select one of the structural elements, the cursor navigates to its relevant source code position.
The Quick outline lists the same information as the Outline view. The advantage is, you can arrange it in a more flexible way directly beside your editor. To open the Quick Outline, choose Ctrl + O in the editor.
Fig. 3: Example of a Quick Outline
Debugging Simple Transformations
Now, the ABAP Debugger also supports debugging simple transformations.
This means, you can:
1. Step into a simple transformation from inside the ABAP Debugger
If the execution pointer of the ABAP Debugger points at a CALL TRANSFORMATION statement of a simple transformation, press F5. You then enter the coding of a simple transformation. This is similar to a Single Step into, for example, an ABAP method call.
2. Set a breakpoint inside a simple transformation
If you set a single breakpoint inside a simple transformation and run, for example, an unit test or ABAP program, where the corresponding simple transformation is used, the ABAP Debugger will stop directly at this breakpoint.
3. Navigate on the ABAP stack
As simple transform template calls are reflected by the ABAP Debugger stack display, you can navigate into templates in the same way as you know it from ABAP procedures. This is especially useful when simple transformation templates call ABAP procedures.
4. Display simple transformation data
In the same way as you display ABAP variables in the ABAP Debugger, you can also display parameter, variables, and data nodes of simple transformations.
When you are in the debugger, just hover the relevant symbol in the simple transformation source or double-click it.
Fig. 4: Example for displaying simple transformation data at a breakpoint
You need further information? Enjoy taking a look on the following help documentations: