SAP ABAP XSLT

Get Example source ABAP code based on a different SAP table
  


ARTICLE

XSL Transformations
An XSL transformation is a program in the repository that is written in XSLT (XSLT program) and used for the transformation of XML data. Existing ST programs in the repository can be called using the statement CALL TRANSFORMATION. XSLT programs are edited in the Transformation Editor, which can be accessed directly using transaction STRANS or called up in Object Navigator in ABAP Workbench by choosing Edit Object -> More -> Transformation and selecting XSLT Program.
The source and result of a general XSL transformation are XML data. When an XSL transformation is called using the statement CALL TRANSFORMATION, however, ABAP data can also be transformed directly to XML and back. For this purpose, a serialization or deserialization is performed implicitly.

IMAGE /SAP/PUBLIC/BC/ABAP/ABDOC_asXML.gif 567 226

In the case of transformations that use ABAP data as a source, the ABAP data is first serialized to a canonical XML representation (as XML) with the predefined identity transformation ID. This intermediate result is then used as the actual source for the XSL transformation. If the transformation ID itself is called in CALL TRANSFORMATION, the intermediate result is in the direct output.
In the case of transformations that have ABAP data as a result, the result of the XSL transformation is deserialized directly to the ABAP data. A prerequisite for the deserialization is that the result represents a canonical XML format. For transformations from XML to ABAP, the XML is first also transformed (conceptually) to an asXML structure, which is then deserialized, even if, technically, only one transformation step takes place.
The ABAP runtime environment contains an SAP XSLT processor for executing the transformations. It supports almost all XSLT statements and provides enhancements (extension instructions) such as the option of calling ABAP methods from XSLT programs. Documentation for the SAP XSLT processor is available in the application help under SAP XSLT Processor - Reference.