12-29-2005 6:49 AM
Hi,
I have joined the forum recently.
How to check if a local path in sel.screen is valid?.
I have already checked the FMs PC_CHECK*. These FMs do not actually access the PC and check for existence of mentioned path.
Thanks,
Madhu
12-29-2005 9:54 AM
Hi madhu
Check these FM's
CONV_UTIL_CHECK_FILE_EXISTENCE
CV120_DOC_FILE_EXISTENCE_CHECK
CV122_DOC_FILE_EXISTENCE_CHECK
DX_FILE_EXISTENCE_CHECK
PFL_CHECK_OS_FILE_EXISTENCE
i have u another idea!
try this following code
selection-screen begin of block b1 with frame .
PARAMETER : FILE(100) lower case.
selection-screen end of block b1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR FILE.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
DEF_FILENAME = ' '
DEF_PATH = '.'
MASK = ' '
MODE = ' '
TITLE = ' '
IMPORTING
FILENAME = FILE
RC =
.
12-29-2005 6:56 AM
Hi,
Could you tell me what you want to do with the file you want to read.
Lokesh
Message was edited by: Lokesh Aggarwal
12-29-2005 7:04 AM
Hi,
I want to create a file, say log.txt in the mentioned path. I would do this using WS-DOWNLOAD. But first I want to ascertain that the mentioned path exists in the PC.
Thanks,
Madhu
12-29-2005 7:07 AM
Hi,
You can use the same file path in WS_download and do this in at selection-screen event.
You will get an FILE_OPEN_ERROR exception if the path is not correct. (SY-SUBRC = 1)
Hope it helps...
Lokesh
Pls. reward appropriate points
Message was edited by: Lokesh Aggarwal
12-29-2005 7:02 AM
hi, function like WS_QUERY or method CL_GUI_FRONTEND_SERVICES=>FILE_EXIST will helpful to you.
If you want to do a validation on the local path.
thanks
12-29-2005 7:09 AM
Try FM DX_FILE_EXISTENCE_CHECK.
If you enter the path including file name in import parameter 'FILENAME'and enter value X gainst import parameter PC, you will get value for export parameter FILE_EXISTS as X if the file is present.
12-29-2005 7:11 AM
hi madhu,
you can use this method CL_GUI_FRONTEND_SERVICES=>FILE_EXIST
to check the file existance..
vijay
12-29-2005 9:54 AM
Hi madhu
Check these FM's
CONV_UTIL_CHECK_FILE_EXISTENCE
CV120_DOC_FILE_EXISTENCE_CHECK
CV122_DOC_FILE_EXISTENCE_CHECK
DX_FILE_EXISTENCE_CHECK
PFL_CHECK_OS_FILE_EXISTENCE
i have u another idea!
try this following code
selection-screen begin of block b1 with frame .
PARAMETER : FILE(100) lower case.
selection-screen end of block b1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR FILE.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
DEF_FILENAME = ' '
DEF_PATH = '.'
MASK = ' '
MODE = ' '
TITLE = ' '
IMPORTING
FILENAME = FILE
RC =
.
12-30-2005 6:18 AM
Hi Vijay,
The FM CV120_DOC_FILE_EXISTENCE_CHECK works fine for local path.
Thanks,
Madhu