SAP CALL TRAFO UPPER LOWER ABEXA



Get Example source ABAP code based on a different SAP table
  



Transformation of XML Element Names
This example demonstrates the transformation of letters in XML element names.

ABAP_SOURCE_CODE
DEMO CL_DEMO_TRAFO_UPPER_LOWER

ABAP_DESCRIPTION
In deserializations of XML data to ABAP data, the XML elements to be deserialized must generally be written in uppercase letters to be identified. This example shows ways of transforming elements written in other ways using self-written XSL transformations.
A structure, simple_struc, is serialized using different XSL transformations.
The identity transformation ID creates asXML with XML element names in uppercase letters.
The self-written XSL transformation DEMO_ID_UPPER_LOWER transforms the XML element names created by the serialization to lowercase letters, if the correct parameter passing is used.
The self-written XSL transformation DEMO_ID_FROM_TO_MIXED transforms the XML element names created by the serialization to Mixed Case Style (also known as Camel Case Style), if the appropriate parameter passing is used. To do this, an ABAP method is called from the transformation and this method itself calls the built-in function to_mixed.
Deserializations of the transformed asXML data with the identity transformation ID do not find the structure or the components.
Deserializations of the transformed asXML data with the self-written XSL transformations, on the other hand, are successful.
DEMO_ID_UPPER_LOWER also transforms lowercase letters to uppercase letters.
DEMO_ID_FROM_TO_MIXED also calls a method for to_mixed. This simple example transformation is not, however, symmetrical in all cases.
Instead of transformations, parsers and renderers can be used, as demonstrated in the executable example for JSON. The serial processing used here can be useful when dealing with large volumes of data.
The transformations used are as follows:
DEMO_ID_UPPER_LOWER
TRNS DEMO_ID_UPPER_LOWER
DEMO_ID_FROM_TO_MIXED
TRNS DEMO_ID_FROM_TO_MIXED