ARTICLE
JSON , Transforming Names
Transforms the names of JSON objects to uppercase letters.
ABAP_SOURCE_CODE
ABAP_EXEC
ABAP_DESCRIPTION
This example demonstrates how the names of JSON
data objects can be transformed to uppercase letters, so making
it possible, for example, to bind the objects to the corresponding ABAP
data in deserializations using the statement
CALL TRANSFORMATION . Two
transformation methods are demonstrated:
Parsing and rendering in the method json_names_to_upper_pr
This transforms the JSON data to
JSON-XML .
The result is parsed using an XML reader
.
The attributes with the name name are transformed to uppercase
letters as in the example Modifying
XML Data .
The result is rendered back to JSON using a
JSON writer .
Calling a transformation in the method json_names_to_upper_tr
The XSL transformation
DEMO_JSON_XML_TO_UPPER , designed for this purpose, is used to
transform the object names in JSON-XML
to uppercase letters and passes the result to a
JSON writer .
The modified JSON data is extracted from the writer .
The statement ASSERT guarantees that the results of both
transformations are the same. After the transformation, the data is
deserialized successfully to the ABAP structure. The method used in
practice depends on performance and the volume of data expected.
Documentation extract taken from SAP system, � Copyright SAP AG. All rights reserved