‎2015 Jun 24 8:21 AM
Hi,
I am able to read XML file stored in application server into internal table using cl_xml_document class.
but I am stuck with the requirement that the fields of XML files will be dynamic. There is no fix no. of fields as files will be coming from different types of interfaces. for those have to create a single dynamic internal table whose structure is unknown and data will be in tabular format.
I have never used transformation before. I am wondering whether a ABAP logic will work for the requirement or a transformation will be required ?
Quick help will be appreciated.
Regards,
Manoj
‎2015 Jul 23 8:49 AM
Hi Manoj,
I have worked for single structure fileds to generate an xml using transformation and reading it using cl_xml_document.
here you are telling about the data is coming from different interfaces and which are not fixed structures.
Here i can suggest you that you can make use field symbols as well.
Reagards,
Hiriyappa.
‎2015 Aug 24 12:57 PM
Good question. I tried several things but i do not think a dynamic XML -> ABAP table is possible.
My idea was to read the XML and use a parser to find the attributes which are relevant.
‎2015 Aug 24 1:19 PM
Hi Manjo,
do you have at least some control over the structure of the XML document or are these document completely different without any prior knowledge of the structure?
If you have at least some control of the structure I'd suspect that it should be possible to write a simple transformational to convert the different XML formats into ABAP data (http://help.sap.com/abapdocu_70/en/ABENABAP_ST.htm).
If you don't have any control I guess you will need to manually parse the XML file using the ABAP XML classes (ABAP Class Library for XML) and build the result structure depending on the tags you find.
Christian