Skip to Content
Mar 10, 2010 at 08:57 PM

Simple Transformation serialization - XML has sorted attributes


Hello. I am trying to call a Simple transformation (serialization (internal table to XML)) process from an ABAP program and the resulting XML has the attributes sorted.

My question is: If I need the XML output to have a certain order to the attributes - how do I remove the sorting ?

ABAP program has this table defined:

data: begin of wa_final_xml,

act type string,

col1 type string,

col2 type string,

col10 type string,

end of wa_final_xml.

The Simple transformation mapping is like this:

<?sap.transform simple?>">

<tt:root name="T_FINAL_XML"/>


<tt:loop ref="T_FINAL_XML">


<tt:attribute name="action" value-ref="ACT"/>

<tt:attribute name="column1" value-ref="COL1"/>

<tt:attribute name="column2" value-ref="COL2"/>

<tt:attribute name="column10" value-ref="COL10"/>





The XML output is below (as you can see the attribute column10 is before column2. I need column2 to be before column10).

<z:row action="1" column1="Dept1" column10="changed on 03-09-2010" column2="UC01"/>

<z:row action="1" column1="Dept2" column10="changed on 03-09-2010" column2="UC02"/>

Help would be appreciated.

Thanks, Michelle