2006 Aug 21 10:27 AM
Hi experts,
I am new to OO concept in ABAP.Can any body give the example code for using the following method?
CL_GUI_FRONTEND_SERVICES=>DIRECTORY_LIST_FILES
Suppose i have 2 XML files in a directory 'dir' in C drive.
Thanks in Advance.
Hi experts,
I am new to OO concept in ABAP.Can any body give the example code for using the following method?
CL_GUI_FRONTEND_SERVICES=>DIRECTORY_LIST_FILES
Suppose i have 2 XML files in a directory 'dir' in C drive.
Thanks in Advance.
2006 Aug 21 10:28 AM
2006 Aug 21 10:29 AM
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.
2006 Aug 21 10:59 AM
Hi all,
Thanks .In This Method, in the exporting parameter directory can we give a path from a different server that means other than R/3 server? If so How can we give that?
Regards
2006 Aug 21 10:29 AM
Hi!!
it would be like this other case, you can use partner button to build it, first you put the class and after in the next screen th method.
regards
CALL METHOD cl_gui_frontend_services=>directory_exist
EXPORTING
directory = ruta_aux3
RECEIVING
result = lf_subrc
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
wrong_parameter = 3
not_supported_by_gui = 4
OTHERS = 5.
2006 Aug 21 10:30 AM
2006 Aug 21 10:38 AM
Hi Ravi,
Do this way ...
CALL METHOD cl_gui_frontend_services=>DIRECTORY_LIST_FILES
EXPORTING directory = file_path
filter = 'image*'
files_only = 'X'
directories_only = SPACE
CHANGING file_table = files
count = rc
EXCEPTIONS OTHERS = 1.Check this Link for reference..
Regards,
Santosh
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |