1.
DATA: commtext(120) ,
itab(255) OCCURS 10 WITH HEADER LINE.
commtext = 'ls /usr'.
CALL 'SYSTEM'
ID 'COMMAND' FIELD commtext
ID 'TAB' FIELD itab-*sys*.
LOOP AT itab.
WRITE itab.
ENDLOOP.
2.
看函数组:SXPT
例子:
REPORT z_barry_test7.
DATA : itab_btcxpm LIKE btcxpm OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'SXPG_CALL_SYSTEM'
EXPORTING
commandname = 'LIST_DB2DUMP'
additional_parameters = '/usr'
TABLES
exec_protocol = itab_btcxpm
EXCEPTIONS
no_permission = 1
command_not_found = 2
parameters_too_long = 3
security_risk = 4
wrong_check_call_interface = 5
program_start_error = 6
program_termination_error = 7
x_error = 8
parameter_expected = 9
too_many_parameters = 10
illegal_command = 11
OTHERS = 12.
LOOP AT itab_btcxpm .
WRITE / itab_btcxpm-message .
ENDLOOP.
阅读(4660) | 评论(2) | 转发(0) |