Topic: 从服务器上,读某个文件夹下的所有文件的名字的方法

ERP俱乐部

第 1 页 总共 1 页 [共有 3 条记录]


Posted by yxy on 2009-02-05 10:19 上午
各位牛人,请问从服务器上,读出某个文件夹下所有的文件名字应该怎么做?
有没有什么function 或者 method?       急
谢谢了。

Posted by abapsydney on 2009-02-11 02:03 下午
* read the contents of the I Folder
CALL 'SYSTEM' ID 'COMMAND' FIELD w_comm
ID 'TAB' FIELD it_dir-*sys*.

LOOP AT it_dir.
* Clear the Int tables and the STRING variables
FREE it_data.
CLEAR: w_line,
w_line1.
* Build the Filename
CONCATENATE w_fpath_in it_dir-line...INTO w_fname_in.
CHECK w_fname_in NE space.
* check to see if file exists
OPEN DATASET w_fname_in FOR INPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc EQ 0.
ELSE.
 .....
CONTINUE.
ENDIF.
CLOSE DATASET w_fname_in.
ENDIF.
ENDIF.

Posted by abapsydney on 2009-02-11 02:10 下午
or call FM RZL_READ_DIR_LOCAL get all subfolder and filename, then check whether it's a filename wiht OPEN DATASET ...