Application Development and Automation 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: 
Read only

Reports

Former Member
0 Likes
468

Hi,

How to write a logic in reports so that i can cross check whether a given path

( example c:\sagar\books ) exists or not ?

i tried using the standard function below,

SO_FOLDER_LOGICALLY_EXIST

SWFMOD_CHECK_FOLDER_EXIST

SKWF_FOLDER_EXISTENCE_CHECK

ECATT_CHECK_PATH_EXISTS

BUT THEY ARE NOT WORKIN

PLEASE HELP.

Thanks and Regards

Sagar

5 REPLIES 5
Read only

Former Member
0 Likes
448

Have you looked at class CL_GUI_FRONTEND_SERVICES. It has methods for everything you say you want to do: DIRECTORY_EXIST, DIRECTORY_CREATE, DOWNLOAD, etc.

**********************

You could use this FM CH_CHECK_PATH

Use this function module below to check path and drive

PC_CHECK_PATH_WITH_DRIVE

******************************

Regards

vasu

Read only

Former Member
0 Likes
448

For local file

for derectory

CL_GUI_FRONTEND_SERVICES=>DIRECTORY_EXIST

--DIRECTORY

for file

CL_GUI_FRONTEND_SERVICES=>FILE_EXIST

--FILE

use it like use FM

Read only

Former Member
0 Likes
448
type-pools: abap.
 
data: path type string.
data: result type abap_bool.
 
parameters: p_path type localfile default 'c:sagarbooks'.
 
at selection-screen .
 
 
path = p_path.
 
call method cl_gui_frontend_services=>directory_exist
  exporting
    directory            = path
  receiving
    result               = result
  EXCEPTIONS
    CNTL_ERROR           = 1
    ERROR_NO_GUI         = 2
    WRONG_PARAMETER      = 3
    NOT_SUPPORTED_BY_GUI = 4
    others               = 5
        .
if result = space.
  message e001(00) with 'Path/Directory does not exist'.
endif.
Read only

0 Likes
448

Hi,

Thaks for your reply.

But this solution works only for local system.

I want to check the existance of the path ( directory/file ) in application server.

Regards,

Sagar

Read only

Former Member
0 Likes
448

Hi try this function module

TMP_GUI_GET_FILE_EXIST

Regards

Aruna