Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

[ABAP to XML] Solving duplicated XML headers

Former Member
0 Likes
451

Hello Experts

I am new to ABAP development and I am experimenting with XSLT transformations. Particularly, I am developing a report for an "inside-out job" specifically transforming data within an internal table to a XML file.

To do so, I decided to resort to the following one:

CALL TRANSFORMATION ZPW_DIRECT

            SOURCE (lt_data)

            RESULT XML z_salva

            OPTIONS XML_HEADER = 'no'.

I created "ZPW_DIRECT" like the following one:

<?sap.transform simple?>

<tt:transform xmlns:tt="http://www.sap.com/transformation-templates">

<tt:root name="FIRST_NAME"  type="?" />

<tt:root name="LAST_NAME" type="?" />

<tt:root name="MEMB_ID" type="?" />

<tt:root name="VALUE" type="?" />

<tt:template>

<DATA>

<FN_CT_NAME>

<tt:value ref="FIRST_NAME" />

</FN_CT_NAME>

<LN_CT_SURNAME>

<tt:value ref="LAST_NAME"/>

</LN_CT_SURNAME>

<CT_SHOPPING_CARD_CODE>

<tt:value ref="MEMB_ID"/>

</CT_SHOPPING_CARD_CODE>

<TOTAL_POINTS>

<tt:value ref="VALUE"/>

</TOTAL_POINTS>

  </DATA>

</tt:template>

</tt:transform>


I manage to achieve a XML output file without errors, however if I do not use the XML_HEADER='NO'  I get duplicated  xml header on both begging and ending of tags.

Anyone has experienced such annoying issue and solved ?

Thank you

Hello Experts

I am new to ABAP development and I am experimenting with XSLT transformations. Particularly, I am developing a report for an "inside-out job" specifically transforming data within an internal table to a XML file.

To do so, I decided to resort to the following one:

CALL TRANSFORMATION ZPW_DIRECT

            SOURCE (lt_data)

            RESULT XML z_salva

            OPTIONS XML_HEADER = 'no'.

I created "ZPW_DIRECT" like the following one:

<?sap.transform simple?>

<tt:transform xmlns:tt="http://www.sap.com/transformation-templates">

<tt:root name="FIRST_NAME"  type="?" />

<tt:root name="LAST_NAME" type="?" />

<tt:root name="MEMB_ID" type="?" />

<tt:root name="VALUE" type="?" />

<tt:template>

<DATA>

<FN_CT_NAME>

<tt:value ref="FIRST_NAME" />

</FN_CT_NAME>

<LN_CT_SURNAME>

<tt:value ref="LAST_NAME"/>

</LN_CT_SURNAME>

<CT_SHOPPING_CARD_CODE>

<tt:value ref="MEMB_ID"/>

</CT_SHOPPING_CARD_CODE>

<TOTAL_POINTS>

<tt:value ref="VALUE"/>

</TOTAL_POINTS>

  </DATA>

</tt:template>

</tt:transform>


I manage to achieve a XML output file without errors, however if I do not use the XML_HEADER='NO'  I get duplicated  xml header on both begging and ending of tags.

Anyone has experienced such annoying issue and solved ?

Thank you

1 REPLY 1
Read only

Former Member
0 Likes
363

Solved,  pm for help.