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

Is it possible to create a uncode compliant (UTF-8) XML in 4.6C ?

Hello,

Is is possible to create a unicode compliant (UTF-8) XML document in SAP 4.6c ?.

Regards,

Jay

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 05, 2005 at 06:38 PM

    Thanks a lot Thomas.. It worked fine.

    I have another question - please let me know.

    I have to download the encoded XML file to app server. But after converting it to a table all entries are in hex format also are there any other ways to download the internal table other then dataset transfer.

    Thanks again...

    Jay

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 03, 2005 at 06:04 PM

    Yes - quite possible. Use the iXML libraries just like normal.

    However before you render the XML into the output stream (IF_IXML_OSTREAM), tell the OSTREAM that you want to use UTF-8 encoding.

    *  Encoding is type ref to IF_IXML_ENCODING.
    *  ENCODING_TYPE is a constant set to value 'UTF-8'.
      data: s_encoding_type type string.
      clear streamfactory.
      streamfactory = ixml->create_stream_factory( ).
      s_encoding_type = encoding_type.
      encoding = ixml->create_encoding( character_set = s_encoding_type
                                        byte_order = 0 ).
    * b_xml is type XSTRING
      ostream =
        streamfactory->create_ostream_xstring( b_xml ).
    
      call method ostream->set_encoding
              exporting  encoding = encoding.
      call method document->render
           exporting ostream = ostream
                     recursive = 'X'.

    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.