[java]
*———————————————————————*
*Report READ_DIRECTORY
*———————————————————————*
*调用UNIX命令 ls -l 显示指定服务器路径下的文件列表
*———————————————————————*
REPORT READ_DIRECTORY.
selection-screen begin of block ucmd with frame title text-001.
parameters: unixdir like rlgrap-filename. ” 输入服务器路径
selection-screen end of block ucmd.
data: begin of tabl occurs 500,
line(400),
end of tabl.
data: wa_line(400) type c.
*———————————————————————-
start-of-selection.
refresh tabl.
* 调UNIX命令读取路径,结果写到内表中
concatenate ‘ls’ ‘-l’ unixdir into unixdir
separated by space.
call ‘SYSTEM’ id ‘COMMAND’ field unixdir
id ‘TAB’ field tabl[].
* 结果写到屏幕
loop at tabl into wa_line.
write: / wa_line.
endloop.
[/java]