Sunday, June 29, 2025

πŸ•’Background Job in SAP ABAP

What Is Background Job?

• It is a non-interactive process that runs behind normal interactive operations.

• They run in parallel and do not disturb interactive (Foreground jobs) processes and operations.

• Background jobs are also known as batch jobs in the SAP system that run in the background without affecting the normal operations in the system. Background jobs are used to reduce manual effort and automate the process.

• They can run in the background without any user input and can be scheduled to run when the system load is low.

• It is scheduled by using SM36. Also, can be analyzed using Tcode SM37.

Advantages of Background Jobs:

• It reduces manual effort & automates the task.

• It can be scheduled as per the user's choice.

• It reduces user interaction and can run seamlessly in the background without user input.

• By defining the variant for the background job, the user no longer needs to be concerned about inputting a value in the field. As a result, confusion among users is also minimized.

• Suitable for programs that are time-consuming or require significant resources, which can be scheduled to run during low system load periods, typically at night (when the system load is low).

Classification of Background Jobs:

The categorization of background jobs is divided into 3 classes:

Class A comprises critical or high-priority jobs, Class B includes medium-priority jobs, and Class C encompasses low-priority jobs.

1. CLASS A:

• Some urgent or critical tasks must be scheduled with class A priority job.

• Class A priority reserves one or more background work processes.

• User has to check how many background work processes are free.

• Suppose a user chooses 2 background work processes for class B and class C = (Total Number of work processes set in operation modes RZ03) - (Background work processes allowed to Class A category).

2. Class B:

• Once Class A jobs are completed, Class B jobs will start executing in the background before Class C jobs.

3. Class C:

• It runs after both class A and class B jobs are completed.

Status of Background Jobs:

We can check the status of the jobs using Tcode SM37

1. Scheduled:

If you have created a job with the program name and variant, but haven't specified the start conditions such as start date/time, end date/time, frequency, etc., the job status will be set to 'Scheduled'.

2. Released:

The job must meet all the necessary criteria before it can be considered for release status. A start condition is essential for the job to enter the release phase.

3. Ready:

The job has satisfied all necessary conditions and is currently in the queue, awaiting the availability of a free background work process.

4. Active:

This status indicates that the job has running in the background. We cannot change the job's status once it is active.

5. Finished:

The job is executed successfully without any error/interruption. And the task is completed.

6. Cancelled:

It indicates the job has been terminated abnormally. The reason could be: ▪ An administrator intentionally terminates a job. ▪ One of the programs in the job step contains an error like an exception or error message.

Scheduling Methods

Note: We can schedule background jobs in three ways:

  1. By Tcode SM37
  2. By Tcode SE38
  3. Using the Function module

No comments:

Post a Comment