Code: Alles auswählen.
REPORT zdir.
* Global Variables. *
DATA: BEGIN OF filelist OCCURS 0,
onefileline(2000),
END OF filelist.
DATA: line LIKE filelist-onefileline.
DATA: paraline(20) TYPE c VALUE 'ls -l /tmp/*'.
START-OF-SELECTION.
* Call and collect DATA.
CALL 'SYSTEM' ID 'COMMAND' FIELD paraline
ID 'TAB' FIELD filelist-*sys*.
* print filelist.
LOOP AT filelist.
WRITE filelist-onefileline.
ENDLOOP.
Code: Alles auswählen.
REPORT zdir.
* Global Variables. *
DATA: BEGIN OF filelist OCCURS 0.
* onefileline(2000),
INCLUDE STRUCTURE epsfili.
DATA END OF filelist.
*DATA: line LIKE filelist-onefileline.
DATA: paraline(20) TYPE c VALUE 'ls -l /tmp/*'.
START-OF-SELECTION.
* Call and collect DATA.
* CALL 'SYSTEM' ID 'COMMAND' FIELD paraline
* ID 'TAB' FIELD filelist-*sys*.
CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
EXPORTING
dir_name = '/tmp'
* FILE_MASK = ' '
TABLES
dir_list = filelist
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 .
* print filelist.
LOOP AT filelist.
WRITE: / filelist-name, filelist-size.
ENDLOOP.