Ansicht
Dokumentation
ABENABAP_JSON_NAMES_TO_UPPER_ABEXA - ABAP JSON NAMES TO UPPER ABEXA
rdisp/max_wprun_time - Maximum work process run time rdisp/max_wprun_time - Maximum work process run timeThis documentation is copyright by SAP AG.
- Transforming Names
Transforms the names of JSON objects to uppercase letters.
Source Code
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:
CPI1466 during Backup ABAP Short Reference
This documentation is copyright by SAP AG.
Length: 2817 Date: 20240420 Time: 134606 sap01-206 ( 32 ms )