[ABAP] String -> XML

DATA: text TYPE string VALUE 'Hello world!'.

* ABAP (string) -> XML
DATA(o_writer_xml) = cl_sxml_string_writer=>create( if_sxml=>co_xt_xml10 ).
CALL TRANSFORMATION id SOURCE text = text RESULT XML o_writer_xml.
DATA(xml) = cl_abap_codepage=>convert_from( o_writer_xml->get_output( ) ).

WRITE: / xml.

Kommentare sind geschlossen.