diff --git a/07_String_Processing.md b/07_String_Processing.md
index deae654..c9a231b 100644
--- a/07_String_Processing.md
+++ b/07_String_Processing.md
@@ -78,7 +78,7 @@ ABAP provides the following built-in data types for data objects that contain ch
| Type | Details | Length | Value Range | Initial Value |
|---|---|---|---|---|
| `string` | For variable length character strings. [Data objects](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abendata_object_glosry.htm "Glossary Entry") of this type are [dynamic data objects](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abendynamic_data_object_glosry.htm "Glossary Entry"), i. e. the length of a variable can change during the execution of an ABAP program and thus it can contain character strings of different lengths. A data object of type `string` is called *text string* or, in short, just *string*. | No standard length; length is variable | Any [Unicode](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenunicode_glosry.htm) characters that can be encoded in ABAP language's code page [UCS-2](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenucs2_glosry.htm). The most common content are alphanumeric characters or special characters. | Empty string with length 0 |
-| `c` | For fixed length character strings. Data objects of this type are [static data objects](http://ldcialx.wdf.sap.corp:50018/sap/public/bc/abap/docu?sap-language=EN&object=abenstatic_data_object_glosry&version=X&sap-client=000), i. e. the length of a variable must be defined during its declaration and does not change during the execution of an ABAP program. Thus, it always contains character strings of the same length. A data object of type `c` is called *text field*.|Data objects of this type can contain a string of fixed length (between 1 and 262143 characters); standard length: 1 | Same as for `string` | A blank for each position |
+| `c` | For fixed length character strings. Data objects of this type are [static data objects](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenstatic_data_object_glosry.htm), i. e. the length of a variable must be defined during its declaration and does not change during the execution of an ABAP program. Thus, it always contains character strings of the same length. A data object of type `c` is called *text field*.|Data objects of this type can contain a string of fixed length (between 1 and 262143 characters); standard length: 1 | Same as for `string` | A blank for each position |
In addition to these main data types for character strings, there are several other fixed length data types with special meanings:
diff --git a/21_XML_JSON.md b/21_XML_JSON.md
index e379dc9..309dee0 100644
--- a/21_XML_JSON.md
+++ b/21_XML_JSON.md
@@ -4,12 +4,16 @@
- [Working with XML and JSON in ABAP](#working-with-xml-and-json-in-abap)
- [Introduction](#introduction)
- - [Processing XML Using Class Libraries](#processing-xml-using-class-libraries)
- - [iXML](#ixml)
- - [sXML](#sxml)
- - [XML Transformations](#xml-transformations)
- - [CALL TRANSFORMATION Syntax](#call-transformation-syntax)
+ - [Working with XML](#working-with-xml)
+ - [Processing XML Using Class Libraries](#processing-xml-using-class-libraries)
+ - [iXML](#ixml)
+ - [sXML](#sxml)
+ - [XML Transformations](#xml-transformations)
+ - [CALL TRANSFORMATION Syntax](#call-transformation-syntax)
- [Working with JSON](#working-with-json)
+ - [Creating and Reading JSON Data Using sXML](#creating-and-reading-json-data-using-sxml)
+ - [Transforming JSON Data Using Transformations](#transforming-json-data-using-transformations)
+ - [Handling JSON Data with ABAP Classes](#handling-json-data-with-abap-classes)
- [Excursions](#excursions)
- [Serializing and Deserializing Objects](#serializing-and-deserializing-objects)
- [Converting string \<-\> xstring](#converting-string---xstring)
@@ -23,18 +27,19 @@ This cheat sheet provides a high-level overview of working with XML and JSON in
- Processing XML using class libraries (iXML, sXML)
- XML Transformations using XSLT and Simple Transformations (ST), i.e. serializations (ABAP to XML) and deserializations (XML to ABAP)
- `CALL TRANSFORMATION` syntax
-- Dealing with JSON data
+- Working with JSON data
> **💡 Note**
> - The cheat sheet snippets and the executable example cover simple cases. Find more executable examples of the ABAP Keyword Documentation following the links in the [More Information](#more-information) section.
> - For more detailed information, such as documentation on ST syntax, what asXML is, etc., also see the links in the [More Information](#more-information) section.
-> - In addition to the options covered in the cheat sheet, there are other ways to work with XML/JSON (for example, the `/ui2/cl_json` class).
+
⬆️ back to top
-## Processing XML Using Class Libraries
+## Working with XML
+### Processing XML Using Class Libraries
-### iXML
+#### iXML
- *Integrated* XML Library
- Provides methods for ...
- validating and parsing (i.e. reading) XML data in 1.0 format into a DOM representation (Document Object Model, which is a tree-like representation of the documents in the memory)
@@ -169,7 +174,7 @@ ENDIF.
⬆️ back to top
-### sXML
+#### sXML
- *Serial* XML Library
- Provides XML readers and writers for different sources and targets
- Processes XML data sequentially
@@ -389,7 +394,7 @@ ENDTRY.
⬆️ back to top
-## XML Transformations
+### XML Transformations
To perform transformations in ABAP, you can use:
@@ -426,10 +431,15 @@ Possible transformations, some of which are covered in the example:
⬆️ back to top
-## CALL TRANSFORMATION Syntax
+### CALL TRANSFORMATION Syntax
The following code snippets demonstrate a selection of possible syntax options when using [`CALL TRANSFORMATION`](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abapcall_transformation.htm) statements.
+> **💡 Note**
+> You can also transform ABAP to and from JSON data using transformations. Find examples in the [Transforming JSON Data Using Transformations](#transforming-json-data-using-transformations) section.
+
+
+
**Specifying transformations**
```abap
@@ -516,9 +526,246 @@ CALL TRANSFORMATION ... SOURCE ...
## Working with JSON
- You can ..
- - create and read JSON data in ABAP using the readers and writers in the sXML library. See the processing of XML data in the sXML section above. Parsing and rendering JSON data works in a similar way. However, instead of using XML readers/writers, you use JSON readers/writers.
- - transform ABAP to and from JSON data using transformations. You can directly transform ABAP <-> JSON using identity transformation (ID). In this context, note the intermediate format asJSON (see the notes on asXML above).
- - create and handle JSON data using the [XCO library](https://help.sap.com/docs/btp/sap-business-technology-platform/xco-library?version=Cloud).
+ - create/render and read/parse JSON data in ABAP using the readers and writers in the sXML library. See the processing of XML data in the sXML section above. Parsing and rendering JSON data works in a similar way. However, instead of using XML readers/writers, you use JSON readers/writers.
+ - transform ABAP to and from JSON data using transformations. You can directly transform ABAP <-> JSON using identity transformation (`ID`). In this context, note the intermediate format asJSON (see the notes on asXML above).
+ - create and handle JSON data using the [XCO library](https://help.sap.com/docs/btp/sap-business-technology-platform/xco-library?version=Cloud) or `/ui2/cl_json`.
+
+⬆️ back to top
+
+### Creating and Reading JSON Data Using sXML
+
+> **💡 Note**
+> - In ABAP, the sXML library processes JSON data using JSON-XML, an SAP-specific JSON data representation in XML format. This intermediate step is used for both reading and creating JSON data. Find more information [here](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenabap_json_xml.htm).
+> - The following examples provide basic implementations to give you an idea. You should always work out your own solutions.
+> - Both token-based and object-oriented rendering/parsing methods are available. These examples use the token-based approach.
+> - For additional information and examples, see the [ABAP and JSON](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenabap_json.htm) section of the ABAP Keyword Documentation.
+
+
+Expand the following collapsible sections to view the code of examples. To try them out, create a demo class named `zcl_some_class` and paste the code into it. After activation, choose *F9* in ADT to execute the class. This example is set up to display output in the console.
+
+**Creating JSON Data using the sXML library**
+
+
+ Expand to view the code
+
+
+- The `create` method from the `cl_sxml_string_writer` class is used to create a JSON writer by setting the type to `if_sxml=>co_xt_json`.
+- Note the comments about the cast in the XML section.
+- Several elements and attributes are created using token-based rendering methods.
+- Finally, the created JSON data is displayed.
+
+
+```abap
+CLASS zcl_some_class DEFINITION
+ PUBLIC
+ FINAL
+ CREATE PUBLIC .
+
+ PUBLIC SECTION.
+ INTERFACES if_oo_adt_classrun.
+ PROTECTED SECTION.
+ PRIVATE SECTION.
+
+ENDCLASS.
+
+
+
+CLASS zcl_some_class IMPLEMENTATION.
+ METHOD if_oo_adt_classrun~main.
+
+ "In this example, the following JSON data should be created.
+ "[{"carrier_id":"LH","connection_id":"400","city_from":"Frankfurt","city_to":"Berlin"},
+ " {"carrier_id":"AZ","connection_id":"790","city_from":"Rome","city_to":"Osaka"}]
+
+ "Creating a JSON writer by specifying the type in the 'create' method appropriately
+ "The example uses token-based rendering.
+ DATA(json_writer) = CAST if_sxml_writer( cl_sxml_string_writer=>create( type = if_sxml=>co_xt_json ) ).
+ TRY.
+ json_writer->open_element( name = 'array' ).
+ json_writer->open_element( name = 'object' ).
+
+ json_writer->open_element( name = 'str' ).
+ json_writer->write_attribute( name = 'name' value = 'carrier_id' ).
+ json_writer->write_value( value = 'LH' ).
+ json_writer->close_element( ).
+
+ json_writer->open_element( name = 'str' ).
+ json_writer->write_attribute( name = 'name' value = 'connection_id' ).
+ json_writer->write_value( value = '400' ).
+ json_writer->close_element( ).
+
+ json_writer->open_element( name = 'str' ).
+ json_writer->write_attribute( name = 'name' value = 'city_from' ).
+ json_writer->write_value( value = 'Frankfurt' ).
+ json_writer->close_element( ).
+
+ json_writer->open_element( name = 'str' ).
+ json_writer->write_attribute( name = 'name' value = 'city_to' ).
+ json_writer->write_value( value = 'Berlin' ).
+ json_writer->close_element( ).
+
+ json_writer->close_element( ).
+
+ json_writer->open_element( name = 'object' ).
+
+ json_writer->open_element( name = 'str' ).
+ json_writer->write_attribute( name = 'name' value = 'carrier_id' ).
+ json_writer->write_value( value = 'AZ' ).
+ json_writer->close_element( ).
+
+ json_writer->open_element( name = 'str' ).
+ json_writer->write_attribute( name = 'name' value = 'connection_id' ).
+ json_writer->write_value( value = '790' ).
+ json_writer->close_element( ).
+
+ json_writer->open_element( name = 'str' ).
+ json_writer->write_attribute( name = 'name' value = 'city_from' ).
+ json_writer->write_value( value = 'Rome' ).
+ json_writer->close_element( ).
+
+ json_writer->open_element( name = 'str' ).
+ json_writer->write_attribute( name = 'name' value = 'city_to' ).
+ json_writer->write_value( value = 'Osaka' ).
+ json_writer->close_element( ).
+
+ json_writer->close_element( ).
+ json_writer->close_element( ).
+ CATCH cx_sxml_state_error INTO DATA(error).
+ out->write( error->get_text( ) ).
+ ENDTRY.
+
+ DATA(json) = cl_abap_conv_codepage=>create_in( )->convert( CAST cl_sxml_string_writer( json_writer )->get_output( ) ).
+ out->write( json ).
+ ENDMETHOD.
+ENDCLASS.
+```
+
+
+
+
+**Reading JSON Data using the sXML library**
+
+
+ Expand to view the code
+
+
+- An internal table is created for display purposes. This table is populated when iterating over all nodes. It includes information such as the node's value.
+- For more details on the *name* component and others, refer to the [ABAP Keyword Documentation](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenabap_json_xml.htm).
+- The `create` method from the `cl_sxml_string_reader` class is used to create a JSON reader.
+- After iterating through all the nodes, the retrieved information that has been added to the internal table is displayed.
+
+
+```abap
+CLASS zcl_some_class DEFINITION
+ PUBLIC
+ FINAL
+ CREATE PUBLIC .
+
+ PUBLIC SECTION.
+ INTERFACES if_oo_adt_classrun.
+ PROTECTED SECTION.
+ PRIVATE SECTION.
+
+ENDCLASS.
+
+
+
+CLASS zcl_some_class IMPLEMENTATION.
+ METHOD if_oo_adt_classrun~main.
+
+ "Creating demo JSON data
+ DATA(json) = cl_abap_conv_codepage=>create_out( )->convert(
+ `[` &&
+ ` {` &&
+ ` "carrier_id": "LH",` &&
+ ` "connection_id": "400",` &&
+ ` "city_from": "Frankfurt",` &&
+ ` "city_to": "Berlin"` &&
+ ` },` &&
+ ` {` &&
+ ` "carrier_id": "DL",` &&
+ ` "connection_id": "1984",` &&
+ ` "city_from": "San Francisco",` &&
+ ` "city_to": "New York"` &&
+ ` },` &&
+ ` {` &&
+ ` "carrier_id": "AZ",` &&
+ ` "connection_id": "790",` &&
+ ` "city_from": "Rome",` &&
+ ` "city_to": "Osaka"` &&
+ ` }` &&
+ `]` ).
+
+ "Creating an internal table for display purposes
+ DATA: BEGIN OF node_info,
+ node_type TYPE string,
+ name TYPE string,
+ value TYPE string,
+ END OF node_info,
+ nodes_tab LIKE TABLE OF node_info.
+
+ "Creating reader
+ "In this example, no special methods are used. Therefore, a cast is not carried out.
+ DATA(reader) = cl_sxml_string_reader=>create( json ).
+
+ "To iterate accros all nodes, you can call the NEXT_NODE method.
+ TRY.
+ DO.
+ CLEAR node_info.
+ reader->next_node( ).
+
+ "When reaching the end of the XML data, the loop is exited.
+ IF reader->node_type = if_sxml_node=>co_nt_final.
+ EXIT.
+ ENDIF.
+
+ "You can access the properties of the node directly.
+ "For display purposes, the property information is stored in an internal table.
+ "The example here just uses simple demo JSON data. Not all properties are
+ "retrieved and displayed.
+
+ "Node type, see the interface if_sxml_node
+ node_info-node_type = SWITCH #( reader->node_type WHEN if_sxml_node=>co_nt_initial THEN `CO_NT_INITIAL`
+ WHEN if_sxml_node=>co_nt_element_open THEN `CO_NT_ELEMENT_OPEN`
+ WHEN if_sxml_node=>co_nt_element_close THEN `CO_NT_ELEMENT_CLOSE`
+ WHEN if_sxml_node=>co_nt_value THEN `CO_NT_VALUE`
+ WHEN if_sxml_node=>co_nt_attribute THEN `CO_NT_ATTRIBUTE`
+ ELSE `Error` ).
+ "Name of the element
+ node_info-name = reader->name.
+ "Character-like value (if it is textual data)
+ node_info-value = COND #( WHEN reader->node_type = if_sxml_node=>co_nt_value THEN reader->value ).
+ APPEND node_info TO nodes_tab.
+
+ "Once the method is called, you can directly access the attributes of the reader with the required
+ "properties of the node. When the parser is on the node of an element opening, you can use the method
+ "NEXT_ATTRIBUTE to iterate across the JSON attributes.
+ IF reader->node_type = if_sxml_node=>co_nt_element_open.
+ DO.
+ reader->next_attribute( ).
+ IF reader->node_type <> if_sxml_node=>co_nt_attribute.
+ EXIT.
+ ENDIF.
+ APPEND VALUE #( node_type = `CO_NT_ATTRIBUTE`
+ name = reader->name
+ value = reader->value ) TO nodes_tab.
+ ENDDO.
+ ENDIF.
+ ENDDO.
+ CATCH cx_sxml_state_error INTO DATA(error_parse_token).
+ out->write( error_parse_token->get_text( ) ).
+ ENDTRY.
+
+ out->write( nodes_tab ).
+ ENDMETHOD.
+ENDCLASS.
+```
+
+
+
+⬆️ back to top
+
+### Transforming JSON Data Using Transformations
The following code snippets show a selection of transformation options using the predefined identity transformation. Here, a JSON writer is specified as the target.
@@ -600,6 +847,12 @@ DATA(json_formatted) = cl_abap_conv_codepage=>create_in( )->convert( CAST cl_sxm
*}
```
+⬆️ back to top
+
+### Handling JSON Data with ABAP Classes
+
+**Using the XCO library**
+
The following snippets demonstrate creating and handling JSON data using the XCO library.
```abap
@@ -672,6 +925,165 @@ xco_cp_json=>data->from_string( json_created_xco )->apply( VALUE #(
"DL 1984 San Francisco New York
```
+**Using the /ui2/cl_json Class**
+
+For more information, see the class documentation. Note that there are many additional and optional parameters available, some of which are explored in the example in the collapsible section below.
+
+
+```abap
+DATA(some_table) = VALUE string_table( ( `aaa` ) ( `bbb` ) ( `ddd` ) ).
+
+"--------- ABAP -> Json ---------
+DATA(abap_to_json) = /ui2/cl_json=>serialize( data = some_table ).
+
+"--------- Json -> ABAP ---------
+DATA table_json_to_abap TYPE string_table.
+/ui2/cl_json=>deserialize( EXPORTING json = abap_to_json
+ CHANGING data = table_json_to_abap ).
+```
+
+Expand the following collapsible section to view the code of an example. To try it out, create a demo class named `zcl_some_class` and paste the code into it. After activation, choose *F9* in ADT to execute the class. This example is set up to display output in the console.
+
+
+ Expand to view the code
+
+
+```abap
+CLASS zcl_some_class DEFINITION
+ PUBLIC
+ FINAL
+ CREATE PUBLIC .
+
+ PUBLIC SECTION.
+ INTERFACES if_oo_adt_classrun.
+ PROTECTED SECTION.
+ PRIVATE SECTION.
+
+ENDCLASS.
+
+
+
+CLASS zcl_some_class IMPLEMENTATION.
+ METHOD if_oo_adt_classrun~main.
+
+ TYPES: BEGIN OF demo_struc,
+ carrier_id TYPE c LENGTH 3,
+ connection_id TYPE n LENGTH 4,
+ city_from TYPE c LENGTH 20,
+ city_to TYPE c LENGTH 20,
+ END OF demo_struc.
+ DATA itab TYPE TABLE OF demo_struc WITH EMPTY KEY.
+ itab = VALUE #( ( carrier_id = 'AA' connection_id = '0017' city_from = 'New York' city_to = 'San Francisco' )
+ ( carrier_id = 'AZ' connection_id = '0789' city_from = 'Tokyo' city_to = 'Rome' ) ).
+
+ "---------------- Serializing ----------------
+
+ DATA(abap_to_json) = /ui2/cl_json=>serialize( data = itab ).
+ "Note the many additional, optional parameters such as for formatting the
+ "serialized JSON. For more information, see the class documentation.
+ DATA(abap_to_json_pretty) = /ui2/cl_json=>serialize( data = itab
+ format_output = abap_true ).
+ DATA(abap_to_json_pretty_name) = /ui2/cl_json=>serialize( data = itab
+ format_output = abap_true
+ pretty_name = /ui2/cl_json=>pretty_mode-camel_case ).
+
+ out->write( `---------- ABAP -> JSON ----------` ).
+ out->write( abap_to_json ).
+ out->write( `---------- ABAP -> JSON (pretty printed) ----------` ).
+ out->write( abap_to_json_pretty ).
+ out->write( `---------- ABAP -> JSON (camel case) ----------` ).
+ out->write( abap_to_json_pretty_name ).
+
+ "---------------- Deserializing ----------------
+
+ DATA(json_to_abap) = abap_to_json.
+ DATA itab_json_to_abap LIKE itab.
+
+ /ui2/cl_json=>deserialize( EXPORTING json = json_to_abap
+ CHANGING data = itab_json_to_abap ).
+
+ out->write( `---------- JSON -> ABAP ----------` ).
+ out->write( itab_json_to_abap ).
+
+ "---------------- Deserializing: Applying name mapping ----------------
+ "Creating an internal table with different field names
+ TYPES: BEGIN OF demo_struc4map,
+ carr TYPE c LENGTH 3,
+ conn TYPE n LENGTH 4,
+ from TYPE c LENGTH 20,
+ to TYPE c LENGTH 20,
+ END OF demo_struc4map.
+ DATA itab4map TYPE TABLE OF demo_struc4map WITH EMPTY KEY.
+
+ /ui2/cl_json=>deserialize( EXPORTING json = json_to_abap
+ name_mappings = VALUE #( ( abap = 'CARR' json = `CARRIER_ID` )
+ ( abap = 'CONN' json = `CONNECTION_ID` )
+ ( abap = 'FROM' json = `CITY_FROM` )
+ ( abap = 'TO' json = `CITY_TO` ) )
+ CHANGING data = itab4map ).
+
+ out->write( `---------- JSON -> ABAP (Name mapping) ----------` ).
+ out->write( itab4map ).
+
+ "---------------- Deserializing: Using JSON as xstring ----------------
+
+ DATA(json_xstring) = cl_abap_conv_codepage=>create_out( )->convert(
+ `[` &&
+ ` {` &&
+ ` "carrier_id": "LH",` &&
+ ` "connection_id": "400",` &&
+ ` "city_from": "Frankfurt",` &&
+ ` "city_to": "Berlin"` &&
+ ` },` &&
+ ` {` &&
+ ` "carrier_id": "DL",` &&
+ ` "connection_id": "1984",` &&
+ ` "city_from": "San Francisco",` &&
+ ` "city_to": "New York"` &&
+ ` },` &&
+ ` {` &&
+ ` "carrier_id": "AZ",` &&
+ ` "connection_id": "790",` &&
+ ` "city_from": "Rome",` &&
+ ` "city_to": "Osaka"` &&
+ ` }` &&
+ `]` ).
+
+ DATA itab_json_xstr_to_abap LIKE itab.
+ /ui2/cl_json=>deserialize( EXPORTING jsonx = json_xstring
+ CHANGING data = itab_json_xstr_to_abap ).
+
+ out->write( `---------- JSON (xstring) -> ABAP ----------` ).
+ out->write( itab_json_xstr_to_abap ).
+
+ "---------------- Deserializing: No equivalent ABAP type available ----------------
+
+ "The example assumes that there is no equivalent ABAP type available for JSON data
+ "that is to be deserialized. You can use of the 'generate' method that has a
+ "returning parameter of the generic type 'ref to data'.
+ DATA(json) = `[{"CARRIER_ID":"AA","CONNECTION_ID":17,"CITY_FROM":"New York","CITY_TO":"San Francisco"},` &&
+ `{"CARRIER_ID":"AZ","CONNECTION_ID":789,"CITY_FROM":"Tokyo","CITY_TO":"Rome"}]`.
+
+ DATA(dref) = /ui2/cl_json=>generate( json = json ).
+ DATA(dref_xstr) = /ui2/cl_json=>generate( jsonx = json_xstring ).
+
+ "You can further process the content, for example, with RTTS as outlined in the
+ "Dynamic Programming cheat sheet.
+ IF dref IS BOUND.
+ out->write( `---------- JSON -> ABAP (unknown type) ----------` ).
+ out->write( dref->* ).
+ ENDIF.
+
+ IF dref_xstr IS BOUND.
+ out->write( `---------- JSON (xstring) -> ABAP (unknown type) ----------` ).
+ out->write( dref_xstr->* ).
+ ENDIF.
+ ENDMETHOD.
+ENDCLASS.
+```
+
+
+
⬆️ back to top
## Excursions
@@ -952,6 +1364,8 @@ DATA(is_equal) = COND #( WHEN len_xstr = len_xstr_decomp
- [ABAP and XML (main topic in the ABAP Keyword Documentation)](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenabap_xml.htm)
- [sXML](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenabap_sxml_lib.htm)
+- [iXML Library for ABAP Cloud](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenabap_ixml_lib_cloud.htm)
+ - [iXML Library Classic (F1 documentation for Standard ABAP)](https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abenabap_ixml_lib.htm)
- [XSLT](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenabap_xslt.htm)
- [SAP XSLT Processor Reference](https://help.sap.com/docs/ABAP_PLATFORM_NEW/31bfc625c2674acdb9aa7547b62db9cc/3cb7463c32a3fe13e10000000a114084.html)
- [ST](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenabap_st.htm)
@@ -975,7 +1389,7 @@ DATA(is_equal) = COND #( WHEN len_xstr = len_xstr_decomp
> - XML Transformations using XSLT and Simple Transformations
> - Serializations (ABAP -> XML) and Deserialization (XML -> ABAP) using the identity transformation ID (elementary types, structures, internal tables, data and object references)
> - `CALL TRANSFORMATION` syntax options, sources and targets of transformations
-> - Dealing with JSON data, XCO classes for JSON
+> - Working with JSON data, XCO classes for JSON
> - Excursions: Converting string <-> xstring, compressing and decompressing binary data
> - uses, apart from the predefined identity transformation (ID), demo XSLT and ST programs. They are not intended to be role models for proper XSLT/ST design.
> - The steps to import and run the code are outlined [here](README.md#-getting-started-with-the-examples).
diff --git a/22_Misc_ABAP_Classes.md b/22_Misc_ABAP_Classes.md
index 39d5cfc..17c451c 100644
--- a/22_Misc_ABAP_Classes.md
+++ b/22_Misc_ABAP_Classes.md
@@ -1601,6 +1601,30 @@ xco_cp_json=>data->from_string( json_created_xco )->apply( VALUE #(
"DL 1984 San Francisco New York
```
+
+
+
+ /UI2/CL_JSON |
+
+
+- Handling JSON data using the /UI2/CL_JSON class
+- Note that there are many additional and optional parameters available, some of which are explored in examples in the [Working with XML and JSON in ABAP](21_XML_JSON.md) cheat sheet.
+
+
+
+
+```abap
+DATA(some_table) = VALUE string_table( ( `aaa` ) ( `bbb` ) ( `ddd` ) ).
+
+"--------- ABAP -> Json ---------
+DATA(abap_to_json) = /ui2/cl_json=>serialize( data = some_table ).
+
+"--------- Json -> ABAP ---------
+DATA table_json_to_abap TYPE string_table.
+/ui2/cl_json=>deserialize( EXPORTING json = abap_to_json
+ CHANGING data = table_json_to_abap ).
+```
+
|