ABAP Keyword Documentation → ABAP - Reference → Data Interfaces and Communication Interfaces → ABAP and JSON → Transformations for JSON → asJSON - Canonical JSON Representation → asJSON - Mapping of ABAP Data Types
asJSON - Mapping of Internal Tables
Internal tables are represented in asJSON as JSON arrays. The rows of the internal table are represented in their canonical representation as the components of the array. All table categories are allowed. Serializations do not pass any information about the table category to the JSON data. If the target field of a deserialization is a sorted table, the rows are sorted accordingly.
Other versions:
7.31 | 7.40 | 7.54
Notes
- An internal table that does not have an associated JSON object component in deserializations retains
its previous value. If an empty array is assigned to an internal table, it is set to its type-specific
initial value (i.e. emptied). To initialize the internal table in either case, the transformation option
clear
with the value "all" can be used.
- Unlike in the asXML representation of internal tables, asJSON does not require a name like item for the table rows.
Example