SAP Jobs

This subtype of the JOBS object defines SAP-specific processing steps to be carried out in a target system. Like all other job objects (JOBS), SAP jobs can run independently or they can be added to a group (JOBG) or to a workflow. For details on the integration between the Automation Engine and SAP please refer to AE and SAP.

This topic provides information on the following:

Overview

Four templates are available for defining SAP Jobs, namely:

Template Includes
R3
  • Start Parameter, Job Report, and Spool List Recipient sections on the SAP page
  • The ability to add SAP commands on the Process tab as script or using forms
  • The ability to import SAP jobs on the Process tab using forms
  • A Child Post Process page
  • A link to Criteria Manager

The R3 and SAP_ABAP templates are identical. They are simply named differently to allow users to find the name they are more familiar with.

SAP_ABAP
SAP_JAVA
  • Start Parameter, Job Report, and Job Settings sections on the SAP page
  • The ability to add SAP commands on the Process tab as script or using forms
  • A Child Post Process page
  • A link to Criteria Manager
SAP_PI
  • A Job Report section on the SAP PI page
  • The ability to add SAP commands on the Process tab as script or using forms
  • A Child Post Process page
  • A link to Criteria Manager

The SAP page for a sample SAP_ABAP job is shown below.

Provided you have an active connection to the target SAP system, you can then execute the jobs from within the Automation Engine. You can check their status, restart or cancel them if necessary, retrieve reports created in SAP, etc.

SAP jobs have two peculiarities. On the one hand, an additional Process page ( SAP Jobs - Child Processes) is available where you enter the scripts to be processed as soon as an individual SAP child process ends. On the other, script editor on the Process page of SAP ABAP jobs contains an additional function in the case of SAP jobs, namely the possibility to build scripts using pre-defined sets of commands via forms. See SAP Forms.

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

Prerequisites to Start SAP Jobs from the Automic Web Interface

Thanks to the integration with SAP systems, you can execute jobs in SAP directly from within the Automation Engine.

Your Automation Engine system is connected to SAP via the 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 via the Automic Web Interface and execute them in the SAP client are providing the necessary connection and login data, namely:

  1. The agent binaries are installed and its INI file is configured to connect to the Automation Engine.
  2. The SAP Agent is defined
  3. At least one Connection (CONN) object provides the necessary data for connecting the agent to the SAP application server (the user and his/her login data). See Connection Object (CONN).

    Take the following into account:

    • For SAP ABAP jobs, you need a Connection object of type R3/Remote Function Call.
    • For SAP Java jobs, you need a Connection object of type R3/Internet.
  4. A Login (LOGIN) object is defined that provides the necessary credentials for the job to be executed. See Login Object (LOGIN).

Please refer to the Technical Connection chapter for detailed information.

Additionally, for SAP JAVA jobs, take into account that 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 Object (CONN).

SAP Jobs and Child Tasks

SAP commands can contain statements that start multiple processes. As happens with all other executable objects, each execution of a job or process in SAP is identified in the Automation Engine by a unique runID.

The SAP job you specify in the Automation Engine is the parent and serves as container for the actual processes; the object type of its children is JOBD. They are displayed as subordinate to the job in the Tasks list (Process Monitoring perspective) as follows:

Here you can check their status in the target system, add comments, restart and edit them as well as open the list of objects in which they are being used.

Please make sure that the Tasks list in the Process Monitoring perspective is in hierarchical view mode to be able to see the parent/child tree structure.

Child Processes

In addition to the Process pages common to all jobs, SAP jobs have an additional Child Post Process page; The script defined on this page is processed immediately after the child process itself finishes. See SAP Jobs - Child Processes.

Restarting SAP Jobs from the Automation Engine

If a job fails (its status is ENDED_NOT_OK), instead of initiating a new process request, you can simply restart it from the Task list in the Process Monitoring perspective.

See Monitoring and Restarting External Tasks.

