Wednesday, 8 June 2016

06. Monitor Jobs

Monitor Jobs
To monitor jobs, call transaction SM37. From Release 4.6A, the initial screen offers an extensive range of selection criteria. For example, you can select jobs by specifying one of their steps. To list event-based jobs, you must specify an event.
This job list presents the user selection at the top of the screen. The ABAP List Viewer (ALV) is used to display the list and enables you to store multiple display variants.

05. Background Job status

Job status can be any of the following:
Scheduled: job is created but has no start condition.
Released: job is completely defined and waiting for selection.
Ready: job has been selected for execution.
Active: job is being executed by a background work process.
Finished: the entire job has been successfully executed.
Canceled: job terminated with problems.
As long as a job has status scheduled or released, it can still be changed.
If execution of a job has already started, its progress can be monitored in the job log. If the job contains ABAP programs, their output is stored in spool lists.
To create the steps of a new job from an existing job, choose Copy.

04. Background Job Steps



Background Job Steps
Once the general job definition fields are entered, you have to click on the Steps function button to define which are the programs that will be executed as part of the job. These types are :
01. ABAP program
With this option, you can specify the execution of ABAP reports as steps of a background job. Module pools or functions groups are not allowed for definition as steps.
Any ABAP program that generates a list can be used as a job step. If the program includes a selection screen, you must create a variant before you can let it run in the background. A variant is the result of assigning definite values in the fields that appear in the ABAP program selection screen. The list is stored in the R/3 spool system. When you define the step, you can set the print parameters (for example, output device) and a spool list recipient (this is a SAPoffice addressee).
02. External command
These are predefined commands that should have been previously defined by the system administrator. Normal users with the required authorization can schedule these job steps. Since this is a way of executing programs or commands outside R/3, for security reasons users have to specify the operating system type and cannot change the predefined arguments.
An external command is any non-R/3 program, script, or command that is executed at operating system level. Since these commands are defined in R/3 by the system administrator, the administrators use R/3 authorizations to limit the scope of the commands and their availability to R/3 users.
03. External program
An external program is also any non-R/3 program, script, or command that is executed at operating system level. The system administrator has not previously defined these programs in R/3 and no check is made for critical or dangerous programs.
These programs are unrestricted operating system programs or shell scripts that require batch administrator privileges. There is no need to define these commands using transaction SM69. The requirement is that the computer must be reached from within the SAP server and have remote shell support, a running SAP gateway, or a SAP instance that is on the reach of a SAP gateway.
In the latter 2 cases, the programs are called up at the operating system level by program sapxpg. The programs are processed
Synchronously (job waits for termination of the external program) or
Asynchronously (next job step is processed immediately).
The output (stdout and/or stderr) of the external program can be taken up in the job log.

03. Define Background Jobs

Define Background Jobs
To define a new job, use transaction SM36. From Release 4.6A, you can use the Job Wizard to define new jobs as follows:
Specify job name, class, and optional target server
Define a job step (a step can be an ABAP program, external command, or external program)
Add further steps (if necessary)
Start condition (time or event based)
Complete the definition
The Job Wizard allows you to go back and make changes at any point during the definition process.
The start conditions of a job can be time based or event based.
Time based:
Immediate
At date/time
On a chosen workday (defined as a certain workday per month)
All time-based start conditions can be periodic. That is, a job can be performed at regular, defined time intervals. Days that are not workdays can be treated as exceptions.
Parameter rdisp/btctime specifies the time interval of the job scheduler.
Event based:
After event (optional parameters can be used to further specify events) These can be periodic. That is, the job can be triggered every time the event occurs.
After job (this can depend on the status of the previous job)
At change of operation mode (for example, between day and night)
Parameter rdisp/btcname specifies which application server handles events triggered from within R/3.

02. Standard Background jobs

Standard Background jobs



Standard jobs are jobs that should run regularly in a SAP System. These are usually jobs that "clean up" the system. To do this use tcode SM36
On screen you schedule predefined standard jobs. You can automatically schedule all jobs (choose Standard scheduling) or schedule  jobs individually. You can also create additional standard jobs.
These are some of the standard Background Jobs along with their schedule.
S.No
Job Name
Program
Schedule
01.
SAP_COLLECTOR_FOR_PERFMONITOR
RSCOLL00
Hourly
02.
SAP_REORG_JOBS_<client no.>
RSBTCDEL
Daily
03.
SAP_REORG_SPOOL_<client no.>
RSPO0041 / RSPO01041
Daily
04.
SAP_REORG_BATCHINPUT_<client no.>
RSBDCREO
Daily
05.
SAP_REORG_ABAPDUMPS
RSSNAPDL
Daily
06.
SAP_COLLECTOR_FOR_JOBSTATISTIC
RSBPCOLL
Daily
07.
DBA:CHECKOPT…*
RSDBAJOB
Weekly
08.
DBA:ANALYZETAB…*
RSDBAJOB
Weekly
09.
SAP_REORG_TEMSE_CHECK_<client no.> 
RSTS0020
Weekly
10.
SAP_REORG_JOBSTATISTIC
RSBPSTDE
Monthly
11.
SAP_REORG_IDOC_<client no.>
RBDCPCLR 
Monthly

01. Background Jobs

Background Jobs
Dialog work processes are intended for dialog processing. For this reason, the duration of a dialog step is limited. Background processing is intended for operations that require a longer time to run.
Background processing is also suitable for activities that are scheduled to run regularly, for example database backups or financial evaluations.
A SAP background job defines the program or group of programs which are going to be executed by the background work processes. In order to do this, the job must be defined. SAP includes several utilities to define, manage, monitor, and troubleshoot the background jobs. Transaction code for this is SM36 and SM37 for monitor this
A background job has the following components:
1.    Job name : Defines the name assigned to the job.
2.    Job class : Indicates the type of background processing priority assigned to the job.
3.    Target host :. It's the SAP instance where the job will be executed.
4.    Job steps : A job step defines the program (either ABAP or external) which will be executed.
5.    Start time and repeat interval : Define when the job will be started and whether it should be periodically executed.
6.    Job print lists : These lists specify the printing parameters for the job output.
7.    Job log : The logs for the jobs include log information about the job execution such as starting time or any other information coded in the programs.
8.    Job spool recipient list : A recipient list can be used for specifying one or more recipients who will receive automatically the spool list generated by the job.
A background job consists of one or more steps. A step can be:
1.    An ABAP program
2.    An external command
3.    An external program
A job can be triggered to run:
1.    At a predefined date and time
2.    At the occurrence of a predefined event
Background jobs can be prioritized as:
1.    Class A (high priority)
2.    Class B (medium priority)
3.    Class C (low priority)
Jobs allocated to target servers have higher priority than untargeted jobs.
To schedule jobs with higher priority, users must have special authorizations or request the administrator to change the priority of the job. Job classes are very useful when you need to reserve some of the background work processes for scheduling important or more critical jobs.