<?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: open dataset encoding UTF-8 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-encoding-utf-8/m-p/6453095#M1414159</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check this link&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;link:[http://help.sap.com/saphelp_NW70EHP1/helpdata/en/79/c554dcb3dc11d5993800508b6b8b11/content.htm]&lt;/P&gt;&lt;P&gt;link:[BYTE-ORDER MARK|http://help.sap.com/abapdocu_70/en/ABAPOPEN_DATASET_ENCODING.htm]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Jan 2010 08:50:15 GMT</pubDate>
    <dc:creator>kesavadas_thekkillath</dc:creator>
    <dc:date>2010-01-20T08:50:15Z</dc:date>
    <item>
      <title>open dataset encoding UTF-8</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-encoding-utf-8/m-p/6453094#M1414158</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have developed an extract program which extracts a space separated text file to the application server and this file is picked by another schedule job from the operating system and posted to our SFTP site. The problem which I have is when our partners try to open the file in Notepad++ they are seeing a u201Cnullu201D character in the middle of all the fields. I have solved the issue by manually changing the format of the file to UFT-8 format and it works fine. When I tried to do the same electronically I could not able to achieve it, I donu2019t understand why? Could someone help me with the code below?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Open output file.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  OPEN DATASET wf_file FOR OUTPUT IN TEXT MODE ENCODING UTF-8.MESSAGE wf_msg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the code I am using to extract a file with UTF-8 format but the file is in ANSI format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Pradeep&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jan 2010 08:25:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-encoding-utf-8/m-p/6453094#M1414158</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-20T08:25:20Z</dc:date>
    </item>
    <item>
      <title>Re: open dataset encoding UTF-8</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-encoding-utf-8/m-p/6453095#M1414159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check this link&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;link:[http://help.sap.com/saphelp_NW70EHP1/helpdata/en/79/c554dcb3dc11d5993800508b6b8b11/content.htm]&lt;/P&gt;&lt;P&gt;link:[BYTE-ORDER MARK|http://help.sap.com/abapdocu_70/en/ABAPOPEN_DATASET_ENCODING.htm]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jan 2010 08:50:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-encoding-utf-8/m-p/6453095#M1414159</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2010-01-20T08:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: open dataset encoding UTF-8</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-encoding-utf-8/m-p/6453096#M1414160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am sorry! I cannot find answers from your reply. Thanks for trying.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jan 2010 10:19:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-encoding-utf-8/m-p/6453096#M1414160</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-20T10:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: open dataset encoding UTF-8</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-encoding-utf-8/m-p/6453097#M1414161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try this one&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; OPEN DATASET gv_file FOR INPUT IN TEXT MODE ENCODING &lt;STRONG&gt;NON-UNICODE&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;                            WITH SMART LINEFEED.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jan 2010 12:33:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-encoding-utf-8/m-p/6453097#M1414161</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-20T12:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: open dataset encoding UTF-8</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-encoding-utf-8/m-p/6453098#M1414162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just to be clear about my issue, I am extracting a file to the Application server with space in-between fields not a linefeed. I want the file to be extracted in UFT-8 format not in ANSI. That's my requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope you have understood.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jan 2010 12:41:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-encoding-utf-8/m-p/6453098#M1414162</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-20T12:41:13Z</dc:date>
    </item>
    <item>
      <title>Re: open dataset encoding UTF-8</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-encoding-utf-8/m-p/6453099#M1414163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;have you try this code OPEN DATASET gv_file FOR INPUT IN TEXT MODE ENCODING &lt;STRONG&gt;NON-UNICODE&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;first try and then give reply, this is for UTF-8 format onlyy...........&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jan 2010 12:46:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-encoding-utf-8/m-p/6453099#M1414163</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-20T12:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: open dataset encoding UTF-8</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-encoding-utf-8/m-p/6453100#M1414164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This link:[Download File in UTF-8 encoding |http://wiki.sdn.sap.com/wiki/display/ABAP/Download&lt;EM&gt;File&lt;/EM&gt;in&lt;EM&gt;UTF-8&lt;/EM&gt;encoding]says how to download in presentation server.&lt;/P&gt;&lt;P&gt;Jus add BOM in front of the first record.&lt;/P&gt;&lt;P&gt;Follow the same method and add it in your code.&lt;/P&gt;&lt;P&gt;Its clearly mentioned in the link i provided.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jan 2010 12:48:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-encoding-utf-8/m-p/6453100#M1414164</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2010-01-20T12:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: open dataset encoding UTF-8</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-encoding-utf-8/m-p/6453101#M1414165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Chenna,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am 200% sure that to write to a file I have to use FOR OUTPUT in the syntax and non-Unicode means "Characters are represented in the file in the code page defined by the text environment current at the time a READ or TRANSFER command is executedu201D. Therefore I Kindly requests you to, not to waste your time and mine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jan 2010 14:25:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-encoding-utf-8/m-p/6453101#M1414165</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-20T14:25:26Z</dc:date>
    </item>
    <item>
      <title>Re: open dataset encoding UTF-8</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-encoding-utf-8/m-p/6453102#M1414166</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 solved the same problem reading the responses above but looking for the appropriate tools &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use the converter object but for output format : cl_abap_conv_out_ce.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code should look like this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA : lo_conv      TYPE REF TO cl_abap_conv_out_ce,
             lv_xstring   TYPE xstring.

* Encoding format
lo_conv = cl_abap_conv_out_ce=&amp;gt;create( encoding  = 'UTF-8' ).

TRY. "For BOM if needed
        lo_conv-&amp;gt;write( EXPORTING data   = cl_abap_char_utilities=&amp;gt;byte_order_mark_utf8 ).
    CATCH cx_sy_codepage_converter_init .
    CATCH cx_sy_conversion_codepage .
    CATCH cx_parameter_invalid_type .
    CATCH cx_parameter_invalid_range .
ENDTRY.

*here data is a string table but you can use structure with another method
LOOP AT data_table  INTO data_line.
    TRY.
          lo_conv-&amp;gt;write( EXPORTING data   = data_line ).
        CATCH cx_sy_codepage_converter_init .
        CATCH cx_sy_conversion_codepage .
        CATCH cx_parameter_invalid_type .
        CATCH cx_parameter_invalid_range .
    ENDTRY.
*   next line!
    TRY.
          lo_conv-&amp;gt;write( EXPORTING data   = cl_abap_char_utilities=&amp;gt;cr_lf ).
        CATCH cx_sy_codepage_converter_init .
        CATCH cx_sy_conversion_codepage .
        CATCH cx_parameter_invalid_type .
        CATCH cx_parameter_invalid_range .
    ENDTRY.
ENDLOOP.

*get full content in one xstring 
lv_xstring = lo_conv-&amp;gt;get_buffer( ).

* et voila!! 
OPEN DATASET lv_filename FOR OUTPUT IN BINARY MODE.
IF sy-subrc EQ 0.
  TRANSFER lv_xline TO lv_filename.
  CLOSE DATASET lv_filename.
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this help!! &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: LRookie on Feb 4, 2010 1:46 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: LRookie on Feb 5, 2010 9:41 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Feb 2010 10:57:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset-encoding-utf-8/m-p/6453102#M1414166</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-04T10:57:58Z</dc:date>
    </item>
  </channel>
</rss>