Tracking SAP Jobs via the Remote Task Manager

The Remote Task Manager Object (JOBQ) allows you to display, start, cancel, intercept and monitor external operations, that is, operations that run on applications outside the Automation Engine.

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.

Please have a look at Important Considerations for SAP for additional information on SAP jobs and the Remote Task Manager.

SAP ABAP

The input fields and options available on this page for SAP ABAP jobs are designed to 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 simply be done with one single remote function call (BAPI_XBP_VARIANT_COPY) to the SAP system. In this case the attributes (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) subsequent within one Automic job would lead to the creation of 2 SAP background jobs by default. In this case the attributes (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 following 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.

Key Variable Name Value On Chain Level Value On Step Level Value On Step Job Level
LOGID &@sap_bw_logid# "Logging Identifier of the Process Chain (e.g DAUDN8Z697MBBFNJ4Q75JS80C)." "Logging Identifier of the Process Chain (e.g DAUDN8Z697MBBFNJ4Q75JS80C)." "Logging Identifier of the Process Chain (e.g DAUDN8Z697MBBFNJ4Q75JS80C)."
NAME &@sap_bw_name# Technical Name of the Process Chain (e.g. Z_NI) Technical Name of the Process Chain (e.g. Z_NI) Technical Name of the Process Chain (e.g. Z_NI)
ID &@sap_bw_id# empty "Technical Identifier of the Step (e.g. DAUDN966N6KGDOWMEAPP5TFV0)" "Technical Identifier of the Step (e.g. DAUDN966N6KGDOWMEAPP5TFV0)"
STEPNAME &@sap_bw_stepname# empty Technical Name of the Step (e.g. RSM04000_ALV) Technical Name of the Step (e.g. RSM04000_ALV)
TYPE &@sap_bw_type# empty Process Step Type (e.g. ABAP). Process Step Type (e.g. ABAP).
STATUS &@sap_bw_status# empty Job Status of the Chain Step (e.g. F) Job Status of the Chain Step (e.g. F)
JOBNAME &@sap_bw_jobname# empty empty SAP Job Name of the job (e.g. BI_PROCESS_TRIGGER)
JOBCOUNT &@sap_bw_jobcount# empty empty SAP Job Count of the job (e.g. 13450100)
TYPE_TEXT &@sap_bw_type_text# "E_TYPE_TEXT of RSPC_API_PROCESS_GET_INFO (e.g. Processkette lokal)" "E_TYPE_TEXT of RSPC_API_PROCESS_GET_INFO (e.g. Startprocess)" "E_TYPE_TEXT of RSPC_API_PROCESS_GET_INFO (e.g. Startprocess)"
VARIANT_TEXT &@sap_bw_variant_text# "E_VARIANT_TEXT of RSPC_API_PROCESS_GET_INFO (e.g. Chain with nested chain)" "E_VARIANT_TEXT of RSPC_API_PROCESS_GET_INFO (e.g. Startni)" "E_VARIANT_TEXT of RSPC_API_PROCESS_GET_INFO (e.g. Startni)"
RESTART_COUNT &@restart_count# "number of restarts by BW_SET_CONSTRAINT, or 0 if not yet accessible" "number of restarts by BW_SET_CONSTRAINT, or 0 if not yet accessible" "number of restarts of the parent by BW_SET_CONSTRAINT, or 0 if not yet accessible"
RESTART_COUNT_MAX &@sap_bw_max_restart_count# "max number of restarts BW_SET_CONSTRAINT, or 0 if not yet accessible" "max number of restarts by BW_SET_CONSTRAINT, or 0 if not yet accessible" "number of restarts of the parent by BW_SET_CONSTRAINT, or 0 if not yet accessible"

SAP Java Jobs

SAP Java jobs give you the possibility to handle jobs in the SAP Java Scheduler. A prerequisite for working with them is that the Java job definition 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. For example:

Depending on your selection here, the corresponding input and selection fields are displayed, where you can enter the values you need.

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.

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 the Java job's execution data. The error is logged in the "Agent Log" report of the job as well as in the SAP agent's log file. The job aborts with return code 403.

To Define an SAP Job

These instructions assume the following:

  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:

    ClosedFor SAP ABAP Jobs: Define the required values in the Start Parameters section

    The following table describes the available options:

    Field Description
    Language

    Language used in SAP.

    The code of the language you select here is passed on to SAP in uppercase letters. Please, keep this in mind when you set the language using the script (SAP_LANG attribute, :PUT_ATT script element)

    See also FAQ - SAP Language Settings

    Job Name

    Name of the job in SAP. It can contain up to 32 characters.

    If no job name is specified here, the default format is used by default:

    UC_JOB_RUN#

    Job Class

    This value specifies the priority that will be applied for handling jobs in SAP.

    When jobs are waiting for a free batch process in SAP to be executed, their priorities determine which jobs go first. Automic recommends assigning Job Class A (highest priority) to system jobs (basis, warehouse and maintenance jobs in SAP executed by system administrators) as these are prerequisites for all other jobs to run smoothly.

    Target System

    No specification or target system in SAP.

    This is the name of an SAP Server in the form "<host name>_<system ID>_<system no>". For example: "host31_T40_00". This SAP Server must contain work processes for batch processing.

    SAP recommends to not use these parameters because they invalidate "Workload Balance" for batch processes.

    Delete Job
    • Do not delete job

      The job is not deleted after it has been executed.

    • Always delete job in CCMS after completion

      The job is deleted in SAP after it has been executed. Deletion takes place in the CCMS (Computing Center Management System) which is a special application area for administrators.

      This is the default. Leaving it activated means that as soon as it is completed, the job is not visible in your Process Monitoring perspective anymore. This is useful in case of multiple jobs that run at short intervals. In other cases, however, you'll probably want to have access to the tasks not only from the Automation Engine but also from your SAP system. In this case, Automic recommends changing this parameter.

    • Only delete job from CCMS if no error occurred

      The job is deleted in SAP after it has been executed only if the execution was successful and error-free.

    Login Override

    Override agent login information with job login

    Activate this option to use the credentials defined here to log on into the SAP system instead of the agent login defined in the Attributes Page.

    Start Mode
    • As soon as possible, possible fallback to SAP system

      The system attempts to start the job as soon as possible.

      If there is no SAP background task available, the job is scheduled in the SAP system.

    • Immediately, abort if no SAP background task is available

      The system attempts to start the job immediately.

      The job aborts if there is no SAP background task (Type BTC) available.

    ClosedFor SAP ABAP Jobs: Define the required values in the Spool List Recipient section

    The following table describes the available options:

    Field Description
    Recipient Receiver of the message.
    Address Type Type of address.
    Report Send Status* This report returns the transmission status. The sender is informed whether the addressee has received the message.
    Report Status by Mail* The report on the transmission status is sent by e-mail.
    Copy The recipient obtains a copy of the message for information purposes.
    Blind Copy The recipient obtains a copy of the message that cannot be read by any other user.
    Send Express Express sending. As a result, a dialog is displayed in which you can switch to the inbox.
    No Printing* Printing the document is not allowed.
    No Forwarding The recipient is not allowed to forward the document to other users.

    * The following SAP support packages are required for using the options No printing, Report send status and Report status by mail:

    • for 4.6C - SAPKB46C52
    • for 6.20 - SAPKB62059
    • for 6.40 - SAPKB64017
    • for 7.00 - SAPKB70008

    ClosedFor SAP Java Jobs: Define the required values in the 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:

      The following table describes the available options:

      Field Description
      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.
      • Likewise, 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.

    ClosedDefine the required values in the Job Report section

    The following table describes the available options:

    Field Description
    Store to
    • Database: As soon as the job has been processed, the process log available on the target system is stored in the database.

      Job reports consist of:

      • the actual job report (LIST0SO)
      • the specification of the created spool file
      • the cover page with the selected parameters (if required)
    • File: The process log is stored as a file on the target system.

    You can select one option or both of them simultaneously.

    Generate

    Define when the operating system process log is written.

    • Always: The process log is always written.
    • On error only: The process log is written only when an error occurs, for example, when the job is canceled or aborted.
    Add

    These are optional reports retrieved from the SAP system. They are available for the SAP job but not for its children.

    • Agent log
    • Application logs (SAP ABAP jobs only)
    • Spool directory (SAP ABAP jobs only)
    • Step lists (SAP ABAP jobs only)
    • Statistics

    These reports can be long and complex. In a standard installation, client 0 is supplied with ready-to-use Style Sheet objects that contain the necessary code to format them and give them a user-friendly layout.

    See Style Sheet Object (XSL) as well as UC_REPORT_STYLESHEETS - Style Sheets for XML Reports.

     

  4. Switch to the Process page and enter your script here. In case of ABAP jobs you can use either the script editor or the Form view. See SAP Forms.

  5. Switch to the Attributes page.
  6. 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.

Use Cases

Take a look at the topics listed below for examples:

Next Steps

The list below tries to depict a possible road-map to define and work with Job objects and provides short descriptions of the actions you can take, additional information that can help you understand how they work and links to topics that further describe them:

  1. Define the job general settings, which include the following:

    • The basics, on the General Page.
    • If required, apply a Sync object to the job; You do so on the Sync Page.
    • On the Runtime Page specify the job runtime settings.
    • Fine-tune access rights at object level on the Managing Authorizations at Object Level.
    • Specify the object Attributes on the Attributes Page.
    • Register the output files that will be produced when processing them on the Output Page.
    • To be able to carry out searches in those output files and, if required, perform follow-up actions, specify these settings on the Output-Scan Page.
    • You may want to use variables or prompts. You do so on the Variables & Prompts Pages.
    • You may want to define the settings to backup and restore a job task when included in a workflow. This is useful to recover the last successful status in case of failed processes. You do this on the Rollback Page.
    • The Version Management Page lists all the versions of an object and allows you to restore it to an older version in case of a misconfiguration.
    • Enter information on the job you are defining on the Documentation Page.
  2. Job objects (JOBS) have three pages on which you enter the scripts to be processed. They provide a number of convenience functions to help you with your work. If you enter scripts on all of them, they are processed in the following order:

    1. Pre-Process Page
    2. Process Pages
    3. Child Post-Process (SAP and PeopleSoft only), see Child Post-Process Page.
    4. Post-Process Page
  3. You can easily reuse code using Include Object (JOBI), which saves time and helps you keep your scripts consistent.
  4. Execute the job.

    There are multiple ways to do this that can be grouped as follows:

    • By a parent task.

      This is the case of jobs that are included in a parent object (for example a Workflow or a Group). When defining them, take into account that their activation time can be different from their start time; the latter usually depends on the parent object.

      See Superordinate Tasks (Parents).

    • Stand alone

      This is the case when the job is not part of a parent object or, even if it is, you execute it independently of its parent. You have three possibilities:

    When executable objects are processed, they go through the following four stages: 1. Activation, 2. Generation, 3. Processing and 4. Completion. Take a look at these topics to understand what happens with every processing stage.

  5. When processing jobs, the Automation Engine generates output files and reports that guarantee traceability and auditability. Have a look at the following topics to learn more about this:

  6. Monitor the generated object.

    As soon as the job is activated, it is available as task in the Process Monitoring perspective. In the Task list you can see its status.

    Right-click it to open its monitor (see Monitoring Jobs); it contains three pages that provide the most important information on the job parameters.

    You can also access the Job Monitor from the Process Assembly perspective.

  7. In the Process Monitoring perspective a number of functions are available, depending on the status of the job. See Working with Tasks.

See also: