November 8, 2013

SAP BASIS NOTES -8





Background JOB Administration :-

1. We mainly use background work process for long running task called batch work processors
2. Background processing is used not only for long running tasks but also for recurring tasks Ex: daily database backup or financial accounting status

A background jobs consist of one or more steps
a) An abap program
b) An external command
c) An external program


Note: every job is processed without interruption by one single background work process.

Background job can be scheduled with different priorities
I. Class A highest priority
II. Class B medium priority
III. Class C normal priority


Note: we must ensure that large share of all background tasks are normally scheduled as class C without target server specification (90% task)
Ex: task scheduled using transaction DB13

A step within a job can call one of the three actions

1) Every ABAP program can be scheduled as a step of a job if the abap program has one or more selection screen, you can create the input required in the form of a variant.
2) An external command is a call of a predefined script, a command or a program outside a SAP system. With external commands we can mask OS calls and stored them in SAP system under a new name.
3) The execution of external command Is protected using SAP authorization. i.e. certain external commands can only be processed by particular users in the system.
4) An external command is any OS command. SAP authorization concept only specifies whether a user can call external program or not.

Start criteria for background job:
A job can be triggered by the following options

1) By scheduling a job on a particular data at a particular time. Ex: time control scheduling
2) By the occurrence of a particular event defined in the sap system (event based scheduling)

Scheduling and monitoring: use transaction SM36 to define new jobs
• We can manually schedule the jobs as well as call the jobs wizard
• Most of the case we schedule manually

Required specifications for defining a job:
1) General specification such as job name job priority and target sever (optional)
2) Definition of one or more job steps
3) Definition of start conditions (time or event based)

Q) Why it is not preferred to use job wizard?
A) Unlike classical scheduling we cannot perform individual steps with different users.

Here we can monitor different status of background jobs

Status of Jobs :-

1) Schedule: The steps of job have already been defined however start condition must still been defined

2) Released:
I. The job has been define completely defined including the start condition
II. A job cannot be released without a start condition
III. Only a relevant authorized user can release a job

3) Ready: the start condition of a released job has been fulfilled. A job scheduler has placed job in the wait queue for a free background work process

4) Active: the job is currently being executed and cannot be released or changed

5) Finished: All steps of the jobs are successfully completed

6) Canceled: the job is terminated reasons for this are
I. An administrator deliberately terminated the job in transaction code SM37 by choosing job _ cancel active job button
II. A job step is terminated with an error.
Note: we can change a job status as long a job still has the status scheduled or released
III. We can create a new job by copying an existing job by choosing JOB-copy

Time Based Scheduling :-
There are three options to execute a job.
1. Immediately
2. Particular Date/Time
3. On a particular work day (i.e. factory calendar)

• A job scheduler in the background handles all time-based jobs.
• Profile parameters, which specifies the time period in which time dependent job scheduler is active  rdisp/bcttime.
• Execution of jobs with the start condition “Immediate” usually avoids the time-based scheduler.
• In this case the dialog work process of the user performs the job scheduling.
• The profile parameter to configure the background work process is rdisp/wp_no_btc
• The number of background work process depends on the number of tasks to be performed in the  background.
• If the transport system is used there must be at least 2-background process.
• Default time for time dependent job scheduler us set to 60 seconds (rdisp/bcttime = 60)
Note: An ABAP program, SAP_MSSY2 (An automatic abap program), that automatically runs in a dialog work process.
• For time based job scheduling we have a job-scheduling table in the DB.
• Jobs that are not assigned to any particular target server can be executed by any free background work processes. This means that workload is automatically distributed between the systems.
• If a job is scheduled on a particular target m/c it will run only based on the load of that machine. The automatic selection option is being disabled in this case.

Standard Jobs :-
Standard jobs refer to background jobs that should run regularly in a production system.
• As a part of our monitoring we need to take care.
• They mainly perform certain clean-up activity of a system such as deletion of obsolete spool requests.
• In SM36 we go to standard jobs.
• To schedule all default jobs, choose the “Default Scheduling” option.
• All standard jobs that are defined in the table REORGJOBS, are scheduled with specified variant and period.
• To schedule individual jobs choose the particular job using SM36 and set the execution period.
• To define an additional standard job that is not yet available in the table REORGJOBS choose “Predefined New Jobs”

Event Based Scheduling :-

An event is a signal to the b/g processing system, that a particular status that has been achieved in the SAP system. The b/g processing system receives events and then starts all the jobs that are linked to this event.
• An application (Central instance) Server is specified for processing of event based jobs.
• Event based jobs can be scheduled with one of the following 3 start conditions.
1. After Event
2. After Job
3. Operation mode
• Trans-Code to define a new event is SM62
• When defining an event, the administrator differentiates between system and user events.
• System events are events predefined by SAP that you can neither modify nor trigger.
•Triggering events is done in various ways
1. Manually using SM64
2. Using an ABAP program
3. Outside SAP at OS Level, using the program “sapevt” which runs at OS level.

Reservation for Class A Jobs :-

• There are very few jobs which will be reserved of type Class A. The reservation of work process for Class A jobs does not reserve any particular work process rather it ensures that a particular number of workprocess is always kept free.
• To set number of reserved background workprocess for Class A, you define an operation mode is RZ04 and maintain the workrocess allocation for this operation mode. By doing so, we have the option of reserving work process.
• SAP strongly recommends not to reserve more than one bgwp for processing Class A jobs.
• A job server group contains one or more instances with available bgwp. It is possible to select a job group for a particular job.
• TCode to setup a job group SM61
•Ttrans-Code to setup an extended job selection SM37c

Background Users :-
• With the definition of jobs in SM36, we can assign each step of the job to a user.
• This particular user shall have authorization for executing the jobs.

There are 2 options
1. By default, the job will be executed using the current user in which I have logged in.
2. Enter a different user name if your job should not be performed using your own authorizations.
• To perform this action we should have the authorization S_BTCH_NAM, to enter the names other than your names in the user field.
• Use the “System” user type when creating background users. SU01 – Tcode to create users.
• A dialog logon with this user is not possible.
• If I define a job using job wizard, by default that name of logged on user, is used for authorization check.




Will update soon... Check next post...






No comments:

Post a Comment