Skip to Content
-2

ENCODING XML

I am generating xml file from 'CALL TRANSFORMATION' and it is generating with 'UTF-16' encoding method but to transfer this file to FTP server , When i Convert String to XString using 'SCMS_STRING _TO_XSTRING' then this function module converting data in 'UTF-8'and adding a special character in start of string .

I required data in 'UTF-16', So Please help

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Oct 23, 2017 at 08:11 AM

    Why do you transform to string and not to xstring? Why are you using the undocumented function module SCMS_STRING_TO_XSTRING which is part of a special framework and not the general system method CL_ABAP_CODEPAGE=>CONVERT_TO?

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 23, 2017 at 07:00 AM

    No, SCMS_STRING _TO_XSTRING does not add "a special character in start of string" (I would call it a "BOM" as it's about UTF but here it seems to be a different thing), or is there a bug in a given ABAP release. Which one are you using?

    Which transformation are you using? ID or a custom one?

    Could you tell again if you want UTF-8 or UTF-16 in your ABAP program? Which encoding or mime type are you using while calling SCMS_STRING_TO_XSTRING?

    Moreover, if you generate the file in your abap program with the right target code page, make sure you transfer in BIN mode.

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 24, 2017 at 01:57 PM

    Why don't you transform into an object of CL_SXML_STRING_WRITER, created with encoding UTF-16, and get from there an XSTRING?

    Add comment
    10|10000 characters needed characters exceeded