A guide to
SAP S/4 S/4HAN HANA A Technical Techni cal Job J ob Repos Repos itory ito ry
© 2015 by SAP SE. All rights reserved. SAP, R/3, SAP NetWeaver, NetWeaver, Duet, PartnerEdge, PartnerEdge, ByDesign, SAP Business ByDesign, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and other countries. Business Objects and the Business Objects logo, BusinessObjects, Crystal Reports, Crystal Decisions, Web Intelligence, Intelligence, Xcelsius, and other Business Objects products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of Business Objects S.A. in the United States and in other countries. Business Objects is an SAP company.
Version: 2016-11-08
All other product product and service names names mentioned mentioned are the the trademarks trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary. These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes purposes only, without representation representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to
Table of Content
Table of Content 1.
Purp os e o f Techn ic al Jo b Repos it or y .................. ........................... .................. ................... ................... .................. .................. .................. .................. .................. .................. .............. ..... 3
2.
Design-Time component of Technical Job Repository ...................................................................................... 4
3.
Run-Ti me co mp on ent o f Tech ni cal J ob Repos it or y .................. ........................... .................. .................. .................. .................. ................... ................... .................. .........7
4.
A l oo k b ehi nd th e sc enes : Ho w d oes Tech ni cal Jo b Rep os it or y w or k? ................... ................. .................. .... 9
5.
Monit ori ng Technic al Job Reposit ory Operation s wit h SLG1 ....... ........... ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ...... .. 12
6.
Cust om izi ng Opt io ns f or Tech ni cal Jo b Repos it or y ............... ......................... ................... .................. .................. .................. .................. .................. .................. .........16
2
1. Purpose of Technical Technical Job Repositor Repositor y The Technical Job Repository in SAP S/4HANA S/4HANA was initially developed to support automatic (technical) background job scheduling in cloud-based SAP S/4HANA systems. systems. SAP needed a mechanism to run certain recurring recurring (=periodic) background jobs automatically in every S/4HANA system, without the need for external intervention or m onitoring. Technical Job Repository is also available in the on-Premise Edition of SAP S/4HANA and serves the same purpose there: to automatically schedule so-called technical background jobs which must be running in order to keep the system “healthy”. Examples for such background jobs (from SAP NetWeaver software component) are SAP_REORG_SPOOL, SAP_REORG_SPOOL, which deletes old spool requests, and SAP_REORG_JOBS, SAP_REORG_JOBS, which deletes old background jobs. This paper intends to give a guideline to system administrators of SAP S/4HANA on-Premise Edition with respect to automatic background job scheduling via Technical Jo b Repository. It introduces briefly the basic concepts of Technical Job Repository, certain runtime aspects (job scheduling, un -scheduling, monitoring of operations) and finall y describes options an administrator has to modify/customize background job scheduling via Technical Job Repository.
2. Design-Time Design-Time compo nent of Technical Technical Job Repository Repository Technical Job Repository has a design-time component (used by SAP development) which allows to create so-called Technical Job Definitions (in short: Job Definition or Jobdef) which are basicall y templates for recurring background jobs. These Job Definitions are created by SAP developers, using transaction SE80, and are transported via a logcal transport object (R3TR JOBD
) to all target systems.
Here is how a job definition looks like in SE80:
The Overview tab defines the report and report variant name which will be executed by the back ground job. Note: A job definition always carries the same name as the related background job which will eventually be created from it in a target system, so the content of fiel d background job name is identical to the name of the job definition. Some special information is necessary for the contents of field User Name: Almost every job definition you you will find contains the value (DEFAULT) in field User Name. This is actually a placeholder for the execution user that the run -time component will use when scheduling the background job. As default behaviour, Technical Job Repository will use SAP_SYSTEM as batch job step user if this user is available in the current client. If no such user exists, user DDIC will be used as batch job step user as a fallback solution.
4
Note: If you want a different user name (i.e. not SAP_SYSTEM nor DDIC) to be employed for all T echnical Jobs scheduled by Technical Job Repository in SAP S/4HANA, this SAP user name needs to be entered into table CLMS_TENANT, field JR_USER. Starting with NetWeaver Release 7.51, SAP has updated report R_JR_UTIL_1 to allow maintenance of this table entry in the current client. If you are running SAP S/4HANA based on NetWeaver Release 7.50 and require this functionality, you can update report R_JR_UTIL_1 via SNOTE, the relevant SAP Note is 2339022 Maintain Default Step User for SAP S/4HANA Job Repository (On-Premise scenario) You need to specify the user name in every client, since CLMS_TENANT is client-dependent (and so are SAP user definitions). Ensure that the background job step user you specify via report R_JR_UTIL_1 does indeed exist (and is unlocked) in the current client, otherwise Technical Jobs will never be scheduled successfully!
Let us move to the execution terms tab of a job definition:
A job definition thus allows the author to define the following attributes of the background background job: Attribute: Report Name Variant Name
Possible Values:
Comment: SAP-delivered job definitions can only use so-called system report variants which are client-independent 5
Execution Client
ADMIN client, BUSINESS client, or both
Scope Dependency
YES or NO
Programs which perform cross-client tasks usually run only in ADMIN client, whereas programs which work exlusively on (application or customizing) data defined in the current client run onl y in BUSINESS client Note: ADMIN client is typically defined as client 000 A job for to a scope-dependent job definition will only be scheduled if an entry in table STJR_JOBD_SCOPE STJR_JOBD_SCOPE exists (containing the name of the current job definition) in the current cli ent. It is the application’s responsibility to insert resp. remove such table entries in STJR_JOBD_SCOPE. STJR_JOBD_SCOPE. Entries may be created via an API (class CL_JR_JD_SETTINGS) CL_JR_JD_SETTINGS) or manually via table maintenance in IMG.
Recurrence Time-based recurrence
Event-based recurrence
TIME-PERIODIC TIME-PERIODIC or EVENT-PERIODIC Specify the time interval after which the job must run again. For daily, weekly, monthly jobs it is possible to also specify a start time The name of the BATCH EVENT which will trigger job execution
Our sample screenshots show job definition SAP_REORG_SPOOL: SAP_REORG_SPOOL: This job definition prompts Technical Job Repository runtime to schedule a daily j ob with name SAP_REORG_SPOOL SAP_REORG_SPOOL which runs report RSPO0041 using report variant SAP&001 at 01:00 a.m. in the ADMIN client.
6
3. Run-Time Run-Time compo nent of Technic Technic al Job Reposit Reposit ory Technical Job Repository has a runtime component which is automatically active in every SAP S/4HANA system. The run-time component is responsible for actual scheduling (or unschedulin g) of background jobs as mandated by the set of delivered Technical Job Definitions. The run-time component is triggered by an hourl y action which occurs automatically in an SAP S/4HANA system. To verify that the runtime component of Job Repository is active in your system, run report R_JR_UTIL_1. Executing report R_JR_UTIL_1 via transaction SE38 with default parameter settings should result in an output lik e the following:
7
You may have noticed that the same report also has a CHANGE option on its parameter screen. Via this option, it is possible for you ( you need to have “batch administrator” role, this is basically the same authorization set you need to fully operate transaction SM37) to deactivate the run-time component of Technical Job Repository. When you run R_JR_UTIL_1 with CHANGE option, you get a warning popup:
“ Yes”” here are that the periodic (hourly) job generation action will not take The consequences of continuing with a “Yes place any more. It will not affect the state of currently existing background jobs related to Job Repository, though:
Any technical background job already already present in RELEASED RELEASED state will will not be affected. Neither are any Technical Background Jobs in RUNNING state aborted or otherwise influenced. Only deactivate deactivate Job Repositor y Automatio n in c ase you have an emergency emergency situ ation that for ces you to deactivate the hourly job activation!
8
4. A look behind the scenes: scenes: How does does Technic Technic al Job Repositor Repositor y work? How does Technical Background Job Generation actually work in SAP S/4HANA systems? First of all, the hourly action is triggered from the SAP kernel only in SAP S/4HANA systems! systems! The profile parameter responsible for this is rdisp/job_repo_activate_time Here is a screenshot from RZ11 in an SAP S/4HANA system displaying the profile parameter details:
The value 60M is set by default in SAP S/4HANA systems systems and causes the Job Generation action to occur every 60 minutes.
9
The hourly Job Generation action stores its last execution time in table BTCCTL. So it is possible to learn the last Job Repository Job Generation time by displaying table BTCCTL with SE16 and selecting the entry with ke y value CTLOBJ = JOBDSDL. For example:
The table entry reveals that the last Job Generation action took place at 08:41:46 (system time) on server ldcietx_ETX_10. What happens during the hourly Job Generation action is that an ABAP session is started which executes a program that creates a background job named R_JR_BTCJOBS_GENERATOR in every relevant client. These background jobs are responsible for the actual Job Generation action of Technical Background Jobs.
You can view those created jobs in transaction SM37, for example:
10
These jobs monitor Technical Job Definitions and schedule (or un-schedule) Technical Jobs in the current client as necessary. Here is what job R_JR_BTCJOB_GENERATOR R_JR_BTCJOB_GENERATOR performs in detail (in the current client): Step 1 Step 2
Step 3 Step 4 Step 5
Collect all existing active Technical Job Definitions For each Job Definition: Check whether Job is relevant in current client Relevance check includes: Should job run in BUSINESS and/or ADMIN client? Scope-dependent Job Definitions: Is scoping table entry present for Job Definition? For each Job Definition: If not relevant in current client, unschedule any existing Technical Job For each Job Definition: If relevant in current client, calculate start condition for Technical Job For each Job Definition: Check if a Technical Job already exists with correct start condition. If Yes: No action If No: Unschedule any existing Technical Job and schedule schedule new Technical Job with correct start condition
11
5. Monitorin g Technical Technical Job Repository Repository Operations Operations wit h SLG1 SLG1 The task of Technical Job Repository is to ensure that relevant Technical B ackground Jobs are getting scheduled (and not-relevant ones do not get scheduled). This is achieved (as outlined in chapter 4) by an hourly ABAP session which spawns so-called activator jobs (named R_JR_BTCJOBS_GENERATOR) in every relevant client which perform the actual scheduling resp. unscheduling of Technical Background Jobs. You can monitor the actions of these activation jobs in transaction SLG1 (application log). In SLG1, enter JOB_ACTIVATION as value for selection field “Object” as shown:
SLG1 then displays job activation logs for the hourly Job Activation actions, plus any additional manual actions related to Job Repository that may have taken place. 12
An example:
Double-clicking a single log line renders detailed information what happened during job activation, for example:
13
Information you find in SLG1 concerning Job Activation action includes:
Notification that a job was scheduled because no current current matching Technical Job was found found Notification that that a job was rescheduled (i.e. unscheduled and newly created) created) due to a discrepancy in job attributes: 14
For example, the execution frequency of a time -based Technical Job Definition may have changed (i.e. an updated Job Definition was imported) and this needs to be adapted for the actual periodic Background Job.
Notification that that a job was unscheduled because the job is not relevant (any longer) in current client. For example, a Technical Job which b elongs to a scope-dependent Job Definition was unscheduled because the “Job “Job Definition is in Scope” Scope” flag (that is, an entry in table table STJR_JOBD_SCOPE) was deleted by an application in the current client
Any errors related to to Background Background Job management that occur during during job scheduling or unscheduling.
15
6. Customizing Option Option s for Technical Technical Job Reposit Reposit ory The task of Technical Job Repository is to ensure that certain background jobs are getting scheduled in a regular fashion. To this end, Technical Job Definitions have been defined that control various parameters of executed j obs, e.g. Report Name (plus Variant Name, if applicable), Frequency, Start Time, and the lik e. All Job Definitions in Technical Job Repository have been defined and and shipped by SAP (Basis (Basis and Application) Development. Now your specific SAP S/4HANA system may have requirements that differ from what SAP assumed as typical usage patterns of SAP S/4HANA systems. If, for whatever reason, you have the need to modify the beha viour of a Technical Job sc heduled via a Technical Job Definition in Job Repository, the explanation in this section will guide you through the options you have for modification. Step 1: Identify the Job Definition in question Job Definitions always carry the same name as the created background job. This makes it easy to look up the job definition starting from a job encountered in transaction SM37. Step 2: Identify the client in which the Job needs to be modified Background Jobs always execute programs in a defined client. Modification of a Job Definition is a client-specific action. You need to identify in which client you want to make a change.
Step 3: Look up the job definition details via transaction SJOBREPO Log into the system using the client identified in step 2. Run transaction SJOBREPO. It will present a list of all existing Job Definitions in the system, together with relevance and j ob status information for the current client.
16
An example:
Double-click on a Job Definition name, the s ystem will navigate to the Job Definition details which are viewed/maintained in transaction SE80:
17
With tab Execution Terms you can view for example the Job Frequency (for time-based Job Definitions), the Event name (for event-based Job Definitions), plus all relevant attributes like scope-dependency, execution in ADMIN or BUSINESS client, etc.
18
Step 4: Decide whether you want to completely deactivate the job in current client or only alter the scheduling pattern (i.e. scheduling frequency and/or start time)
19
Step 5A: If you decide to deactivate the job, go back to the overview list of SJOBREPO. SJOBREPO. Position the cursor on the Job Definition in question and use F7 (“De (“ Deactivate activate Standard Standard Technical Job Definit Definit ion locally ”). You will be prompted with a popup which you need to confirm:
When you select “Yes”, you will receive a transport system popup requesting you to log your configuration change in a customizing transport request:
Once you save the customizing transport request, you are done – the Job definition has been deactivated in the current client, this is also indicated in the overview list of SJOBREPO: SJOBREPO:
20
Step 5B: If you want to retain the Job from the Job Definition, but change its frequency and/or start time, again run transaction SJOBREPO, position cursor on the Job Definition in question and use function F9 (“Local change of a Technical Job Definition”): You will be prompted with a popup screen which displays the current frequency and start time and where you can enter the desired new Job Frequency and/or Start Time:
21
Make your changes here and push the “Save” icon (or F5): Agai n, you will be prom pted with a transport system popup screen where you save your configuration change in a customizing transport request in order to transport it to subsequent systems.
Once you save the transport request, you are done – the Job definition has been customized in the current client, this is also indicated in the overview list of SJOBREPO:
22
23