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

Displaying XML file from Simple Transformation

Former Member
0 Likes
1,238

Hi All,

I have an ABAP internal table, which I have converted to XML format using a Simple Transformation. Now I have the XML data in a string variable. How do I display this XML data from the string variable, into an XML file with proper formatting and indentation? I searched a lot in SDN, but didn't find an appropriate answer.

Right now, my XML string variable looks like:

<datarow><ccode>1000</ccode><type>01</type></datarow>

I need to display this as an XML file, with proper indentation, which should be downloaded to the presentation server:

<datarow>

<ccode>1000</ccode>

<type>01</type>

</datarow>

Please help with the same.

Thank you in advance.

Vidya.

Hi All,

I have an ABAP internal table, which I have converted to XML format using a Simple Transformation. Now I have the XML data in a string variable. How do I display this XML data from the string variable, into an XML file with proper formatting and indentation? I searched a lot in SDN, but didn't find an appropriate answer.

Right now, my XML string variable looks like:

<datarow><ccode>1000</ccode><type>01</type></datarow>

I need to display this as an XML file, with proper indentation, which should be downloaded to the presentation server:

<datarow>

<ccode>1000</ccode>

<type>01</type>

</datarow>

Please help with the same.

Thank you in advance.

Vidya.

3 REPLIES 3
Read only

Former Member
0 Likes
901

Hi,

Try using this FM DISPLAY_XML_STRING.

Regards,

Lakshman.

Read only

0 Likes
901

Hi Lakshman,

Thank you for your response...I am able to view the file in the correct format. However, I need this file in a downloadable manner, so that I may download the file on to the presentation server. Would you be able to help in that?

Thank you and Warm Regards,

Vidya.

Read only

0 Likes
901

Hi Lakshman,

Instead of calling DISPLAY_XML_STRING, I directly called the PARSE_XSTRING method of CL_XML_DOCUMENT_BASE. Then I called method EXPORT_TO_FILE, which then displays the file in the location specified.

Thanks for leading me in the right direction.

Vidya.