AS ABAP Release 758, ©Copyright 2024 SAP SE. All rights reserved.
ABAP - Keyword Documentation → ABAP - Programming Language → Data Interfaces and Communication Interfaces → ABAP and JSON → JSON - Transformations → asJSON - Canonical JSON Representation → asJSON - Mapping of ABAP Data Types →asJSON - Mapping of Reference Variables and Objects
As in asXML, a reference mechanism is used for the asJSON representation of anonymous data objects and class instances (objects), which are addressed using references in reference variables. Since JSON does not suggest any syntax for references, an SAP-specific reference mechanism based on asXML is used.
In addition to the value, the dynamic type of the reference variables is specified in the object components of %heap when serialization takes place to ensure unique deserialization.
Hints
Example
For information about the differences between serializing to %heap and embedded storage, see the executable example Serializations to Heap or Embedded.