The next figures show how to extract the form data using XSLT transformations.
XSLT: Extensible Stylesheet Language Transformation enables the conversion of XML formats into any other XML formats.
In this lesson, we will often use the easier expression “XML transformation”: XSLT does XML transformations.
The ABAP runtime environment contains an SAP-XSLT processor for executing those transformations.
XSL transformations of the ABAP Repository are edited with the Transformation Editor and called with the statement CALL TRANSFORMATION.
It is possible to convert XML formats directly into ABAP data, and vice versa. In our scenario, we will transform the XML format into ABAP Dictionary structured types.
Some preparations are necessary before the XML transformation takes place (see replace and concatenate commands in the figure above).
The CALL TRANSFORMATION in the example searches for data of the type IS_ADDRESS inside the XML stream GV_XML_DATA_STRING and transforms it into the variable GS_BAPIADDR3, based on the the ABAP Dictionary type BAPIADDR3.
After the XML transformation, the data is held in GS_BAPIADDR3 and the business process continues.
In this example, the BAPI BAPI_USER_CHANGE to update the data is called.
Details on the syntax of the statement:CALL TRANSFORMATION {trans|(name)} [PARAMETERS {p1 = e1 p2 = e2 ...}|(ptab)] [transformation options] SOURCE {XML sxml} | {{bn1 = e1 bn2 = e2 ...}|(stab)} RESULT {XML rxml} | { {bn1 = f1 bn2 = f2 ...}|(rtab) }.
The source of the transformation is specified behind SOURCE and the result is stored behind RESULT.
PARAMETERS can be used to pass parameters to the transformation. The possible transformation types are:
The name of the transformation can be specified either directly as trans or dynamically as the content of a parenthesized character-like data object name.
When specified dynamically, the name must be in uppercase letters.
The specified transformation must exist as an XSLT program or as a Simple Transformation in the ABAP Repository.
You can use transformation options to specify transformation options.