‎2015 Nov 12 3:19 PM
Hi people,
I have a deep structure whose components are of type CString and P and need to serialize it into a XSTRING variable.
All approaches and FMs I found only work with flat and char-like structures.
Of couse I could loop at all components of the structure and use ASSIGN COMPONENT to access all individual values and convert each value on my own. However, due to performance reasons I am looking for a built-in ABAP functionality that provides the binary representation of such a structure.
Any ideas?
Thanks!
Marco
‎2015 Nov 12 4:13 PM
Hi Marco,
Did you try to serialize your data to JSON using something like this:
DATA:
lo_json_writer TYPE REF TO cl_sxml_string_writer.
lo_json_writer = cl_sxml_string_writer=>create(
type = if_sxml=>co_xt_json ).
TRY.
CALL TRANSFORMATION id
SOURCE tab = it_table[]
RESULT XML lo_json_writer.
CATCH cx_root.
CLEAR ev_xjson.
RETURN.
ENDTRY.
CALL METHOD lo_json_writer->get_output
RECEIVING
output = ev_xjson.
FREE lo_json_writer.
KS
‎2015 Nov 12 8:40 PM
Hi Kirill,
thanks for your suggestion.
Yes I tried that approach already. However, in case of huge data volumes JSON is not efficient enough as exchange format between systems. For this purpose I am looking for a possibiltiy to transfer data on a binary level.
Best,
Marco