<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Write a data into a file in UTF-16 format in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/write-a-data-into-a-file-in-utf-16-format/m-p/6489670#M1420163</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can convert the data with these objects&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CL_ABAP_CONV_OUT_CE            Code Page and Endian Conversion (System Format -&amp;gt; External&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
      TRY.
            CALL METHOD cl_abap_conv_out_ce=&amp;gt;create
              EXPORTING
                encoding = 'UTF-16'
              RECEIVING
                conv     = yourstring_sap.

*         get result
          CALL METHOD l_convout-&amp;gt;get_buffer
            RECEIVING
              buffer = yourbinarystring_utf16

        CATCH cx_root.
* Your error handling
* Check if you have an error and UTF-16 realy works
      ENDTRY.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then write the data binary in a file the same way only as binary&lt;/P&gt;&lt;P&gt;Rene&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code Formatted by: Alvaro Tejada Galindo on Jan 4, 2010 5:38 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 31 Dec 2009 01:47:00 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-12-31T01:47:00Z</dc:date>
    <item>
      <title>Write a data into a file in UTF-16 format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/write-a-data-into-a-file-in-utf-16-format/m-p/6489669#M1420162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to create a datafile in UTF-16 format.&lt;/P&gt;&lt;P&gt;OPEN DATASET does not support a UTF-16 format.&lt;/P&gt;&lt;P&gt;How can i create a file in such a format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.....&lt;/P&gt;&lt;P&gt;fract&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Dec 2009 01:13:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/write-a-data-into-a-file-in-utf-16-format/m-p/6489669#M1420162</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-31T01:13:25Z</dc:date>
    </item>
    <item>
      <title>Re: Write a data into a file in UTF-16 format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/write-a-data-into-a-file-in-utf-16-format/m-p/6489670#M1420163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can convert the data with these objects&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CL_ABAP_CONV_OUT_CE            Code Page and Endian Conversion (System Format -&amp;gt; External&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
      TRY.
            CALL METHOD cl_abap_conv_out_ce=&amp;gt;create
              EXPORTING
                encoding = 'UTF-16'
              RECEIVING
                conv     = yourstring_sap.

*         get result
          CALL METHOD l_convout-&amp;gt;get_buffer
            RECEIVING
              buffer = yourbinarystring_utf16

        CATCH cx_root.
* Your error handling
* Check if you have an error and UTF-16 realy works
      ENDTRY.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then write the data binary in a file the same way only as binary&lt;/P&gt;&lt;P&gt;Rene&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code Formatted by: Alvaro Tejada Galindo on Jan 4, 2010 5:38 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Dec 2009 01:47:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/write-a-data-into-a-file-in-utf-16-format/m-p/6489670#M1420163</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-31T01:47:00Z</dc:date>
    </item>
    <item>
      <title>Re: Write a data into a file in UTF-16 format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/write-a-data-into-a-file-in-utf-16-format/m-p/6489671#M1420164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OPEN DATASET will support but a UTF-16 file can only be opened as a binary file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/abapdocu_70/en/ABAPOPEN_DATASET_MODE.htm#!ABAP_ALTERNATIVE_3@3@" target="test_blank"&gt;http://help.sap.com/abapdocu_70/en/ABAPOPEN_DATASET_MODE.htm#!ABAP_ALTERNATIVE_3@3@&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Dec 2009 04:09:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/write-a-data-into-a-file-in-utf-16-format/m-p/6489671#M1420164</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2009-12-31T04:09:50Z</dc:date>
    </item>
    <item>
      <title>Re: Write a data into a file in UTF-16 format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/write-a-data-into-a-file-in-utf-16-format/m-p/6489672#M1420165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am extracting data from Japanese system and i want to write that data into a file in UTF-16 LITTLE ENDIAN format .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do i need to use Code Page with LITTLE ENDIAN or LITTLE ENDIAN is enough or both?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN DATASET V_FILE FOR OUTPUT IN LEGACY BINARY MODE LITTLE ENDIAN CODE PAGE '4103'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;fract&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Dec 2009 05:53:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/write-a-data-into-a-file-in-utf-16-format/m-p/6489672#M1420165</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-31T05:53:40Z</dc:date>
    </item>
    <item>
      <title>Re: Write a data into a file in UTF-16 format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/write-a-data-into-a-file-in-utf-16-format/m-p/6489673#M1420166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Only CODEPAGE is necessary&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
