Using wild characters to pick up files from Local desktop file directory
My flat files are on my local desktop .
Let's say I have 3 files starting with the letter 'T'.
I need to use wild characters and pick up all 3 files by giving 'T*.txt'
I would like to know how to search my directory ?
Please guide me and give some pointers.
Suhas Saha replied
You can pass 'T*.TXT' to the FILTER param of the method DIRECTORY_LIST_FILES.
No need to take data into the internal table & process it.
CALL METHOD cl_gui_frontend_services=>directory_list_files EXPORTING directory = dir filter = 'T*.TXT' files_only = 'X' CHANGING file_table = it_pfiles count = count EXCEPTIONS cntl_error = 1 directory_list_files_failed = 2 wrong_parameter = 3 error_no_gui = 4 not_supported_by_gui = 5 OTHERS = 6.