There are three programming techniques that are likely to be useful in application programs:
· Execute an external command: express method.
With SXPG_CALL_SYSTEM, you can check the user’s authorization for the specified command and run the command. The command runs on the host system on which the function module is executed. The function module is RFC-capable. It can therefore be run on the host system at which a user happens to be active or on another designated host system at which an SAP server is active.
· Read external operation system commands into internal tables:
– SXPG_COMMAND_LIST_GET: Select a list of external command definitions.
– SXPG_COMMAND_DEFINITION_GET: Read the definition of a single external command from the SAP system’s database.
· Execute an external command after first checking the user’s authorization to use the command.
– SXPG_COMMAND_CHECK: Check whether the user is authorized to execute the specified command on the target host system with the specified arguments.
– SXPG_COMMAND_EXECUTE: Check a user’s authorization to use a command, as in SXPG_COMMAND_CHECK. If the authorization check is successful, then execute the command on the target host system.
Maintaining external commands should be carried out by way of the standard SAP function (transaction SM69), not with additional programs that use the maintenance function modules. You should also note that the Computing Center Management System) offers a standard transaction for running an external command (transaction SM49).