<?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: Problem with character conversion in the file generated on app server in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-character-conversion-in-the-file-generated-on-app-server/m-p/7782274#M1585579</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marcin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I forgot to mention we are generating a csv file and I am not sure we can use binary mode in this case.I tried to use it and we are getting only the header and not the data in the csv file when we download it from server with BIN selected&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Bala Duvvuri&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 01 Apr 2011 09:14:48 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-04-01T09:14:48Z</dc:date>
    <item>
      <title>Problem with character conversion in the file generated on app server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-character-conversion-in-the-file-generated-on-app-server/m-p/7782264#M1585569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have written a report that generates a file on the server but there was some problem with character conversions in that file.So I tried to use &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
l_v_spras = sy-langu.

* Getting the Codepage value for Bulgerian Language
  CALL FUNCTION 'SCP_CODEPAGE_FOR_LANGUAGE'
    EXPORTING
      language    = l_v_spras
    IMPORTING
      codepage    = l_v_codepage
    EXCEPTIONS
      no_codepage = 1
      OTHERS      = 2.

* open the file in output mode
      OPEN DATASET l_fname FOR OUTPUT IN LEGACY TEXT MODE
    CODE PAGE l_v_codepage.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but it is dumping saying The conversion of texts in code page '4102' to code page '4102' is not&lt;/P&gt;&lt;P&gt;supported here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How will i resolve the problem of character conversion.&lt;/P&gt;&lt;P&gt;Unicode checks active checkbox is checked for the report&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Bala Duvvuri&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Mar 2011 10:36:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-character-conversion-in-the-file-generated-on-app-server/m-p/7782264#M1585569</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-03-31T10:36:51Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with character conversion in the file generated on app server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-character-conversion-in-the-file-generated-on-app-server/m-p/7782265#M1585570</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;Regarding the application server, the value which you are passing into the application server for storing, should be of Char type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you pass the Integer or other data type. then it will show you a dump!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Mar 2011 10:41:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-character-conversion-in-the-file-generated-on-app-server/m-p/7782265#M1585570</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-03-31T10:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with character conversion in the file generated on app server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-character-conversion-in-the-file-generated-on-app-server/m-p/7782266#M1585571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bala,&lt;/P&gt;&lt;P&gt;OPEN DATASET ... IN LEGACY TEXT MODE ... is supported for Non-Unicode data only.&lt;/P&gt;&lt;P&gt;(Have a look at &lt;A href="http://help.sap.com/abapdocu_70/en/ABAPOPEN_DATASET_MODE.htm" target="test_blank"&gt;http://help.sap.com/abapdocu_70/en/ABAPOPEN_DATASET_MODE.htm&lt;/A&gt; ).&lt;/P&gt;&lt;P&gt;Now your function results in 4102 (UTF-16 BE) and this is not supported.&lt;/P&gt;&lt;P&gt;I would recommend not to use legacy mode.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Nils Buerckel&lt;/P&gt;&lt;P&gt;SAP AG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Mar 2011 11:46:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-character-conversion-in-the-file-generated-on-app-server/m-p/7782266#M1585571</guid>
      <dc:creator>nils_buerckel</dc:creator>
      <dc:date>2011-03-31T11:46:15Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with character conversion in the file generated on app server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-character-conversion-in-the-file-generated-on-app-server/m-p/7782267#M1585572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bala,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wouldn't play with code pages at all. SAP provides easy way to handle file in UTF-8 which I believe is most convenient encoding type for flat files. So simply use&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
