2006 Jan 09 2:56 PM
Is there any function module to check whether a given directory exists on Application Server or not.
Is there any function module to check whether a given directory exists on Application Server or not.
2006 Jan 09 3:02 PM
2006 Jan 09 3:12 PM
CALL FUNCTION 'EPS_GET_DIRECTORY_PATH'
* EXPORTING
* EPS_SUBDIR = 'log'
DIR_NAME = 'DIR_TMP'
* IMPORTING
* DIR_NAME =
EXCEPTIONS
INVALID_EPS_SUBDIR = 1
SAPGPARAM_FAILED = 2
BUILD_DIRECTORY_FAILED = 3
OTHERS = 4
.
if sy-subrc <> 0.
"the directory not present.
endif.
2006 Jan 09 3:09 PM
Hi Vijay,
How should I use the parameter EPS_SUBDIR in the function module. If I don't pass it then it gives error for the valid directory too.
Thanks in advance
2006 Jan 09 3:15 PM
This works pretty good for me.
REPORT ZRICH_0001 .
type-pools: abap.
data: path type string.
data: result type abap_bool.
path = '\<host>usrsapTSTSYS'.
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 = 'X'.
Write:/ 'Directory Exists'.
else.
Write:/ 'Directory not found'.
endif.
Regards,
Rich Heilman
2006 Jan 09 3:23 PM
2006 Jan 10 9:00 AM
Hi All,
I have found out one function module RZL_READ_DIR_LOCAL which works fine to check the existence of the directory on the application server.
Thanks a lot to all of you who have replied to the query.