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

Create XML File with codepage (not UNICODE)

Former Member
0 Likes
1,389

Hi all ,

I'm using the SDIXML_DATA_TO_DOM function module to create a xml format from an internal table, finally I write the internal table in xml format to file in the application server.

Finally I get a file in XML format in UTF-8 (UNICODE), but I have to convert the UTF-8 into other codepage because the file is send to other system which not familiar with the UNICODE.

Does anyone knows how to convert the codepage for the xml internal table ?

Thanks,

Yaki

4 REPLIES 4
Read only

athavanraja
Active Contributor
0 Likes
760

Hi,

check out Thomas's weblog on <b>BSP Download to Excel in Unicode Format</b> at

/people/thomas.jung3/blog/2004/08/09/bsp-download-to-excel-in-unicode-format

In there he had talked about converting the codepage.

Regards

Raja

Read only

thomas_jung
Developer Advocate
Developer Advocate
0 Likes
760

Another option rather than converting it after the fact is to have it create the XML file in the encoding that you want to begin with. It looks like this function module you mention will either accept a pointer to a XML document object or create one for you. I would suggest that you go ahead and create a document yourself and pass it to the function module.


  ixml = cl_ixml=>create( ).
  document = ixml->create_document( ).

You can then call the method SET_ENCODING of the class IF_IXML_DOCUMENT. The encoding itself is another class of type IF_IXML_ENCODING. You can set the character set in this object using method SET_CHARACTER_SET.

Read only

0 Likes
760

Hi Jung,

You have told that

"You can then call the method SET_ENCODING of the class IF_IXML_DOCUMENT. The encoding itself is another class of type IF_IXML_ENCODING. You can set the character set in this object using method SET_CHARACTER_SET."

Can you please give the code how to do this because i tried this in ABAP Mapping used in XI which converts Idoc XML to Idoc flat file. Chinese characters are getting replaced with # after the ABAP Mapping.

Regards,

Dinakar

Read only

miko2
Explorer
0 Likes
760

Same problem after upgrade to EHP6