04-12-2013 5:23 PM
Hi everyone,
I'm developing a trasformation to deserialize an XML file into ABAP data. The problem is that the sequence of the tag into my XML files is not always the same.
e.g. the XML could be:
<X1>value</X1>
<X2>value2</X2>
but also:
<X2>value</X2>
<X1>value2</X1>
I developed the transformation using the <tt.group> tag and it works.
In this way I have to read all the xml tag, because if I use the <tt:skip> the program loose its "sequence-independent" attribute.
Someone knows how I could create a transformation for undefined XML tag sequence and at the same time skip the value I don't want to read?
Thank you
04-13-2013 7:08 AM
Hi,
I worked on similar requirement.I converted internal table to XML by using FM
***Converting internal table to XML format
CALL TRANSFORMATION ('ID')
SOURCE header = wa_header.
RESULT XML xml_out.
XML_OUT is of type string.
I am replacing the text in XML_OUT by using Replace Statement.
REPLACE '<SCHI>' IN xml_out WITH 'XYZZZZZZ'.
In your case also you can proceed in similar manner.You can also replace unwanted thing by
replace <xxxxx> in xml_out with ' ' .