WIth Releases 7.02 and 7.03/7.31 (Kernelpatch 116) JSON is supported natively in ABAP by the following features:
Example:
DATA text TYPE string VALUE `Hello JSON, I'm ABAP!`.
DATA writer TYPE REF TO cl_sxml_string_writer.
DATA json TYPE xstring.
"ABAP to JSON
writer = cl_sxml_string_writer=>create( type = if_sxml=>co_xt_json ).
CALL TRANSFORMATION id SOURCE text = text
RESULT XML writer.
json = writer->get_output( ).
"JSON to ABAP
text = `{"TEXT":"Hello ABAP, I'm JSON!"}`.
CALL TRANSFORMATION id SOURCE XML text
RESULT text = text.
Addendum
Meanwhile, the documentation for ABAP and JSON is online. This blog is pointing to it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
6 | |
5 | |
3 | |
3 | |
2 | |
2 | |
2 | |
2 | |
1 | |
1 |