OPEN DATASET file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Then simply feed the output stream with your text (in Bulgarian). Now the file will be both encoded in UTF-8 and available to be displayed in UTF-8 - so no problem to show it in AL11 correctly. Of course pay attention that same decoding must be used in order to transfer it back to input stream (when accessing it via program).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Mar 2011 13:13:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-character-conversion-in-the-file-generated-on-app-server/m-p/7782267#M1585572</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2011-03-31T13:13:50Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with character conversion in the file generated on app server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-character-conversion-in-the-file-generated-on-app-server/m-p/7782268#M1585573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marcin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have done exactly what you have mentioned but the problem is when i see the alv output i see some set of characters and when i export those entires to a file on server it has different set of characters.&lt;/P&gt;&lt;P&gt;what might be th problem&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Bala Duvvuri&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Apr 2011 04:14:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-character-conversion-in-the-file-generated-on-app-server/m-p/7782268#M1585573</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-01T04:14:32Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with character conversion in the file generated on app server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-character-conversion-in-the-file-generated-on-app-server/m-p/7782269#M1585574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, using UNICODE for upload/download files I think is most suitable way. If in AL11 you don't see it being displayed correctly (odd characters appear), that doesn't necessary mean it has wrong encoding set. Maybe AL11 is using different decoding type by default. Normally storage of file on AS is not its final destination, right? You place it there i.e. for customer's job to read it back and send via email. So just make sure that downloading program uses same decoding you used for encoding (UTF-8). Then the characters in the output stream (i.e. frontend file, mail body) should be displayed correctly &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I mean is don't worry how it is dispalyed in AL11, just ensure that after you download it, the characters are correctly decoded. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS: Make sure that you metion encoding type explicitly both for upload and download programs&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
OPEN DATASET dset .... IN TEXT MODE ENCODING/DECODING UTF-8.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Apr 2011 06:57:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-character-conversion-in-the-file-generated-on-app-server/m-p/7782269#M1585574</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2011-04-01T06:57:21Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with character conversion in the file generated on app server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-character-conversion-in-the-file-generated-on-app-server/m-p/7782270#M1585575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marcin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We dont have any download program to download the file and read it.Within the report we are just creating the file and users will manually download the file .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any other suggestion&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Bala Duvvuri&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Apr 2011 07:40:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-character-conversion-in-the-file-generated-on-app-server/m-p/7782270#M1585575</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-01T07:40:24Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with character conversion in the file generated on app server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-character-conversion-in-the-file-generated-on-app-server/m-p/7782271#M1585576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; We dont have any download program to download the file and read it.Within the report we are just creating the file and users will manually download the file .&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i may reply on Marin's behalf. I think what Marcin is trying to put forth is that there should not be any encoding problem if the app server file is written &amp;amp; read in the same code page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;May be AL11 is using some different encoding to display the file which is why we have the junk characters. Did you check the actual file written in the AS? Do you've juck characters there as well?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Apr 2011 07:56:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-character-conversion-in-the-file-generated-on-app-server/m-p/7782271#M1585576</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2011-04-01T07:56:46Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with character conversion in the file generated on app server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-character-conversion-in-the-file-generated-on-app-server/m-p/7782272#M1585577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can try another alternative, namely upload it in binary mode (data stream AS-IS)&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA text TYPE string VALUE 'u0142adowarku0105 siu0119 rozu0142upau0142'.  "some Polish text

DATA file TYPE string VALUE '/tmp/test.txt'.

OPEN DATASET file FOR OUTPUT IN BINARY MODE.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Then in AL11 indeed you will get that displayed as &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#B#a#d#o#w#a#r#k### #s#i### #r#o#z#B#u#p#a#B&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But now if the user downloads it (manually I guess using &lt;STRONG&gt;CGY3&lt;/STRONG&gt; tcode) only ensure that &lt;STRONG&gt;BIN&lt;/STRONG&gt; transfer format is selected and in the PC file the content is as expected&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ładowarką się rozłupał&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Apr 2011 08:24:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-character-conversion-in-the-file-generated-on-app-server/m-p/7782272#M1585577</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2011-04-01T08:24:54Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with character conversion in the file generated on app server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-character-conversion-in-the-file-generated-on-app-server/m-p/7782273#M1585578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Suhas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What do you mean by this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you check the actual file written in the AS? Do you've juck characters there as well?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Bala Duvvuri&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Apr 2011 09:13:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-character-conversion-in-the-file-generated-on-app-server/m-p/7782273#M1585578</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-01T09:13:25Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with character conversion in the file generated on app server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-character-conversion-in-the-file-generated-on-app-server/m-p/7782274#M1585579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marcin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I forgot to mention we are generating a csv file and I am not sure we can use binary mode in this case.I tried to use it and we are getting only the header and not the data in the csv file when we download it from server with BIN selected&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Bala Duvvuri&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Apr 2011 09:14:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-character-conversion-in-the-file-generated-on-app-server/m-p/7782274#M1585579</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-01T09:14:48Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with character conversion in the file generated on app server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-character-conversion-in-the-file-generated-on-app-server/m-p/7782275#M1585580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Bala,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;Did you check the actual file written in the AS? Do you've junk characters there as well?&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AL11 is a report program displaying the contents of the file. What i meant was to access the actual file, as Marcin has mentioned via trxn. CG3Y or CACS_FILE_COPY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Apr 2011 09:24:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-character-conversion-in-the-file-generated-on-app-server/m-p/7782275#M1585580</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2011-04-01T09:24:28Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with character conversion in the file generated on app server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-character-conversion-in-the-file-generated-on-app-server/m-p/7782276#M1585581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes Suhas it has junk characters&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Apr 2011 09:47:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-character-conversion-in-the-file-generated-on-app-server/m-p/7782276#M1585581</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-01T09:47:16Z</dc:date>
    </item>
  </channel>
</rss>

