SAP ABAP DESERL EMPT ELEM ABEXA



Get Example source ABAP code based on a different SAP table
  



Deserializing Empty Elements
This example demonstrates the deserialization of empty elements.

ABAP_SOURCE_CODE
DEMO CL_DEMO_ASXML_ASJSON_EMPTY_VLS

ABAP_DESCRIPTION
An elementary data object, a structure and an internal table are transformed using the identity transformation ID to their asXML and asJSON representations. In the asXML representation, the values of all elements are removed. In the asJSON representation, only the components from objects and arrays can be removed.
After deserialization to the original ABAP data objects, the elementary data object and the internal table are initial. However, the empty element in the structure is interpreted as a missing component and the structure component retains its previous value. If the transformation option clear is used with the value all, all ABAP data objects are initialized.



Latest notes:

The modification of XML and JSON data using string processing shown here is only for the sake of clarity in the example. In production programs, the APIs of class libraries for XML should be used for this.
NON_V5_HINTS
ABAP_HINT_END