01-11-2007 3:35 AM
Hi All,
How to scan a source directory,??
I need a scan a source directory if there is no file exist I need give error message..
How to scan a application directory.. and how to archive a file??
Thanks in advance....
Points will be rewarded for helpful answers...
01-11-2007 4:32 AM
Hi Ravi ,
There is a class <b>'CL_GUI_FRONTEND_SERVICES'</b> which provides a number of front end services .
For your specific requirement there is a method called <b>'DIRECTORY_LIST_FILES'</b> which gives the list of files in the directory.
Regards
Arun
01-11-2007 4:27 AM
Hi Ravi
THe transaction AL11 gives u the list of all directories in application server. In order to scan a source directory, plz use the following fuction module in your program:
RZL_READ_DIR_LOCAL
CALL FUNCTION 'RZL_READ_DIR_LOCAL'
EXPORTING
name = <specify variable of type salfile-longname & pass it here and assign it before using this FM to pathname of type rlgrap-filename>
TABLES
file_tbl = <specify variable of TYPE TABLE OF salfldir & pass it here>
EXCEPTIONS
argument_error = 1
not_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE e100(z_msg2) WITH text-008. <put ur error msg here>
ENDIF.
This should solve your problem.
PLZ REWARD POINTS
01-11-2007 4:32 AM
Hi Ravi ,
There is a class <b>'CL_GUI_FRONTEND_SERVICES'</b> which provides a number of front end services .
For your specific requirement there is a method called <b>'DIRECTORY_LIST_FILES'</b> which gives the list of files in the directory.
Regards
Arun
01-11-2007 4:33 AM
Have a look at below link. It may be useful to you.
http://www.sapdevelopment.co.uk/file/file_disall.htm
I hope it helps.
Best Regards,
Vibha
*Please mark all the helpful answers
01-11-2007 6:20 AM