In some cases OS commands might be needed to perform maintenance work. It can also be misused by hackers.
Questions that will be answered in this call are:
- How to fire OS commands via SM49 or SM69?
- How to fire OS command via program RSBDCOS0?
OS commands via SM49 and SM69
OS commands can be defined and executed using transaction SM49 or SM69:
You can use the SAP standard commands and define your own Z commands.
Issues with external commands? Read OSS note 1328083 – An external command behaves differently than expected.
OS command to Stop SAP system
A simple command defined in SM69 called ZSTOPSAP:
/usr/sap/hostctrl/exe/sapcontrol
-nr XX -function Stop
With XX the system number (look up in SMMS).
Execute the command in SM49 or from ABAP, and the system will simply go down as per the executed command instruction.
OS command via ABAP program RSBDCOS0
There is also an ABAP program to fire external commands: RSBDCOS0. OSS note for this program: 2443193 – Report RSBDCOS0 – Execute OS command from SAP GUI.
Start the program and enter the command (in this case ls command):
Output is shown:
The action is registered in the SM21 system log:
See also OSS note 117657 – Reports RSBDCOS0, RSNNUXCD are deleted or changed.