Skip to main content

SAP Multi-Step Jobs (SAPJobV2)

You can run SAP background jobs from JAMS. JAMS has an SAPJobV2 Execution Method that defines an SAP background job made up of one or more ordered steps, submits it to SAP, waits for it to finish and reports the outcome back to JAMS. The Job log displays the SAP job number, which matches the entry in the SAP system.

Each step is one of three types:

  • ABAP - Runs an ABAP program, optionally with a Variant.
  • Command - Runs an external command defined in SAP.
  • Program - Runs an external program on the target server.

You can create, view and edit SAPJobV2 Jobs in the Web Client. A Job saved in the Web Client opens in the JAMS Desktop Client with all values intact, and the reverse.

Before You Begin​

Review the following before you create the Job:

  • You need an SAP Connection in the Connection Store. See Adding an SAP Connection.
  • The SAP system must be reachable from JAMS through that Connection.
  • The SAP user in the Connection's Credential must have permission to schedule background jobs in SAP.

SAP lookups​

When you edit a step, the Web Client reads some values from the SAP system through the selected SAP Connection:

  • Name - ABAP programs for an ABAP step, or external commands for a Command step. A Program step has no list, because the program is on the target server rather than in SAP.
  • Variant - The Variants of the ABAP program entered in the Name field. The list is loaded after a Name is entered.
  • Output Device - The output devices configured in SAP, for an ABAP step.

The lists are filled only when an SAP Connection is selected and the SAP system can be reached through it. If it cannot be reached, the lists stay empty and no message is displayed. Each field still accepts a typed value, and the Job can still be saved.

Creating Credentials in JAMS​

You need two Credentials in JAMS to run an SAPJobV2 Job:

  • A Credential that holds the SAP username and password. It is selected on the SAP Connection, and it must have the same username and password as the user in SAP.
  • A Credential used to run the Job (Execute As). It is selected on the Job's Properties tab.

Adding a Credential for the SAP Connection​

  1. Click Environment in the left sidebar.
  2. Click Credentials.
  3. Click Add.
  4. In the Display Name field, enter a name for the Credential.
  5. In the Logon Username field, enter the SAP username.
  6. In the Password and Reenter Password fields, enter the SAP password.
  7. Click Save & Return.

Select this Credential in the Credentials field when you add the SAP Connection.

Adding a Credential for Running the Job​

  1. Click Environment in the left sidebar.
  2. Click Credentials.
  3. Click Add.
  4. In the Display Name field, enter a name for the Credential.
  5. In the Logon Username field, enter the username that runs the Job, such as DOMAIN\username.
  6. In the Password and Reenter Password fields, enter the password.
  7. Click Save & Return.

For more information, see Credentials.

Creating an SAP Multi-Step Job​

  1. Click Jobs from the main menu.
  2. Click a Folder in the Folder Navigator where the Job will be saved.
  3. Click Add.
  4. In the Job Name field, enter a name for the Job.
  5. In the Execution Method field, select SAPJobV2.
  6. Click Save & Continue.
  7. Click the Source tab. The Source tab has three sections: General, Spool List Recipient and Job Steps.
  8. Complete the General section.
  9. Optionally, complete the Spool List Recipient section.
  10. Add one or more steps in the Job Steps section.
  11. Click Save.
  12. Click the Schedules tab to add schedule items to set when the Job will run.
  13. Click the Properties tab.
  14. In the Agent field, select the Agent if the Job will not run on the Scheduler.
  15. In the Execute As field, select the JAMS Credential to run the Job.
  16. Click Save.

General​

FieldDescription
SAP ConnectionThe SAP Connection from the Connection Store. The step lookups use this Connection.
Job NameThe name of the background job in SAP.
Job ClassThe scheduling priority of the job in SAP: High, Middle or Low. The default is Low.
Target ServerThe SAP application server where the job runs. Leave it empty to let SAP select the server and balance the load.
Wait For Child JobsWhen selected, the Job waits for the child jobs to finish before it completes. When cleared, the Job can complete before its child jobs finish. Selected by default.
Execute ImmediatelyWhen selected, SAP starts the job immediately. When cleared, SAP starts the job as soon as possible. Cleared by default.

Spool List Recipient​

A Job has one spool list recipient. To send the spool list, enter the recipient in the Address field and select any of the options.

FieldDescription
AddressThe recipient of the spool list.
CopySends the spool list as a copy.
Blind CopySends the spool list as a blind copy.
ExpressSends the spool list as an express message.
No ForwardingPrevents the recipient from forwarding the spool list.

The checkboxes are cleared by default.

Job Steps​

The Job Steps table lists the steps in the order they run. It has these columns:

  • # - The position of the step. SAP runs the steps in this order.
  • Step Type - ABAP, Command or Program.
  • Name - The ABAP program, external command or program.
  • Variant / Parameters - The Variant for an ABAP step, or the Parameters for a Command or Program step.
  • Actions - The actions menu for the step.

When a Job has no steps, the table displays "This Job has no steps."

To manage the steps:

  • Add a step - Click Add above the table. The Add Step drawer opens. The new step is added to the end of the list.
  • Edit a step - In the Actions column, open the menu for the step and click Edit. The Edit Step drawer opens.
  • Remove a step - In the Actions column, open the menu for the step and click Remove, then click Remove to confirm.
  • Reorder steps - In the Actions column, open the menu for the step and click Move Up or Move Down. Move Up is disabled for the first step and Move Down for the last.

Changes to the steps are kept only when you save the Source tab. The order is saved with the Job and is the order the steps run in.

Step Drawer​

The step drawer has three sections: Step, Options and Output. Click Save to apply the step to the table, or Cancel to discard the changes.

The fields that are enabled depend on the Step Type:

Field or sectionABAPCommandProgram
VariantEnabledDisabledDisabled
ParametersDisabledEnabledEnabled
Operating SystemDisabledEnabledDisabled
Target ServerDisabledEnabledEnabled
Options sectionDisabledEnabledEnabled
Output sectionEnabledDisabledDisabled

A new step opens with no Step Type selected. Until you select one, the Variant, Parameters and Operating System fields are disabled, and the Options and Output sections are enabled.

Step​

FieldDescription
Step TypeABAP, Command or Program.
NameThe ABAP program, external command or program to run. For ABAP and Command steps, select it from the list loaded from SAP or enter it. For a Program step, enter it.
VariantThe Variant of the ABAP program. The list depends on the Name; it is loaded from SAP after a Name is entered.
ParametersThe parameters passed to the command or program.
Operating SystemThe operating system where the command runs. Up to 64 characters.
Target ServerThe server where the step runs. Up to 32 characters.
User NameOptional. The SAP user that runs the step. This user does not need a Credential in JAMS.

Options​

These options apply to external commands and programs. For more information, see the SAP documentation.

FieldDescription
Log outputWrites the standard output of the command or program to the SAP job log. Selected by default.
Log errorsWrites the standard error output of the command or program to the SAP job log. Selected by default.
Wait for terminationRuns the command or program synchronously, so SAP waits for it to finish. Selected by default.
Enable TraceTurns on SAP trace level 3 for SAPXPG, the program that starts the external command or program. Cleared by default.

Output​

These fields control the print output of an ABAP step.

FieldDescription
Output DeviceThe output device configured in SAP. Select it from the list loaded from SAP or enter it.
Format TypeThe format of the output.
TitleThe title of the output. Up to 68 characters.
DepartmentThe department name. Up to 12 characters.
CopiesThe number of copies. The default is 1.
Start PageThe first page to print. The default is 0.
End PageThe last page to print. The default is 0.

Saving and Validation​

No field on the Source tab is required by the Web Client. You can save a Job Source that is incomplete, such as one with no steps, a partly configured step, or an empty Spool List Recipient Address. Such a Job may not run successfully, so review the Source before you schedule the Job.

Validation errors returned by the JAMS REST API are displayed on the form.