Creating transformations for internal tables
In this recipe, we will see how we can create transformations for internal tables. We will use the transformation editor to define the transformation for the internal table, ITAB
, comprising of two fields, FIELD1
and FIELD2
.
How to do it...
We will now see the steps for creating a transformation corresponding to internal tables:
Create a simple transformation using the steps shown in the previous recipe. We will give it the name
zst6_internal_table
.Enter the following code in the transformation editor:
Next, we will write the code of the ABAP program that calls the transformation and supplies it with an ABAP internal table.
We create an internal table with the name
itab
with fieldsfield1
andfield2
and fill it with the necessary data.Finally, the
CALL TRANSFORMATION
statement is called, the internal table is passed, and the result is stored inxml_string
.
How it works...
The transformation contains a root element representing the internal table by...