Application Development and Automation 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: 
Read only

Upload Excel File : Problem with Filter

former_member611006
Active Participant
0 Likes
1,316

Hi Experts,

by using "TMP_GUI_FILE_OPEN_DIALOG" with these parameters:

  • window_title = 'Please select an Excel File'

  • default_extension = '*.xls'

  • file_filter = '*.xls'

  • multiselection = ' '

  • init_directory = 'C:\temp'

it doesn't show any file the first time we call the Function, we have to close the window and then restart the Function Then it show all Fileformat, I just want to see .XLSX files.

Any idea?

Regards,

David

2 REPLIES 2
Read only

former_member611006
Active Participant
0 Likes
633

I found the solution:

  • Initialisierung

CONCATENATE 'Alle-Dateien(.)|.|'

'Word-Dateien(.doc)|.doc|'

'Bild-Dateien(.gif)|.gif|'

'Bild-Dateien(.jpg)|.jpg|'

'Mail-Dateien(.msg)|.msg|'

'PDF-Dateien(.pdf)|.pdf|'

'Bild-Dateien(.tif)|.tif|'

'Text-Dateien(.txt)|.txt|'

'Excel-Dateien(.xls)|.xls'

INTO filter.

  • Datei abfragen

CALL METHOD cl_gui_frontend_services=>file_open_dialog

EXPORTING

window_title = 'Datei auswählen'

file_filter = filter

initial_directory = 'C:'

CHANGING

file_table = i_file[]

rc = rcode

EXCEPTIONS

OTHERS = 1.

Regards,

David

Read only

0 Likes
633

Try this way


* Update View
  CALL METHOD cl_gui_cfw=>update_view
    EXCEPTIONS
      cntl_system_error = 1
      cntl_error        = 2
      OTHERS            = 3.

  lv_title = text-003.
* Get the file with open dialog box
  CALL METHOD cl_gui_frontend_services=>file_open_dialog
    EXPORTING
      window_title            = lv_title
      file_filter             = p_filetype
      initial_directory       = lv_desktop
    CHANGING
      file_table              = lt_filetable
      rc                      = lv_rc
      user_action             = lv_action
    EXCEPTIONS
      file_open_dialog_failed = 1
      cntl_error              = 2
      error_no_gui            = 3
      OTHERS                  = 4.

a®