Defining External Commands
Use external commands to allow your background processing users to schedule external executables (commands, scripts) in job steps. For more information on external commands and external programs, see
External Commands and External Programs.
You must first be authorized to define external commands and your end users must also be authorized to schedule the external commands that you define. See
Authorizations for Background Processing. For external commands to be carried out, the host system on which a command is to run must also meet certain requirements. See
Prerequisites for Running External Commands and External Programs.
External Commands (Transaction SM69). This displays a list of the commands that are already defined.
Choose Command list ®
Display <-> Change to enter the change mode.
Choose either the Create or Change function.
To create a command, fill out the fields in the definition screen as follows:
Programming with External Commands.
- Command name:
Assign a name for your command. If you define versions of a command for more than one operating system, use the same name for each so the system can automatically select the correct version for the target system.
- Operating system:
If you need to define different versions of a command for different operating systems, select the appropriate operating system for the version you are defining. If a single version of the command will work on any operating system, enter ANYOS.
This field automatically shows whether the command was defined by you or by SAP.
Changes that you make directly to SAP commands may be overwritten. To ensure that such changes will be preserved, copy the SAP command and make your changes to your copy. This copy will have the type Customer, which means it will not overwritten by SAP upgrades and releases.
- Operating system command:
Enter the full path and name of the command unless the command resides in the path normally checked by SAPXPG, the program that starts external commands. Enter no other arguments for the command here; those will be entered in the Parameters field. This command can be any type of executable: program, script, .bat file, etc.
- Parameters for operating system command:
Enter the arguments or parameters for the command.
If no argument is needed when the external command is scheduled in a job, leave this field blank.
- Additional parameters allowed:
If users can specify additional arguments when they schedule an external command in a background job, mark this field. These additional parameters are added to any parameter string specified in the previous field, Parameters for operating system command.
Leave this field blank. To trace the execution of an external command, use the Trace parameter for function module
To define an extra authorization check for any external command, you must program it in a copy of a special function module.
If you have defined an extra authorization check, enter the name of the function module that makes the check here. The system calls the function module automatically if a user tries to schedule this external command in a background job. For more information on programming an extra authorization check, see
SXPG DUMMY COMMAND CHECK: Interface for Extra-Check Function Modules.
- Save the external command and exit.
- Be sure to give your users appropriate authorization to schedule the external command in background jobs. See
Authorizations for Background Processing.