Application Development 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: 

XML conversion not happening correctly

Former Member
0 Kudos

Hi ,

I'm using method create_text in interface IF_IXML_DOCUMENT to convert the SAP data for sales orders into a XML file.

The problem i'm facing is when there are special characters in these texts like & ,<,>,lt etc... it is not converting into correct format.

For eg, if Material type is MAT&1 this method is returning MAT&amp .

similarly for other charaters .

any idea how to resolve it, would be very help full.

any OSS notes that needs to be applied .

Thanks

Raghavendra

3 REPLIES 3

former_member218674
Contributor
0 Kudos

Hello Raghavendra,

Use identical transformation if your need is to simply transform data to xml as follows:



DATA itab TYPE TABLE OF ....

DATA xml_string TYPE string.

* Select data into ITAB....

CALL TRANSFORMATION ID
             SOURCE ITAB = ITAB[]
             RESULT XML xml_string.

Hope this helps!

Thanks,

Augustin.

Peter_Inotai
Active Contributor
0 Kudos

You could use CL_HTTP_UTILITY method ESCAPE_URL and UNESCAPE_URL.

Peter

former_member190389
Active Contributor
0 Kudos

Hi,

In XML the value & gets converted to & amp ; < to & lt ; and > to & gt ; which is correct.

Why do you want it to be &?

When you view the file using Internet Explorer it will correctly show up as & and not & amp ;

Edited by: Progirl Progirl on Sep 9, 2009 1:13 PM