Skip to Content
0
Former Member
Jan 17, 2012 at 01:33 PM

Scan a directory on application server with LONG file names

2872 Views

Hi all,

I need to get the list of all files on a directory on the application server, but I can't find any satisfying method, because the directory name may be long and the filenames too.

- Function modules RZL_READ_DIR and RZL_READ_DIR_LOCAL : the output table contains file names up to 32 CHAR only

- Function module EPS_GET_DIRECTORY_LISTING : the directory name is 60 CHAR only, and the output table contains file names up to 40 CHAR only

- Following instruction is perfect, but is reserved for internal use only :

CONCATENATE 'ls' w_directory INTO w_unixcommand  SEPARATED BY space.
CALL 'SYSTEM' ID 'COMMAND' FIELD w_unixcommand
              ID 'TAB'     FIELD wt_files[].

SAP recommend to replace CALL instructions with methods from classes, but I can't find any.

Please do you have any solution ?

Thanks in advance.