Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

I want open the file window to down load the data.

former_member623843
Participant
0 Kudos

HI all,

I want to download the data into excel with specified path. So what is the standard function module to open the file window.

Thanks

5 REPLIES 5

Former Member
0 Kudos

You can use:



  CALL FUNCTION 'TB_LIMIT_WS_FILENAME_GET'
    EXPORTING
      def_filename     = '*.xls'
      mask             = '*.xls'
      mode             = 'S'
    IMPORTING
      filename         = v_path
    EXCEPTIONS
      selection_cancel = 1
      selection_error  = 2
      OTHERS           = 3.
  IF sy-subrc EQ 0.
    p_p_opfile = v_path.
  ENDIF.

0 Kudos

HI aparna,

In this fm where i need to pass my internle table. Because iam having data in the itab. From this table i need to download.

0 Kudos

That FM will only open the file dialog.....to get the file name and directory where you want to save the data.

After getting the entire path you have to use GUI_DOWNLOAD:


  CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
      filename                = v_path
      filetype                = 'DAT'
      write_field_separator   = 'X'
    TABLES
      data_tab                = i_excel               "your data itab
      fieldnames              = i_fname             "column headers
    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
      OTHERS                  = 22.
  IF sy-subrc NE 0.
    MESSAGE e000(zfi) WITH text-106.
  ENDIF.

0 Kudos

thanks

Former Member
0 Kudos

Hi Sultabi,

Use method CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG to open a file window pop up.

Thanks,

Vinay