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: 

problem in validatiing direcotry on server

Former Member
0 Kudos

Hi Friends,

I have a a requirement that whenever report is being executed save into directory (Either Presentation server or in Application server ).

So what my logic is first of all check specific directory is available or not, and if yes then create new file there and add output data into the File->directory.

If directory is not available then create directory and do the same steps again.

What is the best solution to satisfy this functional requirement.

Waiting for your inputs.

Thanks

PP

7 REPLIES 7

amit_khare
Active Contributor
0 Kudos

For Checking Directory-

call method cl_gui_frontend_services=>directory_exist

PFL_CHECK_DIRECTORY

For Creating directories -

GUI_CREATE_DIRECTORY - presentation server

WBMR_CREATE_APPL_FOLDER - Application Server

0 Kudos

Thanks Amit,

My functional team said that our program may be executed in background mode, so in taht case, what are the function modules

which will check directory exist or not, create directory, create file, and save file to directory.

If you know then please give me the details:-

Thanks

PP

0 Kudos

If its only in back ground then for checking Directory & creating /saving file you can use OPEN DATASET only.

For Creating directory, refer [this|].

0 Kudos

Hi Amit,

I tried that function module but it is not creating directory on the server.

My Requirement is for each successful execution of report save it into folder.

And this is in background mode.

SoI have to check first directory exist or not.

I am not sure which function module will help me for checking directory.

second thing is if direcotry is not there then create directory .

Now third step is create file on the folder.

Fourth and last step is save data into that file.

So I am just confused which function module will help on this requirement for all task in batch mode.

Thanks a lot Amit.

PP

0 Kudos

To check file in background as I mentioned earler just call OPEN DATASET if sys-subrc <> 0 that means directory does not exist....

The second post mentions about creating directory by using Unix command and calling that command in your program in background....

0 Kudos

Thanks I will check and let you know..

PP

Former Member
0 Kudos

Solved problem