Show TOC

Procedure documentationDefining 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.

Prerequisites

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 Programs.

Procedure

  1. Choose Start of the navigation path CCMS Next navigation step Configuration Next navigation step External Commands End of the navigation path (Transaction SM69). This displays a list of the commands that are already defined.

  2. Choose Start of the navigation path Command Next navigation step list Next navigation step Display <-> Change End of the navigation path to enter the change mode.

  3. Choose either the Create or Change function.

  4. To create a command, fill out the fields in the definition screen as follows:

    • 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.

    • Type:

      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 are retained, copy the SAP command and make the changes to the copy. The copy is assigned to the type Customer, that is, it is 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.

    • Trace:

      Leave this field blank. To trace the execution of an external command, use the Trace parameter for function module SXPG_COMMAND_EXECUTE in Programming with External Commands.

    • Check 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 additional authorization check, see SXPG_DUMMY_COMMAND_CHECK: Interface for Special Check Module.

  5. Save the external command and exit.

  6. Be sure to give your users appropriate authorization to schedule the external command in background jobs. See Authorizations for Background Processing.