<?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 Downloading data from application server into CSV file in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/downloading-data-from-application-server-into-csv-file/m-p/3020835#M714174</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;My requirement is to downlaod data from App Server to Pres server in CSV format.&lt;/P&gt;&lt;P&gt;In function module i can use in order to acheive this.I tried with GUI_DOWNLAOD but i couldn't get it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;P&gt;Points will be rewarded...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 Nov 2007 15:38:57 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-11-13T15:38:57Z</dc:date>
    <item>
      <title>Downloading data from application server into CSV file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/downloading-data-from-application-server-into-csv-file/m-p/3020835#M714174</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;My requirement is to downlaod data from App Server to Pres server in CSV format.&lt;/P&gt;&lt;P&gt;In function module i can use in order to acheive this.I tried with GUI_DOWNLAOD but i couldn't get it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;P&gt;Points will be rewarded...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2007 15:38:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/downloading-data-from-application-server-into-csv-file/m-p/3020835#M714174</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-13T15:38:57Z</dc:date>
    </item>
    <item>
      <title>Re: Downloading data from application server into CSV file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/downloading-data-from-application-server-into-csv-file/m-p/3020836#M714175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Divya, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;first read it fro application server into your internal table using open dataset, read dataset and then close dataset. i hope you know theese commands i.e to read into internal table from application server.&lt;/P&gt;&lt;P&gt;once you have it in your internal table its easy to download to presentation server using GUI_DOWNLOAD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CHEERS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2007 15:41:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/downloading-data-from-application-server-into-csv-file/m-p/3020836#M714175</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-13T15:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: Downloading data from application server into CSV file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/downloading-data-from-application-server-into-csv-file/m-p/3020837#M714176</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 need to download it from ABAP Program.Say itab_final.I tried using with GUI_DOWNLOAD but couldn't.Could please send me the code if possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2007 15:46:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/downloading-data-from-application-server-into-csv-file/m-p/3020837#M714176</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-13T15:46:14Z</dc:date>
    </item>
    <item>
      <title>Re: Downloading data from application server into CSV file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/downloading-data-from-application-server-into-csv-file/m-p/3020838#M714177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to first read the data into internal table and then you can download it into CSV file using the gui_download...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To read the file into internal table from Application server&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;OPEN DATASET OUTFILE FOR OUTPUT IN TEXT MODE encoding default.
IF sy-subrc &amp;lt;&amp;gt; 0.
message e001(z_error).
endif.

transfter outfile to itab
if sy-subrc = 0.
  append itab.
endif.

CLOSE DATASET OUTFILE.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, once you have data into the itab, you can download it into CSV.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: begin of it_down occurs 0,
str type string,
end of it_down.

