在ABAP中使用函数 module调用外部操作系统命令,并使用外部命令查找AL11的目录路径。以下是一个示例代码:
DATA: lv_command TYPE string, lt_result TYPE STANDARD TABLE OF string.
lv_command = 'ls /usr/sap/trans/data'.
CALL FUNCTION 'SXPG_COMMAND_EXECUTE' EXPORTING commandname = lv_command
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
system_failure = 10
communication_failure = 11
authorization_error = 12
others = 13
.
IF sy-subrc <> 0.
LOOP AT lt_result INTO DATA(lv_result). WRITE: / lv_result. ENDLOOP.
运行后,在表格中将列出/var/sapmnt/目录下的所有目录和文件。选择正确的目录,您可以在AL11中添加或查看其中的文件。
上一篇:Abap:Selectthesamefieldfromtwodbtablesintoonecolumnoftheinternaltablewithoneselect。
下一篇:ABAP报表的用户访问控制