Ansicht
Dokumentation

ABENABAP_JSON_XML_ABEXA - ABAP JSON XML ABEXA

ABENABAP_JSON_XML_ABEXA - ABAP JSON XML ABEXA

ABAP Short Reference   General Data in Customer Master  
This documentation is copyright by SAP AG.
SAP E-Book

- Object Components in JSON-XML

This example demonstrates the two alternatives for object components in JSON-XML.

Source Code

Execute

Description

The string json_xml is filled with XML data in valid JSON-XML and displayed. The element object> contains elements that embody JSON object components directly and member> elements that wrap these components.

A JSON reader parses the string json_xml by calling the method SKIP_NODE in a single action and passes the XML data to a JSON writer created with the type IF_SXML=>CO_XT_JSON. The output of this writer is passed to the string json, which then contains valid JSON data. The writer has implemented both kinds of the object components with the same result.

The string json is parsed with two further XML readers. The first parses with standard setting and the setting applies the option IF_SXML_READER=>CO_OPT_SEP_MEMBER. In the JSON-XML result of the first reader, no object component has a member> element; in the JSON-XML results of the second reader, every object component is represented with a member> element.






PERFORM Short Reference   Vendor Master (General Section)  
This documentation is copyright by SAP AG.

Length: 1864 Date: 20240424 Time: 024810     sap01-206 ( 35 ms )