Professional Documents
Culture Documents
Background Job Processing
Background Job Processing
Background job is a non-interactive process that runs behind the normal interactive
operations. They run in parallel and do not disturb interactively (foreground jobs)
processes and operations
It is scheduled from SM36 You can analyze it from SM37 by viewing its job log.
Class A (High/critical Priority): - Some tasks are urgent or critical and must be
scheduled with class A priority job. Class A priority reserves one or more
background work processes. Users have to decide how many background
work processes should be assigned to Class A priority jobs. Suppose a user
chooses 2 background work processes for this category than available
background work processes for class B and C = (Total number of work
processes set in operation modes RZ03)- (Background work processes
allowed to class A category).
Class B(Medium Priority): - Once Class Jobs are completed, Class B jobs will start
executing in the background before class C jobs.
Class C(Low Priority): -It runs after both class A and class B jobs are completed.
Scheduled:- You have defined the program name and variant but not
defined start conditions like Start Date, End Date, Frequency, etc. That
means you have not defined when a job should be scheduled in the
system.
Released:-All required criteria are fulfilled for the job definition. The start condition is a
must for the job to be in release status.
Ready:- All the required conditions are met to run the job in a background work
process. But the job scheduler has put the job in the queue because it is waiting for the
background work process to be free.
You can schedule the background job using SM36. Planned or immediate jobs can be
scheduled.
Ste
p 2) Fill in the job name, priority{A/B/C) and the target server. Background jobs
once scheduled on a target server run on that server. The main purpose of
defining the target server is workload balancing.
Step 3) Click on "spool list recipient". You will get output in your mailbox. You can
check email from SBWP.
Step 4) Insert your SAP username and click the copy button
Step 5) Click Step button to define ABAP program, variant's details, etc
Step 8) Click Start conditions to fill start date, end date, frequency, etc for the job. If
you do not specify the start condition the job will always remain in the scheduled
status. A job in scheduled status will never run.
1. Click on Date/Time(For periodic jobs). If you click "Immediate" then the job will
start running right away. But it will not be set as a periodic job. It’s like "press and
run."
2. Define job 1s start date/time ,end date/time. The job will be released only
once it meets its Scheduled start date/time.
3. Press periodic values.
Step 9) Click on Hourly/Daily/Weekly period to define the frequency of the job as per
your requirement. We will select Other Period.
Step 10) Here you specify the recurring criteria of the job. For example, You can
have the Job run after every 5 days from the Start Date. Here we select a job to run
every 10 minutes.
Step 11) Click on the save button.
Step 14) Once Job step and start conditions are defined the following window will
appear.
.
Step 16) Goto SM37 to know the status of the job.
Step 17) Select your criteria for the job which you want to monitor.
1. Put your job name and username who scheduled the job.
2. Select the status of the job.
3. Specify the date range. In our scenario, we just specify the end date while
keeping From Date Open.
Step 18) You will get the following screen. Look at the status, it's a released means
start conditions are met, and the job is in the queue is waiting
for the background work process to be free.
How to Reschedule a background job
Rescheduled jobs will not run in the future. Remember, you cannot reschedule the
job once it's in active status.
Step 4) You will find the message in the status bar once you press "Released ->
Scheduled".
Monitoring background job is important because once you schedule the job it might be
canceled due to some error. To investigate the root cause use SM37.
1. Job name and username(who scheduled the job). You can put * to get details of all
jobs scheduled by all the users.
2. Select job status which you want to monitor. If you find that a background job is not
completed, select Canceled status.
3. Put the date range as per your requirement.
Step 4) Click on Job Log button to trace the error due to which job was canceled
Step 5) You will get the following details. In the below example, job was canceled since there
was an issue with RFC connection to the remote system. As a resolution use SM59 to check
if there is an authorization issue to the remote system.
Sometimes jobs in Active status may also cause an issue.
You may face issues like tablespaces are full; the duplicate job is running with the same
name and timing, the job is selecting or updating large data, etc.
You can also check such jobs from SM37. Follow the procedure below
Step 1) Execute SM37.
Step 3) Look into the Duration column (which signifies the job is running for n seconds). If
you find a large number in duration then investigate the job details from the job log. Some
jobs use a large number of data. Using SE16 check table entries for the tables used by the
job.
Sometimes jobs show to be in Active Status even though they are completed.
Step 1) As shown above, Execute T-code SM37 and select the job with an active status.
Step 2) Select the active job which is causing the problem.
Step 3) Click the Job->Check the status
Step 4) In the status bar of the window you will find as below message. This will repair Job
Status if there was a problem.
A: Class A (High Priority) — This is used for urgent or critical tasks. These tasks must be
scheduled with class A priority job. Class A job reserves one or more background work
processes.
Class B (Medium Priority) — These jobs are executed after the completion of Class A high-
priority jobs.
Class C (Low Priority) — These jobs run once class A and class B jobs are completed.
What are the different options available for scheduling a background job? What start
conditions type can be used?
A: To schedule a background job you must specify the conditions that will trigger the job to
start. The different types of start conditions you want to use are:
Immediate
Date/Time
After Job
After Event
At Operation Mode.
What are the different types of job status? Can you unschedule an active job?
What is the use of commit value while deleting jobs in SAP system?
A: Commit value is proportional to program performance. If the commit value is high, then
job deletion will run faster. Recommended value is >= 1000.
Can I assign priorities (job classes) in the function modules 'JOB_OPEN', 'JOB_SUBMIT',
and 'JOB_CLOSE'?
A: No. If jobs of class A or B must be scheduled automatically, you can do this as follows:
You schedule a job of the required class and set it to start periodically.
Can I influence the priority of the jobs, regardless of the job class?
What happens if the background work process needs to be switched and a job is
running in that work process?
A: The instance kernel waits for the job to finish before the background workprocess is
switched to an alternate type. Jobs are never terminated by the R/3 system to make way for
an op-mode switch.
A: No. Job definitions contain system specific parameters (target host, user, program,
operation mode, ...). Therefore it wouldn't make sense to develop a transport tool. .
For similar reasons, copying a job across clients is not foreseen. The following trick,
however, is possible: Login to the target client (the one, where the job is to be copied to).
The user must have job administrator authorizations. Then using transaction SM37 all jobs
in all clients can be displayed. With the "Job > Copy" option a job can now be copied from
the source client (only steps, no start time).
A: No, but as of Release 4.x, canceled jobs can trigger an alert in RZ20 which allows you to
react correspondingly.
How can I set that a periodic job is to be deleted after a maximum waiting time?
Example: A job is to run every 15 minutes after 08:00 hours. Automatic deletion is to apply
for each of these jobs if it has to wait more than 20 minutes for execution.
A: Schedule the job with the following parameters: Start time 08:00 hours, No start after
08:20 hours, period 15 minutes. For each job, move the earliest and latest start time by 15
minutes in each case.
How can I set that a periodic job no longer runs as of a certain date?
A: This is not provided in the standard system. It can, however, be implemented with the
function modules 'JOB_OPEN', 'JOB_SUBMIT' and 'JOB_CLOSE' (see Note 4751).
Can I restrict the number of jobs that a user can schedule in order to avoid that a single
user uses all work processes?
A: Job Scheduling
Job Processing
Job Overview.
Mention the various categories which help in executing SAP Background jobs.
Mention the options or condition types available for a background job to be scheduled.
A: The conditions must be specified in order for the background job to be started. This is
said to trigger the start of the job. The following are the different kinds of start conditions
that are to be used in order for the background job to be started –
Immediate
After Job
Date/Time
After Event
At Operation Mode.
Is It Safe To Delete Old Background Jobs Using The Program Rsbtcdel While Users Are
Working In The Prd Server?
A:Yes. It is safe to run this program while users are working since this only deletes jobs that
were completed or aborted, not active jobs.
Will A Client Copy Transfer The Background Job Schedules And All Client Dependent
Data?
A : SAP_ALL will copy all client-dependent data including schedules to the new client.
Remember that ABAP programs are always client-independent. Only the master data
(variant) is client-dependent.
1. User and password Issues (Authentication/ Authorization) user lock, userid expiry,
password change, lack of roles etc.
2. File system problems: BTC reads from the file system to update the database. File not
opened, or corrupted, file sharing issues, file came with different characters, file not found
as well.
3. Variants are not properly defined.
4. Deadlocks issue (Lock mechanism congested)
5. Update mechanism failed
6. Table space overflow (ORA-1653; ORA-1654)
7. Table space max extent reached (ORA-1631; ORA-1632)
8. Archive struck (ORA-255; ORA-272)
9. The memory is not sufficient and errors
(No Roll Area, PXA (Buffer), Page Errors)
10. Problem in the program and inputs (Indefinite loops like 1/0)
11. Dependent jobs/ events failure
12. Target systems are not available to process the jobs.
In the above cases, the Basis team should closely work with database teams and may have
to identify the reasons behind them to resolve the issues.
Example1: If a background job (or an ABAP program) is taking more time to complete, one
of the reasons could be statistics for underlying database tables that this job is accessing
were not up to date. We may have to run statistics to fix the performance issue.
Here we need to know which database table(s) is/are being accessed by job/ABAP program.
Example2: If a background job is running for a long duration and log_dir at the Operating
System level is reaching very high levels (ex: crossing 60% usage), then the reason could be
there is an issue with the underlying ABAP program. If single or multiple processes run for a
long time without committing work to the database, log hold-up will happen and log_dir
usage will increase. If it crosses 70%, the SAP system will face performance issues and if it
reaches 100%, the system wouldn’t be accessible.
To resolve this issue, developers need to modify ABAP program & make sure there are
frequent commit statements. In this case also, database team may request us to provide list
of tables that are being accessed by this job or program.
So, in this article, I’m covering the process of identifying database tables that are being
accessed by an ABAP program or a background job.
First of all, I will cover the process of identifying the underlying ABAP program for a given
background job. Let us say you want to identify, an underlying program for SAP standard
job BI_WRITE_PROT_TO_APPLLOG.
Goto SM37 transaction code and provide name of the job you would like to find abap
program for and execute the same:
It results in below screen:
In the above screen, select the job and click on step icon (highlighted) which results in
below screen
Now, our next task is to identify database tables that are being accessed by the
RSBATCH_WRITE_PROT_TO_APPLLOG program or BI_WRITE_PROT_TO_APPLLOG job.
This is the process to identify database tables for a given background job or an ABAP
program
After system refresh, you may have to hold jobs from execution in target system because the target
system consists of source system jobs and they shouldn’t run. So, it is suggested to hold all the jobs
from execution and release only required jobs and basis standard jobs(housekeeping jobs)
Sometimes, there might be duplicate schedule of same job and you want to hold the duplicate job
to prevent multiple executions
In these cases, to hold the jobs to prevent from execution, we need to set the status of
those jobs from “Released” to “Scheduled”. To do the same, we have login to SAP
system and go to transaction SM37 which will result in below screen.
In the above screen, select the job status as “Released” and keep all other options as
shown above and execute. This will list down all the released status jobs.
From the list, select tick those jobs that you would like to prevent from execution and
change the status from “Released to Scheduled” as shown below:
Then all the selected jobs status will be set as “Scheduled” and those jobs won’t get
executed till you release them again.
Sometimes, it is required to know the underlying ABAP program name for a background
job.
This can be identified as shown below:
Goto SM37 transaction code. It will result in below screen. Please input job name for
which you would like to know the underlying ABAP program.
After selecting necessary job status, click on execute which results in below screen
Double click on the above job name to display job details as shown below
Click on step icon (highlighted) which shows the step list overview (as shown in below
screen)
Note: Sometimes, we can view multiple programs as steps based on the Job definition
done. In other words, a job can have multiple programs or commands as steps
A background job can have the following statuses :
Scheduled : This means that the steps that are required to make up the job are already
completed but the start condition is not yet specified.
Released : This means that all the steps that are required to make up the job including start
condition are defined. A job cannot be released without a start condition. A job can be
released only by the administrator or by the user who has proper authorizations.
Ready : This means that the job is ready for execution. It is kept in the wait queue by the job
scheduler and is waiting for the next free background workprocess to assign the same.
Active : This means that the job is currently active. In this state, job cannot be deleted or
modified.
If the active job is not running correctly, either it can be terminated or it can be canceled in
a background workprocess in debugging mode, analyse it and can be released again.
Goto SM37 transaction and navigate to Jobs -> Capture active job to capture the job. Once
the job is captured , analyse the same and you can release it again.
Please note that you should be in the application server on which the job is running to
capture a job. Otherwise, you cannot capture it.
How to terminate a background job ?
Goto SM37 and list all the jobs that are active between some time interval.
Once it listed the active jobs, identify the job that is to be deleted. Then navigate to Job ->
Cancel Active job and cancel the job.
Canceled: The job got aborted or canceled. This can happen for 2 reasons.
In case you would like to change the default schedule for each job, it can also be done by
selecting each job and defining its start date/time and periodicity in the same screen.
Standard jobs are the jobs that should run regularly in the SAP system. These jobs will
perform housekeeping like deleting old spool requests (thus avoiding spool overflow),
deleting old background jobs/logs/updates/batch input sessions/ABAP short dumps,
collecting operating system/database level statistics (used for workload reporting) etc
What are the Standard jobs that should run in an SAP system & their significance ?
SAP_REORG_ABAP_DUMPS : Internally this job runs RSSNAPDL report. This job cleans up
old abap short dumps
SAP_REORG_BATCH_INPUT : Internally this job runs RSBDCREO report. This job cleans up
old batch input sessions
SAP_REORG_JOBS : Internally this job runs RSBTCDEL report. This job cleans up old
background jobs
SAP_REORG_JOBSTATIC : Internally this job runs RSBPSTDE report. This job cleans up old
data from the run time statistics of the jobs
SAP_REORG_SPOOL : This job internally runs RSPO0041 report. This job deletes old spool
data
SAP_REORG_XMILOG : This job internally runs RSXMILOGREORG. This job deletes XMI
logs
Goto SM37 transaction and select the active job status between any 2 given date/time and
list them. In the output, sort the jobs based on duration column in descending order and
identify the jobs that are running for longer duration
Goto transaction SM37 and list the jobs based on status and time interval.
Select any job for which you want to figure out the details. Double click on the job, which
pops up "display job screen". In that screen, click on job details tab to view
Job name
Job class (i.e A, B and C)
Status of the job
Exec. Target (server/instance on which job is being run currently)
Job frequency (hourly, monthly , weekly etc)
Workprocess that is executing the job
Client on which job is running
Release time of the job
Schedule start of the job