Skip to content

whothefluff/abap-xml-renderer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

abap-xml-renderer

ABAP variables to XML format

Use

  • Create an instance of the simple renderer (optionally passing static mappings for the names of the tags), which implements ZIF_XML_RENDERER and handles internal tables, structures, and elemental variables1:
    final(xml_renderer) = new zcl_simple_xml_renderer( ).
  • Call the process method with an XML Writer and a variable as arguments:
    final(writer) = cl_sxml_string_writer=>create( ).
    
    xml_renderer->process( i_writer = cast #( writer )
                           i_data = VAR ).
  • Use the writer as usual:
    final(encoded_xml) = writer->get_output( ).

Example

You can run class ZCL_XML_SIMPLE_RENDERER_EG_APP to see how a short XML file can be generated.

dependencies:

Footnotes

  1. You can also implement interface ZIF_XML_RENDERER yourself to create the XML file however you prefer

About

ABAP to XML

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages