SAP Jobs

SAP Jobs start and monitor processes in the SAP target system. They can contain statements that start multiple processes (sub jobs). This job structure is replicated in the Automic Web Interface. The SAP Job you create in the Automation Engine is the parent of those sub jobs (child processes) and serves as their container.

When you execute the SAP Job, its children are started and displayed in the Tasks list in the Process Monitoring perspective with object type is JOBD and with its own unique RunID each. You can check their status in the target system, add comments, restart, cancel and edit them as well as open the list of objects in which they are being used.

For details on the integration between the Automation Engine and SAP see AE and SAP.

Tip: Take a look at Example: Creating an SAP ABAP Job from within the AE for an example of how to set up your system to execute an SAP job from within the Automation Engine.

This page includes the following:

SAP Templates

The following templates are available for defining SAP Jobs: R3, SAP_ABAP, SAP JAVA and SAP_PI.

The R3 and SAP_ABAP templates are identical. They are named differently to let you find the name they are more familiar with.

All templates allow you to perform the following actions:

R3 and SAP_ABAP jobs also allow you to import SAP jobs on the Process page using forms.

Prerequisites

Your Automation Engine system is connected to SAP using the SAP Agent, which interprets and transforms the commands sent by the Client so that SAP understands them. This means that the only prerequisites your system must meet to be able to create jobs using the Automic Web Interface and execute them in the SAP Client are:

When these prerequisites are met, you can start building the scripts on the Process page of the SAP Job object definition.

Important! For SAP JAVA Jobs, the Java job must be deployed in the Java Schedule. This makes it visible for the SAP Agent and allows you to define a Job object as instance of that job definition.

To Define an External Scheduler

  1. Open SAP NetWeaver Administrator.
  2. Go to Operations > Jobs > Java Scheduler.
  3. Click Add and enter a name and description.
  4. The User defined here must be set in the Connection (CONN).

SAP Commands

SAP Jobs in the Automation Engine are supplied with sets of predefined commands. A command is a group of SAP-specific strings or functions. You build the logic of an SAP Job on its Process page by adding commands to it. For more information, see Process Pages.

User-Friendly Scripting Using Forms

The script editor of the Process page in an SAP Job has two views. The usual one that is available for all Jobs, and the Form view. The Form view is an intuitive, user-friendly way of depicting the values you must enter for a particular command. The Form view of a command can contain dropdown lists, input fields, radio buttons, and so on. For more information, see Forms View on the Process Page.

SAP Child Processes

In addition to the Process pages common to all jobs, SAP provides an additional Child Post Process page. The script you enter on this page is processed for each individual child process immediately after it has finished.

Tracking External Jobs via the Remote Task Manager

Use the Remote Task Manager (JOBQ) to monitor processes that have not been started by the Automation Engine through an SAP Job.

In a Remote Task Manager object you collect the filter criteria that identify the external tasks that you want to control. The external processes that comply with those criteria (in this case, SAP jobs) are then displayed on the Tasks window of the Process Monitoring perspective as sub-tasks of the Remote Task Manager object (the hierarchical view must be activated for this purpose). Their object type is JOBD.

Important! Have a look at Important Considerations for SAP Processes for additional information on SAP jobs and the Remote Task Manager.

Restarting SAP Jobs from the Automation Engine

If a Job fails (its status is ENDED_NOT_OK), instead of initiating a new process request, restart it from the Task list in the Process Monitoring perspective. For more information, see Monitoring and Restarting External Tasks.

SAP ABAP Jobs

The options available on the SAP page for ABAP jobs can be used for every case in which the SAP Agent creates a background job in the SAP system at run time. However it is not necessary for the Automation Engine to create an SAP background job for every use case. Copying a variant, for example, does not require a job. This can be done with one single remote function call (BAPI_XBP_VARIANT_COPY) to the SAP system. In this case the job properties in the Start Parameters and Spool List Recipient sections are useless.

On the other hand, one SAP job might create multiple SAP background jobs at run time. Applying the function for SAP ABAP program submission twice (R3_ACTIVATE_REPORT) within one Automation Engine job would lead to the creation of two SAP background jobs by default. In this case, the job properties in the Start Parameters and Spool List Recipient sections would be applied to every background job in SAP. If defined, both jobs would have the same job name in SAP.

SAP BW: Data for Chain Steps Published as Script Variables

In SAP jobs with BW chains, the Agent creates the script variables for each child process. These variables and their values are available automatically in the (child) post process window and are displayed in the Details window of the tasks.

This list provides details on the Keys, the variables and their possible values:

SAP Java Jobs

SAP Java jobs allow you to handle jobs in the SAP Java Scheduler. To be able to work with them, the Java job definition must be deployed in the Java Scheduler. This makes it visible for the SAP Agent and allows you to create an SAP Java job in the Automation Engine that is an instance of the job in SAP.

Between the SAP Java job and the Automation Engine job there is a 1:1 relation.

In Start Parameter you select the Job Definition as available in the SAP Scheduler. For this purpose, and provided the connection with the SAP target system is available, clicking the browse button opens a picker dialog where you can select the SAP Java job.

In the Job Settings section, on the other hand, you determine how to handle the child jobs as well as the job logs created in SAP.

Note: SAP Java jobs can also contain sub processes. The SAP job you specify in the Automation Engine is the parent and serves as container for these child jobs. The object type of its children is JOBD. If you want them to be displayed as subordinate to the job in the Tasks list (Process Monitoring perspective), you must activate the Replicate Children checkbox.

Special Cases

In an environment with several nodes, the Java Scheduler jobs are processed on the node on which the Scheduler Service is active. If this node is deactivated or fails, job processing continues on a different node.

The agent periodically attempts to re-establish the connection to the Java Scheduler if it has been lost during job execution. The job remains active in the Automation Engine and with status Waiting for remote system.

The job aborts if calling the Java Scheduler results in an error. In this case, there is no report about its execution data. The error is logged in the job "Agent Log" report and in the SAP Agent log file. The job aborts with return code 403.

Defining SAP Jobs

An SAP Job definition is made up of the following pages:

Tip: Some SAP Job reports can be very long. The Automation Engine supplies ready-to-use Style Sheet objects that you can use to format them. For more information, see Style Sheet (XSL).

To Define an SAP Job

Prerequisites:

  1. In the Process Assembly perspective click Add Object. In the dialog scroll down to expand the Job (JOBS) list and select one of the available templates.
  2. Enter a name and click Add Object.
  3. The SAP Job definition pages open up displaying the SAP-specific one. Define the settings for SAP ABAP or SAP Java Jobs as described below.

  4. Go to the Process Pages and enter your script there.

  5. Switch to the Attributes Page and specify the Execution Settings. This is where you establish the relationship between the Job, the Agent that will connect to the appropriate SAP Client and the Login object that contains the SAP credentials.

    You can easily check the settings of your job before executing it:

    1. Open the Explorer list in the Process Assembly perspective.
    2. Select the job and click the Details button on the toolbar.
    3. The key data on the job is displayed.

SAP ABAP Jobs

Start Parameters section:

Spool List Recipient section:

Define the basic details such as the Recipient, Address Typeetc. For using the Report Send Status, Report Status by Mail and No Printing options, the following SAP support packages are required:

SAP Java Jobs

Start Parameters and Job Definition sections:

  1. Click the browse button to the right of the Job Definition filed to open a picker dialog where you can select the SAP Java job. The input and/or selection fields that correspond to the selected job are displayed below.

  2. In Job Settings define the following:

    • Job Children

      The job in the SAP system can have sub jobs.

      • Activate Wait for Children if you want the Automation Engine job to wait for those sub jobs to end. Then, the Automation Engine can also finish.
      • Activate Abort when child aborts if you want the Automation Engine job to abort as soon as a sub job in the SAP system aborts.
      • The SAP job you specify in the Automation Engine serves as container for those sub jobs in SAP; the object type of its children is JOBD. If you want them to be displayed as subordinate to the job in the Tasks list (Process Monitoring perspective), you must activate Replicate Children.
    • Job Log

      • Activate and enter a value in Delete after x days to remove the job jog from the Java Scheduler after the specified number of days.
      • Activate Do not delete if you want to keep the job jog in the Java Scheduler.
      • Activate Use default settings to use the settings specified in the job definition in SAP.

      The job log is always deleted together with the job instance.

    • Fetch Size

      Specify here the number of lines of JXBP jobs to fetch.

For information on the Job Report section, see Job Reports.

Use Cases

Take a look at the topics listed below for examples:

See also: