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

call transformation encoding

Former Member
0 Likes
719

Dear all,

this is my code, generated xml file header like this " <?xml version="1.0" encoding="utf-8"?> "

and the Actual Encoding is 'ANSI as UTF-8' too, but at the end of the file, there are many 'nul', more detail in the attachment

the file cannot recognized by ie or chrome and some xml editor

if i delete the 'nul', it is exactly correct


DATA: x_xml TYPE xstring,

         lt_xml TYPE solix_tab .

   CALL TRANSFORMATION zst02

   SOURCE root = gt_mara[]

   RESULT XML x_xml.

   CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'

     EXPORTING

       buffer     = x_xml

     TABLES

       binary_tab = lt_xml.

   CALL FUNCTION 'GUI_DOWNLOAD'

     EXPORTING

       filename   = 'c:\xmlcal-3.xml'

     IMPORTING

       filelength = w_len

     TABLES

       data_tab   = lt_xml.


if call method  l_con->xstring_to_string translate xstring to string

then, call func 'SCMS_STRING_TO_FTEXT'

then, download the file using 'gui_download'

the xml file header like this " <?xml version="1.0" encoding="utf-8"?> "

but the actual encoding is UCS-2


1 REPLY 1
Read only

Former Member
0 Likes
510

solved! bin_filesize