!--a11y--> Prerequisites for Running External Programs
The prerequisites for
starting external commands and external programs from background jobs depend on:- Whether the remote shell functions (
remsh
or
rsh
) are available in the operating system. (They are not available in standard Windows NT systems)
- Whether an application server from the same SAP System is running on the target host system
If there is an SAP server on the target host for an external program, then the SAP gateway on that server is called and starts SAPXPG, the external program controller. If there is no server on the target host, then the gateway at the SAP server running the background job uses a remote shell facility to start SAPXPG on the target host.
UNIX and Other Systems with a Remote Shell
Systems with a remote shell can run an
external command or program without an active SAP application server. With no application server present, the gateway uses the remote shell and RFC to start the SAPXPG program. SAPXPG, in turn, runs the external command or program.The prerequisites for running an external command or program depend on whether the target host has an SAP application server or not.
If an application server from the same SAP System is running on the target host, then the following requirements must be met:
- The user with which the SAP gateway was started (usually the standard SAP host system user <sid>adm, such as c11adm) must have permission to run the external program.
- The command or program must either:
- Lie in the standard search path of the target system
- Lie in the search path of the SAP standard user
- Be entered with an absolute path name in the job step or external command definition.
If no application server is present, then the following apply:
- If you do not have the remote shell
remsh
on your systems, then you must set the profile parameter
gw/remsh in the instance profile of the application server on which the job is running to the name of your remote shell program, for example, ‘
rsh
’.
On a UNIX system you can use the command
which rsh
or
which remsh
to find out which remote shell program is available. You may need to specify the complete path name of your remote shell program in the profile parameter
gw/remsh.
- The user with which the gateway was started (usually the standard SAP <sid>adm user, such as c11adm) must exist on the remote host
- The SAP control program sapxpg must be found in the search path of the standard SAP user on the remote host. SAPXPG is stored in the SAP executables directory.
If the external program was not specified with an absolute path name, then the external program must also be found in the search path of the standard SAP user. In UNIX you can check this in the standard user by calling the following command:
which <program name>
while logged on as the standard user.
Both the SAP control program sapxpg and the external program to be started must be executable under the standard SAP user. For example, on a UNIX machine this means that <sid>adm must have execute permission (‘x’) for the programs.
The host on which the job is running must have permission to start programs on the remote host. There has to be an appropriate entry in the .rhosts file in the home directory of the gateway ID on the remote host. This consists of a line including the name of the host on which the job is running.
For more information, read the documentation, such as the UNIX man pages, about the remote shell (
remsh
).You can test this by entering the command ‘remsh <Name of remote host> date’ on the host on which the job is running. On a UNIX platform, the output should then be the system date on the remote host.
There is one special case: Assume that you have set up the environment on a UNIX system correctly for starting external programs by way of an SAP application server. However, the SAP system is started using an operating system specific mechanism.
You must, therefore, ensure that the user’s path names are set up correctly for the current system environment. For example, if the Bourne shell is being used, the paths are entered into the .profile file. The use of the C-Shell (csh) is assumed.
For example, the UNIX command ‘cron’ allows you to execute a command at a defined time, including the commands to start or stop an SAP system. This uses the Bourne shell (program ‘sh’) for executing a command. The user-specific settings which define the environment in which the command is to be executed—that is, the path names mentioned above—are then stored in the .profile file in the user’s home directory.
Microsoft Windows NT
To start an external command or program on a Windows NT system, the following requirements must be met:
- An SAP application server from the same SAP System must be running on the host on which the external command or program is to run.
In systems without
remsh
, like Windows NT, the SAP gateway must use an SAP application server to start the SAPXPG program. (SAPXPG, in turn, runs the external command or program.)
- The external command is run by the user that started the SAP application server on the target host. This is usually the standard SAP host system user <sid>adm, such as c11adm. This user must have permission to run the external program.
- The command or program must either:
- Lie in the standard search path of the target system
- Lie in the search path of the SAP standard user
- Be entered with an absolute path name in the job step or external command definition.
OS/400
To start an external command or program on an IBM OS/400 system, the following requirements must be met:
- An SAP gateway service must be running on the AS/400 on which the external program is to run, which will be the case wherever an SAP application server is running on AS/400.
- The external program is run under the user profile that is used to start the SAP standalone gateway/server, which is to say the OS/400 user for SAP. This user must be authorized for the SAPXPG command and the external program.
- SAPXPG must be found in the library list of the OS/400 user for SAP.
- If the path to the external program is not absolutely specified, then the command must be found in the library list of the OS/400 user for SAP.