‎2009 Jun 09 10:43 AM
hi everybody
im trying to execute the fm EPS_DELETE_FILE but it seems it cant delete the files
CALL FUNCTION 'EPS_DELETE_FILE'
EXPORTING
FILE_NAME = l_filename
DIR_NAME = l_dirname
IMPORTING
FILE_PATH = l_pathname
EXCEPTIONS
INVALID_EPS_SUBDIR = 1
SAPGPARAM_FAILED = 2
BUILD_DIRECTORY_FAILED = 3
NO_AUTHORIZATION = 4
BUILD_PATH_FAILED = 5
DELETE_FAILED = 6
OTHERS = 7
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
the parameter l_pathname is not taking the extension of the files, I dont know why
l_pathname is taking this value
100.300.1.6\310\WORKS\OUT\file_20091502
instead of
100.300.1.6\310\WORKS\OUT\file_20091502.txt
hence its not deleting the file
anybody knows the reason?
‎2009 Jun 09 11:13 AM
Hello Sia,
In AL11, goto the path '
100.300.1.6\310\WORKS\OUT\' and check the name of the file, whether it is: 'file_20091502' or 'file_20091502.txt'?
I feel that it is saved as 'file_20091502'. Hence the issue.
BR,
Suhas
‎2009 Jun 09 11:19 AM
nope its saved as 'file_20091502.txt' in the directory
i really cant explain this
‎2009 Jun 09 11:21 AM
Hi,
First check if file really exists in given directory:
PARAMETERS: pa_dir TYPE epsf-epsdirnam VISIBLE LENGTH 60 OBLIGATORY.
"directory list
DATA: BEGIN OF dir_list OCCURS 0.
INCLUDE STRUCTURE epsfili.
DATA END OF dir_list.
"------------------------ get direcotry listing
CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
EXPORTING
dir_name = pa_dir
TABLES
dir_list = dir_list
EXCEPTIONS
invalid_eps_subdir = 1
sapgparam_failed = 2
build_directory_failed = 3
no_authorization = 4
read_directory_failed = 5
too_many_read_errors = 6
empty_directory_list = 7
OTHERS = 8.
IF sy-subrc <> 0.
MESSAGE 'No such directory' TYPE 'I' DISPLAY LIKE 'E'.
LEAVE TO SCREEN 0.
ENDIF.
"------------------------ get direcotry listing
LOOP AT dir_list.
if dir_list-name = l_filename.
"Exist
CALL FUNCTION 'EPS_DELETE_FILE'. ...
else.
"check another one
CONTINUE.
endif.
ENDLOOP.
Regards
Marcin
Edited by: Marcin Pciak on Jun 9, 2009 12:23 PM
‎2009 Jun 12 8:20 AM