Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

ABAP Mapping Questions

Hi,

I am trying to get my head around ABAP mappings and have a few questions.

In the below code sample which I find in every example and blog it talks about specific steps -

*initialize iXML, * create iXML factory object, * create streamfactory object, * create input stream object, * initialize the input xml document, * parse the input xml document

In these steps the code is always exactly the same so my question is are these just standard steps that are implemented every single time an abap mapping is used and hence only standard lines that never have to be changed or will they be different depending on the mapping.

I am trying to work out where I will begin my coding.

So would somebody be so kind as to give me a brief explanation of the above mentioned steps.

Thank you


METHOD if_mapping~execute.
* initialize iXML
  TYPE-POOLS: ixml.
  CLASS cl_ixml DEFINITION LOAD.

* create iXML factory object
  DATA: ixmlfactory TYPE REF TO if_ixml.
  ixmlfactory = cl_ixml=>create( ).

* create streamfactory object 
  DATA: streamfactory TYPE REF TO
  if_ixml_stream_factory.
  streamfactory = ixmlfactory->create_stream_factory( ).

* create input stream object 
  DATA: istream TYPE REF TO if_ixml_istream.
  istream = streamfactory->create_istream_xstring( source ).

* initialize the input xml document
  DATA: idocument TYPE REF TO if_ixml_document.
  idocument = ixmlfactory->create_document( ).

* parse the input xml document 
  DATA: iparser TYPE REF TO if_ixml_parser.
  iparser = ixmlfactory->create_parser(
  stream_factory = streamfactory
  istream = istream
  document = idocument ).
  iparser->parse( ).


Former Member
Not what you were looking for? View more on this topic or Ask a question