04-04-2013 1:35 PM
Hi All,
I want to get a list of files from the application server without using open datasets.
How can we achieve this. Pls help
thanks,
Faiz
04-04-2013 1:51 PM
https://forums.sdn.sap.com/click.jspa?searchID=8786023&messageID=4856627
Check the below FM.
Retrieving the list of files in the given directory
CALL FUNCTION 'RZL_READ_DIR_LOCAL'
EXPORTING
NAME = PA_AFILE " Directory Path
TABLES
FILE_TBL = T_AFILES " All files...
EXCEPTIONS
ARGUMENT_ERROR = 1
NOT_FOUND = 2
OTHERS = 3.
IF SY-SUBRC 0.
* If it is run in background
IF SY-BATCH EQ C_TRUE.
WRITE: /5 'Directory cannot be opened'(039).
FL_FALSE = C_TRUE.
ELSE.
MESSAGE S000(ZZ_PA) WITH 'Directory cannot be opened'(039).
FL_FALSE = C_TRUE.
ENDIF.
04-04-2013 1:57 PM
04-04-2013 2:01 PM
04-05-2013 6:54 AM
Hi,
I am little bit confused with your question.
You can use the FM RZL_READ_DIR_LOCAL to get all the files (name and path) are in a directory.
To read the content of each file you have to use OPEN DATASET.
Thanks
Subhankar
04-05-2013 7:16 AM