<?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: Unicode to text format in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/unicode-to-text-format/m-p/2882974#M677199</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are able to identify exactly where the unicode/non-unicode are, you just have to use 2 or 3 objects, see here first the 3 abap oo classes: &lt;A href="http://help.sap.com/saphelp_nw70/helpdata/en/79/c554afb3dc11d5993800508b6b8b11/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw70/helpdata/en/79/c554afb3dc11d5993800508b6b8b11/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then look at the class documentation in SE24 transaction for these 3 classes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF YOU WANT TO CONVERT EVERYTHING IN abap characters (TYPE C), you have to do it this way:&lt;/P&gt;&lt;P&gt;1) convert file ascii parts (page code 1100) into abap characters&lt;/P&gt;&lt;P&gt;2) convert file unicode 16 parts (big endian? = page code 4102) into abap characters&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example which converts unicode 16 big endian x'0041' into an abap character&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  Z_UNICODE_ASCII.

  DATA e type ref to cx_root.
  DATA unicode_2_abap TYPE REF TO cl_abap_conv_in_ce.
  DATA unicode_a(2) TYPE x.
  DATA char_a(1) TYPE c.

  unicode_a = '0041'.

  TRY.
      unicode_2_abap = cl_abap_conv_in_ce=&amp;gt;create(
              encoding = '4102' "Unicode 16BE, see table TCP00
              ).
    CATCH cx_root INTO e.
      WRITE 'err'.
  ENDTRY.

* Determine letter which corresponds to X'0041'
  TRY.
      unicode_2_abap-&amp;gt;convert(
            EXPORTING input = unicode_a
            IMPORTING data  = char_a ).
    CATCH cx_root INTO e.
      WRITE 'err'.
  ENDTRY.

  write char_a.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;About how to upload, you can use CL_GUI_FRONTEND_SERVICES=&amp;gt;gui_upload. You can upload the file in binary mode (into an XSTRING variable), it will be more simple. See method documentation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 29 Sep 2007 21:16:08 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-29T21:16:08Z</dc:date>
    <item>
      <title>Unicode to text format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unicode-to-text-format/m-p/2882973#M677198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have file with mixed text format ie. normat text and Unicode text format.&lt;/P&gt;&lt;P&gt;My file extension is .txt only but having different fomats.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This file is having employees information like emp.number, grade etc in normal text format and there is one huge text field(having employee evaluation data) having text in unicode format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. How to read this text?&lt;/P&gt;&lt;P&gt;2. I would like to upload this data into tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me to find the possible scenarios.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example my file looks like this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;10 70869&lt;/P&gt;&lt;P&gt;feff005400680069007300200069007300200054006500730074002000440061007400610020006f&lt;/P&gt;&lt;P&gt;10 70887&lt;/P&gt;&lt;P&gt;feff005400680069007300200069007300200054006500730074002000440061007400610020006f&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Waiting for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 29 Sep 2007 08:49:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unicode-to-text-format/m-p/2882973#M677198</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-29T08:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: Unicode to text format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unicode-to-text-format/m-p/2882974#M677199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are able to identify exactly where the unicode/non-unicode are, you just have to use 2 or 3 objects, see here first the 3 abap oo classes: &lt;A href="http://help.sap.com/saphelp_nw70/helpdata/en/79/c554afb3dc11d5993800508b6b8b11/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw70/helpdata/en/79/c554afb3dc11d5993800508b6b8b11/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then look at the class documentation in SE24 transaction for these 3 classes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF YOU WANT TO CONVERT EVERYTHING IN abap characters (TYPE C), you have to do it this way:&lt;/P&gt;&lt;P&gt;1) convert file ascii parts (page code 1100) into abap characters&lt;/P&gt;&lt;P&gt;2) convert file unicode 16 parts (big endian? = page code 4102) into abap characters&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example which converts unicode 16 big endian x'0041' into an abap character&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  Z_UNICODE_ASCII.

  DATA e type ref to cx_root.
  DATA unicode_2_abap TYPE REF TO cl_abap_conv_in_ce.
  DATA unicode_a(2) TYPE x.
  DATA char_a(1) TYPE c.

  unicode_a = '0041'.

  TRY.
      unicode_2_abap = cl_abap_conv_in_ce=&amp;gt;create(
              encoding = '4102' "Unicode 16BE, see table TCP00
              ).
    CATCH cx_root INTO e.
      WRITE 'err'.
  ENDTRY.

* Determine letter which corresponds to X'0041'
  TRY.
      unicode_2_abap-&amp;gt;convert(
            EXPORTING input = unicode_a
            IMPORTING data  = char_a ).
    CATCH cx_root INTO e.
      WRITE 'err'.
  ENDTRY.

  write char_a.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;About how to upload, you can use CL_GUI_FRONTEND_SERVICES=&amp;gt;gui_upload. You can upload the file in binary mode (into an XSTRING variable), it will be more simple. See method documentation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 29 Sep 2007 21:16:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unicode-to-text-format/m-p/2882974#M677199</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-29T21:16:08Z</dc:date>
    </item>
  </channel>
</rss>

