08-15-2006 3:30 PM
Hello,
I'm trying to get a list of files from specific directory, say c:\temp\, on the presentation server (workstation).
What is the best way to do this? Any help would be appreciated. Thanks!
Regards,
Sandeep
08-15-2006 3:31 PM
Hello,
Try this FM:
TMP_GUI_DIRECTORY_LIST_FILES
Pass Directory = 'C:\temp\'
Filler = '.'
Regards,
Naimesh
08-15-2006 3:31 PM
You can use the method DIRECTORY_LIST_FILES in the class CL_GUI_FRONTEND_SERVICES.
~Suresh
08-15-2006 3:31 PM
Hello,
Try this FM:
TMP_GUI_DIRECTORY_LIST_FILES
Pass Directory = 'C:\temp\'
Filler = '.'
Regards,
Naimesh
08-15-2006 3:48 PM
08-15-2006 3:55 PM
Check this sample.
report zrich_0001.
data: ifile type table of string.
data: xfile type string.
data: xcount type i.
call method cl_gui_frontend_services=>directory_list_files
exporting
directory = 'C:'
* FILTER = '*.*'
FILES_ONLY = 'X'
* DIRECTORIES_ONLY =
changing
file_table = ifile
count = xcount
exceptions
cntl_error = 1
directory_list_files_failed = 2
wrong_parameter = 3
error_no_gui = 4
others = 5.
loop at ifile into xfile.
write:/ xfile.
endloop.
Regards,
Rich Heilman
08-15-2006 3:59 PM
Hi Sandeep,
The method <b>DIRECTORY_LIST_FILES</b> of class <b>CL_GUI_FRONTEND_SERVICES</b> will gives you list of files in a given directory on work station.
Give your directory c:\temp\ to Import parameter <b>DIRECTORY</b> and it will gives list of files in <b>FILE_TABLE</b> and number of files in COUNT.
Thanks,
Vinay