SAP Jobs
For understandability purposes, we use the following two terms on this page:
-
SAP Jobs are the Automic Automation Jobs that automate SAP processes on a target SAP system.
-
Native SAP jobs are the jobs that run on that SAP target system.
SAP Jobs replicate native SAP jobs in Automic Automation and start and monitor processes in the SAP target system. The native SAP jobs usually contain statements that start multiple processes in the SAP target system (sub jobs). Automic Automation reproduces this job structure; the SAP Job is the parent of those sub jobs (they are child processes) and serves as their container. To reproduce the job structure of native SAP jobs, SAP Jobs have an additional Child Post Process page where you can enter your script. This script is processed for each individual child process immediately after it has finished.
As happens with all other objects, Automic Automation is delivered with templates to create the following SAP Jobs:
-
R3
-
SAP_ABAP
-
SAP JAVA
The R3 and SAP_ABAP templates are identical. They have different templates to let you decide the name you want to apply to your Jobs based on what you are most familiar with.
When you execute the SAP Job, its children start and are displayed in the Tasks list in the Process Monitoring perspective. Their object type is JOBD (dynamic job) and each child has its own unique RunID. In the Process Monitoring perspective you can check the status of their corresponding jobs in the target SAP system. If they fail, you can restart them directly from the Process Monitoring perspective. You can also add comments, cancel, edit them, and open the list of objects in which they are being used.
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).
Prerequisites for a Successful SAP Integration
System administrators must set up the Automic Automation SAP integration. The integration results in the connection between Automic Automation and the SAP system using the SAP Agent. The Agent interprets and transforms the commands sent by the Client so that SAP understands them. For more information, 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:
Building the SAP Job Logic Using SAP Commands
SAP Job templates contain 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. The SAP Process pages contain an additional view called Forms, an intuitive and user-friendly way of depicting the values in a particular command. The Form view of a command can contain dropdown lists, input fields, radio buttons, and so on. For more information, see Process Pages and Forms View on the Process Page
Script Variables in SAP Jobs with BW Chains
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 page and are displayed in the Details pane of the tasks.
This list provides details on the Keys, the variables and their possible values:
-
LOGID
-
Variable name: &@sap_bw_logid#
-
Value on chain level: "Logging Identifier of the Process Chain, (for example, DAUDN8Z697MBBFNJ4Q75JS80C)."
-
Value on step level: "Logging Identifier of the Process Chain (for example, DAUDN8Z697MBBFNJ4Q75JS80C)."
-
Value on step job level: "Logging Identifier of the Process Chain (for example, DAUDN8Z697MBBFNJ4Q75JS80C)."
-
-
NAME
-
Variable name: &@sap_bw_name#
-
Value on chain level: Technical Name of the Process Chain (for example, Z_NI)
-
Value on step level: Technical Name of the Process Chain (for example, Z_NI)
-
Value on step job level: Technical Name of the Process Chain (for example, Z_NI)
-
-
ID
-
Variable name: &@sap_bw_id#
-
Value on chain level: empty
-
Value on step level: "Technical Identifier of the Step (for example, DAUDN966N6KGDOWMEAPP5TFV0)"
-
Value on step job level: "Technical Identifier of the Step (for example, DAUDN966N6KGDOWMEAPP5TFV0)"
-
-
STEPNAME
-
Variable name: &@sap_bw_stepname#
-
Value on chain level: empty
-
Value on step level: Technical Name of the Step (e.g. RSM04000_ALV)
-
Value on step job level: Technical Name of the Step (e.g. RSM04000_ALV)
-
-
TYPE
-
Variable name: &@sap_bw_type#
-
Value on chain level: empty
-
Value on step level: Process Step Type (e.g. ABAP)
-
Value on step job level: Process Step Type (e.g. ABAP)
-
-
STATUS
-
Variable name: &@sap_bw_status#
-
Value on chain level: empty
-
Value on step level: Job Status of the Chain Step (e.g. F)
-
Value on step job level: Job Status of the Chain Step (e.g. F)
-
-
JOBNAME
-
Variable name: &@sap_bw_jobname#
-
Value on chain level: empty
-
Value on step level: empty
-
Value on step job level: SAP Job Name of the job (e.g. BI_PROCESS_TRIGGER)
-
-
JOBCOUNT
-
Variable name: &@sap_bw_jobcount#
-
Value on chain level: empty
-
Value on step level: empty
-
Value on step job level: SAP Job Count of the job (e.g. 13450100)
-
-
TYPE_TEXT
-
Variable name:&@sap_bw_type_text#
-
Value on chain level: "E_TYPE_TEXT of RSPC_API_PROCESS_GET_INFO (e.g. Processkette lokal)"
-
Value on step level: "E_TYPE_TEXT of RSPC_API_PROCESS_GET_INFO (e.g. Startprocess)"
-
Value on step job level: "E_TYPE_TEXT of RSPC_API_PROCESS_GET_INFO (e.g. Startprocess)"
-
-
VARIANT_TEXT
-
Variable name: &@sap_bw_variant_text#
-
Value on chain level: "E_VARIANT_TEXT of RSPC_API_PROCESS_GET_INFO (e.g. Chain with nested chain)"
-
Value on step level: "E_VARIANT_TEXT of RSPC_API_PROCESS_GET_INFO (e.g. Startni)"
-
Value on step job level: "E_VARIANT_TEXT of RSPC_API_PROCESS_GET_INFO (e.g. Startni)"
-
-
RESTART_COUNT
-
Variable name: &@restart_count#
-
Value on chain level: "number of restarts by BW_SET_CONSTRAINT, or 0 if not yet accessible"
-
Value on step level: "number of restarts by BW_SET_CONSTRAINT, or 0 if not yet accessible"
-
Value on step job level: "number of restarts of the parent by BW_SET_CONSTRAINT, or 0 if not yet accessible"
-
-
RESTART_COUNT_MAX
-
Variable name: &@restart_count#
-
Value on chain level: "number of restarts by BW_SET_CONSTRAINT, or 0 if not yet accessible"
-
Value on step level: "number of restarts by BW_SET_CONSTRAINT, or 0 if not yet accessible"
-
Value on step job level: "number of restarts of the parent by BW_SET_CONSTRAINT, or 0 if not yet accessible"
-
Defining SAP Jobs
-
In the Process Assembly perspective click Add Object. On the Add Object dialog, select one of the SAP templates. For information on how to add objects, see Adding Objects.
An SAP object definition is made up of the following pages:
- Standard pages that are always available, no matter what type of object you are defining:
- Additional pages that are always available for executable objects:
SAP Process pages have an additional Forms view, see Forms View on the Process Page Also, SAP Jobs have an extra Child Post Process page. You build the logic of the child processes on this page.
- Attributes Page
- Registering External Output Files
- Variables Page
- Prompt Sets Page
- Rollback Page
- The SAP page described here.
Note: You can also create SAP Jobs directly from the Using AWI Combo Boxes that serve to select objects.
-
On the Object Name dialog enter the name of the new object. Choose it carefully. For more information, see Best Practices: Naming Conventions.
-
Click OK to open the object definition pages.
-
Each SAP Job template contains fields and options that are specific to the type of SAP Job. Click the links below for a description of each template:
Defining SAP ABAP Jobs
You can use the options available on the SAP page for native ABAP jobs for every case in which the SAP Agent creates a background job in the SAP system at runtime. However it is not necessary for Automic Automation to create an SAP background job for every use case. Copying a variant, for example, does not require an SAP 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 native SAP job might create multiple SAP background jobs at runtime. Applying the function for SAP ABAP program submission twice (R3_ACTIVATE_REPORT) within one SAP Job would lead to the creation of two SAP background jobs by default. In this case, the SAP Job properties in the Start Parameters and Spool List Recipient sections of the SAP Job definition are applied to every background job in SAP. If defined, both Jobs have the same job name in SAP.
This section describes the SAP ABAP-specific parameters in SAP Jobs:
Start Parameters section:
-
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)
For more information, see 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.
Tip: Assign Job ClassA (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. When this option is activated, the job is no longer visible in your Process Monitoring perspective as soon as the job is completed. This is useful in case of multiple jobs that run at short intervals.
Tip: If you want to have access to the tasks not only from the Automation Engine but also from your SAP system, deactivate 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.
- Do not delete job
-
Login Override
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.
- As soon as possible, possible fallback to SAP system
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:
- for 4.6C - SAPKB46C52
- for 6.20 - SAPKB62059
- for 6.40 - SAPKB64017
- for 7.00 - SAPKB70008
Defining 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. It also allows you to create an SAP Java Job in Automic Automation 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.
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.
This section describes the SAP Java-specific parameters in SAP Jobs:
SAP Java Jobs 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 Automic Automation 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.
This section describes the SAP Java-specific parameters in SAP Jobs:
-
In Start Parameters > Job Definition select the SAP Java job available in the SAP Scheduler. The input and/or selection fields that correspond to the selected job are displayed below.
-
If the native SAP job has sub jobs, in Job Settings you specify how to handle those sub jobs as well as the logs created in SAP. You have the following options:
To determine how to handle the sub jobs:
- Activate Job Children: Wait for Children if you want this SAP Job to wait for the sub jobs to end. Only when they end will this SAP Job also end.
- Activate Job Children: Abort when child aborts if you want the SAP Job to abort as soon as a sub job in the SAP system aborts.
- The SAP Job 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), activate Job Children: Replicate Children.
To determine how to handle the logs of those sub jobs:
- Activate Job Log > Delete after x days and enter a value to remove the job jog from the Java Scheduler after the specified number of days.
- Activate Job Log > Do not delete to keep the job jog in the Java Scheduler.
- Activate Job Log > Use default settings to use the settings specified in the job definition in SAP.
- In Fetch Size specify he number of lines of JXBP jobs to fetch.
For information on the Job Report section, see Job Reports.
Use Cases
See also: