My company is working on a project that needs to read XML files within ABAP.
- When the XML file has no data for a particular tag it omits that data.
- Some tags are self closing. e.g. <tag />
The SAP developer says that to read the XML document he first parses the document into an ABAP XML structure. This process fails on point 2. He must then create an XSLT to turn that data into an internal data structure, and that fails on point 1 therefore making the task very difficult to achieve within ABAP.
Is that definitely the case and is there then no way of reading the specific fields that we need?
The best place to start with XML parsing in ABAP is the SAP XML Library.
It is arguably a really bad idea to try and write your own parsing algorithm – let someone else (SAP, in this case) do the hard work for you.