Skip to Content
author's profile photo Former Member
Former Member

XML conversion not happening correctly

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Sep 08, 2009 at 07:13 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 09, 2009 at 07:10 AM

    You could use CL_HTTP_UTILITY method ESCAPE_URL and UNESCAPE_URL.

    Peter

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 09, 2009 at 07:43 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.