2006 Jul 24 8:54 PM
I have a physical file name and file path.
Please send code or FM for the validation of corrct file path and existance of file in application server .
Thanks
I have a physical file name and file path.
Please send code or FM for the validation of corrct file path and existance of file in application server .
Thanks
2006 Jul 24 9:02 PM
Hi,
Check this code :
data: begin of it_filedir occurs 10.
include structure salfldir.
data: end of it_filedir.
<b>validation of corrct file path</b>
Get Current Directory Listing for OUT Dir
call function 'RZL_READ_DIR_LOCAL'
exporting
name = p_fdir
tables
file_tbl = it_filedir.
if 'it_filedir' contains any records , that means given path is valid.
<b>existance of file in application server</b>
List of files are contained within table it_filedir
loop at it_filedir.
if x_file eq it_filedir-NAME.
-
file exist
endif
endloop.
check this FM : '/SAPDMC/LSM_F4_SERVER_FILE' also
Regards
Appana
*reward points for helpful answers
2006 Jul 24 9:04 PM
2006 Jul 24 9:04 PM
Hi Sharadha,
I am not sure of any function modules . If you are trying to check the existence of any file in any directory this piece of code should work :
DATA FNAME(60) VALUE 'myfile'.
OPEN DATASET FNAME FOR INPUT.
IF SY-SUBRC = 0.
WRITE / 'File opened'.
.....
ELSE.
WRITE / 'File not found'.
ENDIF.
Regards,
Varun .
2006 Jul 24 9:04 PM
Hi Sharadha,
Have you looked FM <b>EPS_GET_DIRECTORY_LISTING</b> or <b>EPS_GET_DIRECTORY_PATH</b>?
Regards,
Ferry Lianto
2006 Jul 24 9:16 PM
Hi ,
Use the following code to check the correct file path.
CONSTANTS : C_FLNAME(100) VALUE
'abcdefghijklmnopqrstuvwxyz0123456789./ABCDEFGHIJKLMNOPQRSTUVWXYZ_'.
(P_UFILE - file path)
CONDENSE P_UFILE.
CLEAR V_STRLEN.
V_STRLEN = STRLEN( P_UFILE ).
Check File name should not contain spaces / special chars.
IF P_UFILE CN C_FLNAME.
Enter valid filename
MESSAGE E000 WITH 'Unix file should contain only'
'alphabets, numbers, ''_'' and ''.''' .
ELSEIF P_UFILE+0(V_STRLEN) CA SPACE.
Enter valid filename
MESSAGE E000 WITH 'Unix file should not contain any spaces'.
ENDIF.
regards,
vara
2006 Jul 24 9:25 PM
hi
good
try with following function module
EPS_GET_FILE_ATTRIBUTES Pass in a filename and a path, and will return attributes for the file
thanks
mrutyun
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |