‎2007 Sep 26 8:55 AM
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
‎2007 Sep 26 8:57 AM
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
‎2007 Sep 26 8:58 AM
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
‎2007 Sep 26 8:59 AM
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.
‎2007 Sep 26 10:33 AM
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
‎2007 Sep 26 9:00 AM