Get Example source ABAP code based on a different SAP table
ABAP_JSON - Transforming Names Transforms the names of JSON objects to uppercase letters.
ABAP_SOURCE_CODE DEMO CL_DEMO_JSON_NAMES_TO_UPPER
ABAP_DESCRIPTION This example demonstrates how the names of JSON data > objects can be transformed to uppercase letters, so that they can be bound to the corresponding ABAP data in deserializations using the statement CALL TRANSFORMATION >> for example. 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 executable 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>>, written for this purpose, is used to transform the object names in JSON-XML> to uppercase letters and places the result in a JSON writer>.
The modified JSON data is read 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. The XSL transformation used DEMO_JSON_XML_TO_UPPER>> is as follows: TRNS DEMO_JSON_XML_TO_UPPER