<?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: Download from TemSe using OPEN DATASET - Codepage problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/download-from-temse-using-open-dataset-codepage-problem/m-p/3726004#M896789</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Manish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm already using dataset commands. But the content in the file is not correct . I have the strong supposition that there is a problem with the codepage. And the strange thing is, that there is no codepage conversion in gui_download (which is working fine)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 25 Apr 2008 12:36:48 GMT</pubDate>
    <dc:creator>former_member287500</dc:creator>
    <dc:date>2008-04-25T12:36:48Z</dc:date>
    <item>
      <title>Download from TemSe using OPEN DATASET - Codepage problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/download-from-temse-using-open-dataset-codepage-problem/m-p/3726002#M896787</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to download data from temse.&lt;/P&gt;&lt;P&gt;Using the method cl_gui_frontend_services=&amp;gt;gui_download it's working fine, but only to presentation server. But the download should be performed by the system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Therefore I wanted to use OPEN DATASET.&lt;/P&gt;&lt;P&gt;This also works, but with restrictions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The format of the downloaded file is incorrect.&lt;/P&gt;&lt;P&gt;For example the contet should be 341, but in front of every digit there is an additional digtit. In this case 3. So the output is 333431, not the expected 341.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume this is a codepage problem, but I do not know how to solve it.&lt;/P&gt;&lt;P&gt;Here is a piece of code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
 IF p_file IS NOT INITIAL.

    CALL METHOD cl_gui_frontend_services=&amp;gt;gui_download
      EXPORTING
        bin_filesize         = filesize
        filename             = filename_string
        filetype             = 'BIN'
        no_auth_check        = 'X'
      IMPORTING
        filelength           = after_download_length
      CHANGING
        data_tab             = tab_x
      EXCEPTIONS
        file_not_found       = 91
        file_write_error     = 92
        filesize_not_allowed = 93
        invalid_type         = 95
        no_batch             = 96
        OTHERS               = 97.

    IF sy-subrc NE 0.                              "download error
      result = sy-subrc.
    ELSEIF after_download_length EQ 0.             "nothing written
      result = 97.
    ENDIF.

  ELSE.

    IF wa_regut-codepage = '4102' OR wa_regut-codepage = '4103'.
      OPEN DATASET filename_string IN BINARY MODE FOR OUTPUT.
    ELSEIF wa_regut-codepage = '4110'.
      OPEN DATASET filename_string IN TEXT MODE FOR OUTPUT ENCODING DEFAULT.
    ELSEIF wa_regut-codepage IS NOT INITIAL.
      OPEN DATASET filename_string FOR OUTPUT IN LEGACY BINARY MODE CODE PAGE out_codepage.
    ELSE.
      OPEN DATASET filename_string FOR OUTPUT IN LEGACY BINARY MODE.
    ENDIF.

    LOOP AT tab_x INTO str_line.
      TRANSFER str_line TO wa_regut-dwnam.
    ENDLOOP.
    CLOSE DATASET wa_regut-dwnam.

  ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The strange thing is, that inside the method gui_download there is no codepage conversion. This method and the transfer statement are using the same table, but the output is different.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas what could solve this?&lt;/P&gt;&lt;P&gt;Your help is highly appreciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there another possibility to download a file in backgroud processing?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Tobias&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Apr 2008 11:21:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/download-from-temse-using-open-dataset-codepage-problem/m-p/3726002#M896787</guid>
      <dc:creator>former_member287500</dc:creator>
      <dc:date>2008-04-25T11:21:22Z</dc:date>
    </item>
    <item>
      <title>Re: Download from TemSe using OPEN DATASET - Codepage problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/download-from-temse-using-open-dataset-codepage-problem/m-p/3726003#M896788</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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UPLOADING AND DOWNLOADING FILE FROM/TO APPLICATION SERVER  TO/FROM WORKSTATION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use the Function Module ARCHIVFILE_CLIENT_TO_SERVER.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use the function Module ARCHIVFILE_SERVER_TO_CLIENT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Give file path in PATH and Destination Path &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OR &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GET THE FILE IN AN INTERNAL TABLE AND USE DATASET COMMANDS TO WRITE THE FILE IN APPLICATION SERVER&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Manish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Apr 2008 12:02:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/download-from-temse-using-open-dataset-codepage-problem/m-p/3726003#M896788</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-25T12:02:42Z</dc:date>
    </item>
    <item>
      <title>Re: Download from TemSe using OPEN DATASET - Codepage problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/download-from-temse-using-open-dataset-codepage-problem/m-p/3726004#M896789</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Manish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm already using dataset commands. But the content in the file is not correct . I have the strong supposition that there is a problem with the codepage. And the strange thing is, that there is no codepage conversion in gui_download (which is working fine)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Apr 2008 12:36:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/download-from-temse-using-open-dataset-codepage-problem/m-p/3726004#M896789</guid>
      <dc:creator>former_member287500</dc:creator>
      <dc:date>2008-04-25T12:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: Download from TemSe using OPEN DATASET - Codepage problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/download-from-temse-using-open-dataset-codepage-problem/m-p/3726005#M896790</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's working now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tab_x was type x , str_line was typ string. It is neccessary that tab_x is looped into xstring. After that xstring has to be converted into string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Apr 2008 15:49:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/download-from-temse-using-open-dataset-codepage-problem/m-p/3726005#M896790</guid>
      <dc:creator>former_member287500</dc:creator>
      <dc:date>2008-04-25T15:49:24Z</dc:date>
    </item>
  </channel>
</rss>

