ABAP - Keyword Documentation →  ABAP - Reference →  Data Interfaces and Communication Interfaces →  ABAP and JSON → 

JSON-XML - XML Representation of JSON

JSON XML is an SAP-specific representation of JSON data in XML format. The single values, arrays, and objects in JSON are represented as followed in XML.

Single Values

Character-like values

"..." <str>...</str>

Number values

... <num>...</num>

Boolean values

true <bool>true</bool>
false <bool>false</bool>

Null values

null <null />

Data Structures

Arrays

[...] <array>...</array>

The components of arrays, separated by commas, are mapped as subelements of the element <array>, but the type-specific mapping rule applies to each element.

Note

Since the components of an array do not have names, the elements of an array in JSON-XML cannot have the corresponding attributes (unlike the case with objects).

Objects

{...} <object>...</object>

The components of objects, separated by commas, are mapped as subelements of the element <object>. There are two representation methods:

In the shorter method, used by default, a component is mapped like an element of an array, with the name n added to the type-specific XML element of the component as the content of the attribute name.

In the second longer method, the type-specific XML element of a component is nested in an additional element <member>, which then has the attribute name with the name of the component.

Notes

Examples