2023 Oct 26 2:40 PM
For some reason whenever I use a file filter in the function "directory_list_files" of "cl_gui_frontend_services" it doesn't seem to work, while in methods like "file_open_dialog" there is no such problem.
If I leave out the filter in the code below it lists all files in the directory as usual, but when I use the filetype_excel filter all files vanish, including XLSX and XLSM files while still giving a sy-subrc of 0.
Is there a note regarding this problem? I read of note 864592, but it seemingly has been removed.
cl_gui_frontend_services=>directory_list_files(
EXPORTING
directory = lv_directory " Directory To Search
files_only = abap_true
filter = cl_gui_frontend_services=>filetype_excel " File filter
CHANGING
file_table = lt_file_table " Return Table for the Found Files
count = lv_count " Number of Files/Dir Found
EXCEPTIONS
cntl_error = 1 " Control error
directory_list_files_failed = 2 " Could not list files in the directory
wrong_parameter = 3 " Incorrect parameter combination
error_no_gui = 4 " No GUI available
not_supported_by_gui = 5 " GUI does not support this
OTHERS = 6 ).
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.<br>
2023 Oct 26 3:56 PM
2023 Oct 26 3:43 PM
What about all the other SAP notes?
2868986 - DIRECTORY_LIST_FILES method is not working with multiple filter values
etc.
Do you have a S-User?
2023 Oct 26 3:56 PM
2023 Oct 27 7:01 AM
Yes, works perfectly along the note sandrarossi commented. Thank you for your help!
2023 Oct 27 7:00 AM
It seems this particular note has flown over my head. Thank you for showing me.