You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of reading individual values, you can use `to_abap` for converting the JSON data into a corresponding ABAP structure. The types are mapped as follows:
Except for the special date/time mappings, JSON data will be assigned to the corresponding ABAP fields using standard ABAP [data conversion rules](https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abenconversion_elementary.htm). Look out for conversion errors which throw `CX_SY_CONVERSION_ERROR` or unintentionally truncating values if a target field is shorter than the value.
`to_abap` supports transferring "corresponding only" fields. This will ignore JSON attributes that do not have a matching ABAP field name (see [Mapping](70-mapping.md)).
`to_abap` supports creating data references. You can determine the type of a field in the ABAP structure at runtime. For this to work, define the field as `type ref to data` and initialize the reference using `zcl_ajson_ref_initializer_lib=>create_path_refs_init` for each path to a reference field.
0 commit comments