2007 Oct 25 8:48 AM
used followin coding :
all the files present in v_dirname should get populated in i_dir_list is not it ? but its not workin .
i_dir_list is not working .
CALL FUNCTION 'SO_SPLIT_FILE_AND_PATH'
EXPORTING
full_name = lv_file
full_name = p_lifnr
IMPORTING
STRIPPED_NAME = lv_name
FILE_PATH = v_dirname1
EXCEPTIONS
X_ERROR = 1
OTHERS = 2
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
EXPORTING
dir_name = v_dirname1
FILE_MASK = ' '
IMPORTING
DIR_NAME = v_dirname2
FILE_COUNTER = v_filecounter
ERROR_COUNTER = v_errorcounter
tables
dir_list = i_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
<b>Is there any alternative function module for : 'EPS_GET_DIRECTORY_LISTING'</b>
2007 Oct 25 9:03 AM
<b>The function module 'RZL_READ_DIR_LOCAL' can be used to retrieve the files in the application server directory. See the sample code below.
Code
REPORT ZTEST.
PARAMETER: p_fdir type pfeflnamel DEFAULT 'usrsapYRDSYSprofile'.
data:
t_files like salfldir occurs 0 with header line.
*START-OF-SELECTION
START-OF-SELECTION.
Retrieving the list of files in the given directory
call function 'RZL_READ_DIR_LOCAL'
exporting
name = p_fdir
tables
file_tbl = t_files.
List of files are contained within table it_filedir
loop at t_files.
write: / t_files-NAME.
endloop.</b>
2007 Oct 25 10:20 AM
2007 Oct 25 10:22 AM
Hi,
Go to classCL_GUI_FRONTEND_SERVICES using SE24 there are methods to get the directory. I think it is GET_DIRECTORY.
Regards,Atish
2007 Oct 25 9:33 AM
Hi,
If your aim is to copy all files from one directory to another on app server, you may define an OS command say ZCOPY via sm69 which will run the batch file created on the server ( one time job ), which in turn will copy files from one directory to another.
I hope this helps,
Regards
Raju Chitale
2007 Oct 25 10:45 AM
Hi,
GOto SE24
TYpe CL_GUI_FRONTEND_SERVICES
Click on DIsplay
Following are the methods:
DIRECTORY_BROWSE Shows a Directory Selection Window
DIRECTORY_CREATE Creates a Directory in the Client
DIRECTORY_DELETE Deletes a Directory in the Client
DIRECTORY_EXIST Checks if a directory exists
DIRECTORY_GET_CURRENT Returns the Current Directory
DIRECTORY_LIST_FILES Lists Files in a Given Directory
DIRECTORY_SET_CURRENT Sets the Current Directory (Do NOT Use)
Best regards,
Prashant