<?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 data in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/download-data/m-p/4771802#M1118471</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;Try like this....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

DATA: v_pass_path TYPE string value 'C:\Documents and Settings\latha\Desktop\'.

concatenate v_pass_path '_' sy-datum  into v_file1.

CALL FUNCTION 'GUI_FILE_SAVE_DIALOG'
EXPORTING
default_extension = 'XLS'
IMPORTING
fullpath = v_file1.

CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = v_file1
filetype = 'ASC'
TABLES
data_tab = GT_FINAL

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Hope it will helps&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 30 Oct 2008 09:08:58 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-10-30T09:08:58Z</dc:date>
    <item>
      <title>download data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/download-data/m-p/4771801#M1118470</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;ihave written the following code to download the data to excel.&lt;/P&gt;&lt;P&gt;the download was successfull but i am getting extra columns with zeros&lt;/P&gt;&lt;P&gt;and i need to set default file name as data_sy-datum.&lt;/P&gt;&lt;P&gt;the filename i am not getting which i have set(eg:data_30102008)&lt;/P&gt;&lt;P&gt;please check the below code and sugest me &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;s_name = sy-datum.&lt;/P&gt;&lt;P&gt;DATA: v_pass_path TYPE string value 'C:\Documents and Settings\latha\Desktop\'.&lt;/P&gt;&lt;P&gt;concatenate v_pass_path s_name into v_file1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'GUI_FILE_SAVE_DIALOG'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;default_extension = 'XLS'&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;fullpath = v_file1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'GUI_DOWNLOAD'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;filename = v_file1&lt;/P&gt;&lt;P&gt;filetype = 'DBF'&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;data_tab = GT_FINAL&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Oct 2008 09:04:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/download-data/m-p/4771801#M1118470</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-30T09:04:26Z</dc:date>
    </item>
    <item>
      <title>Re: download data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/download-data/m-p/4771802#M1118471</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;Try like this....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

DATA: v_pass_path TYPE string value 'C:\Documents and Settings\latha\Desktop\'.

concatenate v_pass_path '_' sy-datum  into v_file1.

CALL FUNCTION 'GUI_FILE_SAVE_DIALOG'
EXPORTING
default_extension = 'XLS'
IMPORTING
fullpath = v_file1.

CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = v_file1
filetype = 'ASC'
TABLES
data_tab = GT_FINAL

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Hope it will helps&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Oct 2008 09:08:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/download-data/m-p/4771802#M1118471</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-30T09:08:58Z</dc:date>
    </item>
    <item>
      <title>Re: download data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/download-data/m-p/4771803#M1118472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hema,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please try the following code.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

DATA:BEGIN OF IT_ZSTUDENT OCCURS 0.
     INCLUDE STRUCTURE ZSTUDENT.
DATA:END OF IT_ZSTUDENT.
DATA:FNAME type string.

concatenate 'C:\' 'DATA_' sy-datum '.xls' into fname.

SELECT * from zstudent into table it_zstudent up to 5 rows.

CALL FUNCTION 'GUI_DOWNLOAD'
  EXPORTING
    FILENAME                        = FNAME
   FILETYPE                        = 'ASC'
   WRITE_FIELD_SEPARATOR           = 'X'
  TABLES
    DATA_TAB                        = it_zstudent.

IF SY-SUBRC &amp;lt;&amp;gt; 0.
 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;N.K.C&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Oct 2008 10:48:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/download-data/m-p/4771803#M1118472</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-30T10:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: download data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/download-data/m-p/4771804#M1118473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;This code may help u...&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  DATA:     w_file_name TYPE string,
            w_full_path TYPE string,
            full_path TYPE string,
            action TYPE i.

  CALL METHOD cl_gui_frontend_services=&amp;gt;file_save_dialog
    EXPORTING
      window_title         = 'ABCD'
      initial_directory    = 'c:\Documents and Settings\2q\Desktop'
      prompt_on_overwrite  = 'X'
      default_extension    = 'XLS'
      default_file_name    = 'ABCD'
    CHANGING
      filename             = w_file_name
      path                 = w_file_path
      fullpath             = full_path
      user_action          = action
    EXCEPTIONS
      cntl_error           = 1
      error_no_gui         = 2
      not_supported_by_gui = 3
      OTHERS               = 4.

  IF action EQ 0.
    CALL METHOD cl_gui_frontend_services=&amp;gt;gui_download
      EXPORTING
        filename                = w_file_name
        filetype                = 'DAT'
      CHANGING
        data_tab                = &amp;lt;tab&amp;gt;
      EXCEPTIONS
        file_write_error        = 1
        no_batch                = 2
        gui_refuse_filetransfer = 3
        invalid_type            = 4
        no_authority            = 5
        unknown_error           = 6
        header_not_allowed      = 7
        separator_not_allowed   = 8
        filesize_not_allowed    = 9
        header_too_long         = 10
        dp_error_create         = 11
        dp_error_send           = 12
        dp_error_write          = 13
        unknown_dp_error        = 14
        access_denied           = 15
        dp_out_of_memory        = 16
        disk_full               = 17
        dp_timeout              = 18
        file_not_found          = 19
        dataprovider_exception  = 20
        control_flush_error     = 21
        not_supported_by_gui    = 22
        error_no_gui            = 23
        OTHERS                  = 24.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Sukriti Saha on Oct 30, 2008 4:22 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Oct 2008 10:52:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/download-data/m-p/4771804#M1118473</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-30T10:52:06Z</dc:date>
    </item>
  </channel>
</rss>

