‎2009 Jul 27 11:04 AM
Hello SDNites,
I have to retrieve all the files from the application server corecponding to a predefined path.
I have tried using FM RZL_READ_DIR_LOCAL and am getting the output but one of my file name length exceeds the limit set of 32 chars and hence does not retrieve the entire file name. My file name lenth is 36 chars. Can someone help me in this.
I tried creating custom FM of this standard FM but it does't work as there is some SAP system statement,
CALL 'ALERTS' ID 'ADMODE' FIELD AD_RZL
ID 'OPCODE' FIELD RZL_OP_RD_DIR
ID 'FILE_NAME' FIELD FULL_NAME
ID 'DIR_TBL' FIELD LINE_TBL-SYS.
Can someone help me in resolving the above specified issue.
Reagards,
Abhishek
‎2009 Jul 27 11:47 AM
Hi,
Use below snippet. You will get up to 40 char path name
PARAMETERS: pa_dir TYPE epsf-epsdirnam VISIBLE LENGTH 60 OBLIGATORY, "max 60 chars as input path
DATA: BEGIN OF dir_list OCCURS 0.
INCLUDE STRUCTURE epsfili.
DATA END OF dir_list.
CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
EXPORTING
dir_name = pa_dir
TABLES
dir_list = dir_list "here is your result set, it will return max 40char dir name, so will suffice for you
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.
Regards
Marcin
‎2009 Jul 27 12:03 PM
Thanks for the repy,
I am entering my directory physaical path but still am not getting any values.
‎2009 Jul 27 12:12 PM
pa_dir here is an Application Server path like i.e /usr/sap/trans . It's case sensitive so please ensure that you give right name.
It will return all files in that path in table parameter dir_list
Regards
Marcin