Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to scan Application ser. directory/ How to archive appl.server file

Former Member
0 Kudos

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...

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

4 REPLIES 4

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member