OPEN DATASET V_FILE FOR OUTPUT IN LEGACY BINARY MODE CODE PAGE '4103'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Dec 2009 06:02:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/write-a-data-into-a-file-in-utf-16-format/m-p/6489673#M1420166</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2009-12-31T06:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: Write a data into a file in UTF-16 format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/write-a-data-into-a-file-in-utf-16-format/m-p/6489674#M1420167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am getting this short dump. Where is the problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Runtime Errors         CONVT_CODEPAGE_INIT&lt;/P&gt;&lt;P&gt;Except.                CX_SY_CODEPAGE_CONVERTER_INIT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Short text&lt;/P&gt;&lt;P&gt;    The conversion of certain code pages is not supported.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What happened?&lt;/P&gt;&lt;P&gt;    The conversion of texts in code page '4103' to code page '4103' is not&lt;/P&gt;&lt;P&gt;    supported here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An exception occurred that is explained in detail below.&lt;/P&gt;&lt;P&gt;The exception, which is assigned to class 'CX_SY_CODEPAGE_CONVERTER_INIT', was&lt;/P&gt;&lt;P&gt; not caught in procedure "DOWNLOAD_DATA" "(FORM)", nor was it propagated by a&lt;/P&gt;&lt;P&gt; RAISING clause.&lt;/P&gt;&lt;P&gt;Since the caller of the procedure could not have anticipated that the&lt;/P&gt;&lt;P&gt;exception would occur, the current program is terminated.&lt;/P&gt;&lt;P&gt;The reason for the exception is:&lt;/P&gt;&lt;P&gt;Possibly, one of the codepages '4103' or '4103' - needed for the&lt;/P&gt;&lt;P&gt;conversion - is unknown to the system. Another option is, that a Unicode&lt;/P&gt;&lt;P&gt; codepage was specified for a file in LEGACY MODE, which is not allowed.&lt;/P&gt;&lt;P&gt;Additional parameters for the codepage conversion (as , for example, the&lt;/P&gt;&lt;P&gt; replacement character) might have invalid values. You can find further&lt;/P&gt;&lt;P&gt;information under 'Inernal notes'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the problem occurred at opening, reading, or writing of a file, then&lt;/P&gt;&lt;P&gt;the file name was '&lt;BR /&gt;SAPT01\DATA\DEV\t001-20091231.dat'. (Further&lt;/P&gt;&lt;P&gt; information about this file: " 쬞")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;     OPEN DATASET V_FILE FOR OUTPUT IN LEGACY BINARY MODE CODE PAGE '4103'.
   IF SY-SUBRC NE 0.
     CONCATENATE 'File open error' V_FILE INTO WA_ERR_LOG.
    ENDIF.
 
 CLEAR WA_DATA.
    LOOP AT ITAB INTO WA_DATA.
 
     TRANSFER WA_DATA TO V_FILE.
    ENDLOOP.
    CLOSE DATASET V_FILE.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Dec 2009 06:54:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/write-a-data-into-a-file-in-utf-16-format/m-p/6489674#M1420167</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-31T06:54:15Z</dc:date>
    </item>
    <item>
      <title>Re: Write a data into a file in UTF-16 format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/write-a-data-into-a-file-in-utf-16-format/m-p/6489675#M1420168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try with the addition IGNORING CONVERSION ERRORS with the OPEN DATASET statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
OPEN DATASET V_FILE FOR OUTPUT IN LEGACY BINARY MODE CODE PAGE '4103' IGNORING CONVERSION ERRORS.
   IF SY-SUBRC NE 0.
     CONCATENATE 'File open error' V_FILE INTO WA_ERR_LOG.
    ENDIF.
 
 CLEAR WA_DATA.
    LOOP AT ITAB INTO WA_DATA.
 
     TRANSFER WA_DATA TO V_FILE.
    ENDLOOP.
    CLOSE DATASET V_FILE.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vikranth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Dec 2009 07:27:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/write-a-data-into-a-file-in-utf-16-format/m-p/6489675#M1420168</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-31T07:27:18Z</dc:date>
    </item>
    <item>
      <title>Re: Write a data into a file in UTF-16 format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/write-a-data-into-a-file-in-utf-16-format/m-p/6489676#M1420169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried with the following statement but same short dump.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;OPEN DATASET V_FILE FOR OUTPUT IN LEGACY BINARY MODE CODE PAGE '4103' IGNORING CONVERSION ERRORS.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Dec 2009 07:34:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/write-a-data-into-a-file-in-utf-16-format/m-p/6489676#M1420169</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-31T07:34:05Z</dc:date>
    </item>
    <item>
      <title>Re: Write a data into a file in UTF-16 format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/write-a-data-into-a-file-in-utf-16-format/m-p/6489677#M1420170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your shortdump looks to me as your system uses 4103 code page and therefor a conversion is not needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you write directly in text mode this should be fine. If this is not what you want;  try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;open DATASET vfile for OUTPUT in LEGACY TEXT MODE BIG ENDIAN CODE PAGE '4103'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Happy new year.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Dec 2009 18:00:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/write-a-data-into-a-file-in-utf-16-format/m-p/6489677#M1420170</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-31T18:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: Write a data into a file in UTF-16 format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/write-a-data-into-a-file-in-utf-16-format/m-p/6489678#M1420171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried but still short dump. Is there any other solutions....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Jan 2010 19:53:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/write-a-data-into-a-file-in-utf-16-format/m-p/6489678#M1420171</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-05T19:53:37Z</dc:date>
    </item>
    <item>
      <title>Re: Write a data into a file in UTF-16 format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/write-a-data-into-a-file-in-utf-16-format/m-p/6489679#M1420172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So if the short dump is the same, this emans you are in a 4103 encoded system?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is your default codepage?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jan 2010 00:02:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/write-a-data-into-a-file-in-utf-16-format/m-p/6489679#M1420172</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-06T00:02:49Z</dc:date>
    </item>
    <item>
      <title>Re: Write a data into a file in UTF-16 format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/write-a-data-into-a-file-in-utf-16-format/m-p/6489680#M1420173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can also check if 4103 is even an option in your system.&lt;/P&gt;&lt;P&gt;Use transaction SCP to see what is there.&lt;/P&gt;&lt;P&gt;Rene&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jan 2010 00:04:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/write-a-data-into-a-file-in-utf-16-format/m-p/6489680#M1420173</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-06T00:04:34Z</dc:date>
    </item>
  </channel>
</rss>

