<?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: Convert XSTRING to STRING conserving accented characters in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-xstring-to-string-conserving-accented-characters/m-p/6622170#M1440646</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; there is a function module 'SCMS_STRING_TO_XSTRING'.. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U can try this..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Jan 2010 11:47:14 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-01-28T11:47:14Z</dc:date>
    <item>
      <title>Convert XSTRING to STRING conserving accented characters</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-xstring-to-string-conserving-accented-characters/m-p/6622167#M1440643</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 an ITS application on an ECC 6.0 unicode system, which allows users to upload txt files.&lt;/P&gt;&lt;P&gt;In the associated ABAP program, I recuperate the content of this txt file in the form of XSTRING. I manage to convert without problem the XSTRING to a normal STRING, but I lose every accented characters (like é) in the process. I use class cl_abap_conv_in_ce to do the conversion, with encode parameter set to 'UTF-8'.&lt;/P&gt;&lt;P&gt;Do someone know if it is possible to do it properly and get all special characters ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jan 2010 10:09:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-xstring-to-string-conserving-accented-characters/m-p/6622167#M1440643</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-28T10:09:19Z</dc:date>
    </item>
    <item>
      <title>Re: Convert XSTRING to STRING conserving accented characters</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-xstring-to-string-conserving-accented-characters/m-p/6622168#M1440644</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;Take a look at this code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: file TYPE string VALUE `flights.dat`, 
      wa TYPE spfli. 

FIELD-SYMBOLS &amp;lt;hex_container&amp;gt; TYPE x. 

OPEN DATASET file FOR INPUT IN BINARY MODE. 

ASSIGN wa TO &amp;lt;hex_container&amp;gt; CASTING. 

DO. 
  READ DATASET file INTO &amp;lt;hex_container&amp;gt;. 
  IF sy-subrc = 0. 
    WRITE: / wa-carrid, 
             wa-connid, 
             wa-countryfr, 
             wa-cityfrom, 
             wa-cityto, 
             wa-fltime, 
             wa-distance. 
  ELSE. 
    EXIT. 
  ENDIF. 
ENDDO. 

CLOSE DATASET file.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ahsan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jan 2010 10:34:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-xstring-to-string-conserving-accented-characters/m-p/6622168#M1440644</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-28T10:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: Convert XSTRING to STRING conserving accented characters</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-xstring-to-string-conserving-accented-characters/m-p/6622169#M1440645</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;Can't do it like that. I receive the file as a table of raw data. Here is how it happens :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get all data and concatenate converting to byte mode&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  LOOP AT lt_raw_data INTO ls_w3mime.&lt;/P&gt;&lt;P&gt;    CONCATENATE lv_xstring ls_w3mime-line INTO lv_xstring IN BYTE MODE.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Convert byte data to character data&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  TRY.&lt;/P&gt;&lt;P&gt;      CALL METHOD cl_abap_conv_in_ce=&amp;gt;create&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          encoding = 'UTF-8'&lt;/P&gt;&lt;P&gt;          input    = lv_xstring&lt;/P&gt;&lt;P&gt;        RECEIVING&lt;/P&gt;&lt;P&gt;          conv     = lv_conv.&lt;/P&gt;&lt;P&gt;    CATCH cx_parameter_invalid_range.&lt;/P&gt;&lt;P&gt;      MESSAGE i059.&lt;/P&gt;&lt;P&gt;      EXIT.&lt;/P&gt;&lt;P&gt;    CATCH cx_sy_codepage_converter_init.&lt;/P&gt;&lt;P&gt;      MESSAGE i059.&lt;/P&gt;&lt;P&gt;      EXIT.&lt;/P&gt;&lt;P&gt;  ENDTRY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  TRY.&lt;/P&gt;&lt;P&gt;      CALL METHOD lv_conv-&amp;gt;read&lt;/P&gt;&lt;P&gt;        IMPORTING&lt;/P&gt;&lt;P&gt;          data = lv_string.&lt;/P&gt;&lt;P&gt;    CATCH cx_sy_conversion_codepage.&lt;/P&gt;&lt;P&gt;      MESSAGE i059.&lt;/P&gt;&lt;P&gt;      EXIT.&lt;/P&gt;&lt;P&gt;    CATCH cx_sy_codepage_converter_init.&lt;/P&gt;&lt;P&gt;      MESSAGE i059.&lt;/P&gt;&lt;P&gt;      EXIT.&lt;/P&gt;&lt;P&gt;    CATCH cx_parameter_invalid_type.&lt;/P&gt;&lt;P&gt;      MESSAGE i059.&lt;/P&gt;&lt;P&gt;      EXIT.&lt;/P&gt;&lt;P&gt;    CATCH cx_parameter_invalid_range.&lt;/P&gt;&lt;P&gt;      MESSAGE i059.&lt;/P&gt;&lt;P&gt;      EXIT.&lt;/P&gt;&lt;P&gt;  ENDTRY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to start from my XSTRING.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jan 2010 11:33:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-xstring-to-string-conserving-accented-characters/m-p/6622169#M1440645</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-28T11:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: Convert XSTRING to STRING conserving accented characters</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-xstring-to-string-conserving-accented-characters/m-p/6622170#M1440646</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; there is a function module 'SCMS_STRING_TO_XSTRING'.. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U can try this..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jan 2010 11:47:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-xstring-to-string-conserving-accented-characters/m-p/6622170#M1440646</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-28T11:47:14Z</dc:date>
    </item>
    <item>
      <title>Re: Convert XSTRING to STRING conserving accented characters</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-xstring-to-string-conserving-accented-characters/m-p/6622171#M1440647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have to do it the other way around, convert XSTRING to STRING, and there are no equivalent of your function for this. All functions I found were doing the conversion in the same way I do.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jan 2010 11:51:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-xstring-to-string-conserving-accented-characters/m-p/6622171#M1440647</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-28T11:51:51Z</dc:date>
    </item>
    <item>
      <title>Re: Convert XSTRING to STRING conserving accented characters</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-xstring-to-string-conserving-accented-characters/m-p/6622172#M1440648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thomas,&lt;/P&gt;&lt;P&gt;Suggest you to look for and try FM 'HR_KR_XSTRING_TO_STRING'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternatively you can also try using FM 'SCMS_XSTRING_TO_BINARY' to convert Xstring to Binary and then&lt;/P&gt;&lt;P&gt;use FM 'SCMS_BINARY_TO_STRING' to get the binary table converted to string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Damian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Sep 2010 22:27:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-xstring-to-string-conserving-accented-characters/m-p/6622172#M1440648</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-02T22:27:08Z</dc:date>
    </item>
    <item>
      <title>Re: Convert XSTRING to STRING conserving accented characters</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-xstring-to-string-conserving-accented-characters/m-p/6622173#M1440649</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 suggest to use methods of class &lt;STRONG&gt;CL_BCS_CONVERT&lt;/STRONG&gt; for conversions, FMs like SCMS_XSTRING_TO_STRING are going to become obsolete.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ivan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Sep 2010 22:33:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-xstring-to-string-conserving-accented-characters/m-p/6622173#M1440649</guid>
      <dc:creator>_IvanFemia_</dc:creator>
      <dc:date>2010-09-02T22:33:53Z</dc:date>
    </item>
  </channel>
</rss>