Loop at itab.
  concatenate itab-field1 itab-field2 itab-field3 into it_down-str separated by ','.
  append itab.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Then download thi it_down to presentation server with GUI_DOWNLOAD &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Naimesh Patel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2007 15:50:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/downloading-data-from-application-server-into-csv-file/m-p/3020838#M714177</guid>
      <dc:creator>naimesh_patel</dc:creator>
      <dc:date>2007-11-13T15:50:40Z</dc:date>
    </item>
    <item>
      <title>Re: Downloading data from application server into CSV file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/downloading-data-from-application-server-into-csv-file/m-p/3020839#M714178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;good&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;go through this code hope this would give you some idea to solve your problem&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;parameters: p_file(512).&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  DATA : BEGIN OF ITAB OCCURS 0,&lt;/P&gt;&lt;P&gt;          COL1(1024) TYPE C,&lt;/P&gt;&lt;P&gt;         END OF ITAB,&lt;/P&gt;&lt;P&gt;         WA_ITAB LIKE LINE OF ITAB.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  DATA: BEGIN OF ITAB_2 OCCURS 0,&lt;/P&gt;&lt;P&gt;    FIELD01(256),&lt;/P&gt;&lt;P&gt;    FIELD02(256),&lt;/P&gt;&lt;P&gt;    FIELD03(256),&lt;/P&gt;&lt;P&gt;    FIELD04(256),&lt;/P&gt;&lt;P&gt;    FIELD05(256),&lt;/P&gt;&lt;P&gt;    FIELD06(256),&lt;/P&gt;&lt;P&gt;    FIELD07(256),&lt;/P&gt;&lt;P&gt;    FIELD08(256),&lt;/P&gt;&lt;P&gt;    FIELD09(256),&lt;/P&gt;&lt;P&gt;    FIELD10(256),&lt;/P&gt;&lt;P&gt;    FIELD11(256),&lt;/P&gt;&lt;P&gt;    FIELD12(256),&lt;/P&gt;&lt;P&gt;    FIELD13(256),&lt;/P&gt;&lt;P&gt;    FIELD14(256),&lt;/P&gt;&lt;P&gt;    FIELD15(256),&lt;/P&gt;&lt;P&gt;    FIELD16(256),&lt;/P&gt;&lt;P&gt;   END OF ITAB_2.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  DATA: WA_2 LIKE LINE OF ITAB_2.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;    OPEN DATASET p_FILE FOR INPUT IN TEXT MODE ENCODING NON-UNICODE.&lt;/P&gt;&lt;P&gt;    IF SY-SUBRC = 8.&lt;/P&gt;&lt;P&gt;      WRITE:/ 'File' , p_FILE , 'cannot be opened'.&lt;/P&gt;&lt;P&gt;      LV_LEAVEPGM = 'X'.&lt;/P&gt;&lt;P&gt;      EXIT.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    WHILE SY-SUBRC &amp;lt;&amp;gt; 4.&lt;/P&gt;&lt;P&gt;      READ DATASET p_FILE INTO WA_ITAB.&lt;/P&gt;&lt;P&gt;      APPEND WA_ITAB TO ITAB.&lt;/P&gt;&lt;P&gt;    ENDWHILE.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;    CLOSE DATASET p_FILE.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  LOOP AT ITAB INTO WA_ITAB.&lt;/P&gt;&lt;P&gt;    SPLIT WA_ITAB-COL1 AT ','    " where comma is ur demiliter&lt;/P&gt;&lt;P&gt;     INTO WA_2-FIELD01 WA_2-FIELD02 WA_2-FIELD03 WA_2-FIELD04&lt;/P&gt;&lt;P&gt;     WA_2-FIELD05 WA_2-FIELD06 WA_2-FIELD07 WA_2-FIELD08 WA_2-FIELD09&lt;/P&gt;&lt;P&gt;     WA_2-FIELD10 WA_2-FIELD11 WA_2-FIELD12 WA_2-FIELD13 WA_2-FIELD14&lt;/P&gt;&lt;P&gt;     WA_2-FIELD15 WA_2-FIELD16.&lt;/P&gt;&lt;P&gt;    APPEND WA_2 TO ITAB_2.&lt;/P&gt;&lt;P&gt;    CLEAR WA_2.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&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;mrutyun^&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2007 15:50:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/downloading-data-from-application-server-into-csv-file/m-p/3020839#M714178</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-13T15:50:40Z</dc:date>
    </item>
    <item>
      <title>Re: Downloading data from application server into CSV file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/downloading-data-from-application-server-into-csv-file/m-p/3020840#M714179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if its not working then have a break point in your program  and check if you are able to get data in to internal table or not..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if its not so , then go thru the code given by some of our friends to split the data being read from application server and then appending it to internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if not could you be more precise on your porblem&lt;/P&gt;&lt;P&gt;CHEERS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        trivenn mudiavrthi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2007 15:53:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/downloading-data-from-application-server-into-csv-file/m-p/3020840#M714179</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-13T15:53:37Z</dc:date>
    </item>
    <item>
      <title>Re: Downloading data from application server into CSV file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/downloading-data-from-application-server-into-csv-file/m-p/3020841#M714180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Divya, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the File is in application server, then you need to read it first, then move the contents to an internal table and then transfer it using GUI_DOWNLOAD.&lt;/P&gt;&lt;P&gt;Use the following code to read the file from Application server.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
OPEN DATASET &amp;lt;filepath&amp;gt; FOR INPUT.
 
CHECK sy-subrc = 0.

DO.
 
READ DATASET &amp;lt;filepath&amp;gt; INTO wa_string.
 
IF sy-subrc &amp;lt;&amp;gt; 0.
EXIT.
ENDIF.
 
SPLIT wa_string AT '#' INTO wa-&amp;lt;field1&amp;gt; wa-&amp;lt;field2&amp;gt;.... wa-&amp;lt;fieldn&amp;gt;
append wa to itab.
ENDDO.
 
CLOSE DATASET '/tmp/test.xls'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once the internal table id populated call FM GUI_DOWNLOAD to download the contents into a csv or xls. file&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use the following code for download.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
      filename                = &amp;lt;Filepath&amp;gt;
    TABLES
      data_tab                = itab.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;Lokesh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Lokesh Aggarwal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2007 15:57:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/downloading-data-from-application-server-into-csv-file/m-p/3020841#M714180</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-13T15:57:15Z</dc:date>
    </item>
    <item>
      <title>Re: Downloading data from application server into CSV file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/downloading-data-from-application-server-into-csv-file/m-p/3020842#M714181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;many thanks for ur helping hands&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2007 11:17:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/downloading-data-from-application-server-into-csv-file/m-p/3020842#M714181</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-14T11:17:32Z</dc:date>
    </item>
  </channel>
</rss>

