What is SAP Background Job | How to Create Background job in SAP ABAP Program

SAP BACKGROUND JOB SCHEDULING IN SAP | SAP Background Job | How to Create Background job in SAP ABAP Program | sap batch job scheduling | How to schedule background job in SAP | sap background job scheduling in sap | background job scheduling in sap | Types of background Job

Hello Friends, in this blog we will discuss about SAP Background Job related information like, What is Background Job in SAP ABAP, How to Create Background job in SAP ABAP Program, SAP Background Job Status, How to schedule background job in SAP, types of background job, and how to check status of scheduled jobs So please read the full article.

How to Create Background job in SAP ABAP Program

What is Background Job in SAP ABAP ?

Background job is the process where we didn’t interact directly with the process or screen that runs behind the normal interactive process. any SAP Transaction or Program can be executed in foreground mode or background mode. In foreground mode, transaction executes immediately, and it is visible to the user. In some complex programs or heavy transaction which can run long time or resource intensive process for that process.

it is difficult to execute program in foreground. While the transaction is running in foreground and there is an issue in the process, or it take long run due to heavy data then there is a high chance of the transaction not being executed correctly or may shows the time exceeded error.

Background processing allows us to scheduling process or operation to perform automatically on specified time without interacting with the screen or without affecting the other process.  Background job is instructing our SAP system to run our program or process.

Usually, when we have long run or resource-intensive process or operation then we use background job for that process. For example, you want to run your stock report MB52, and it will take so much time due to heavy load of data so we will run this process in background. These jobs can be schedules to run in the night or schedules to run when there are few users using the SAP system.

Background job is scheduled by transaction code SM36 or you can directly schedule the background job of required transaction by navigation Menu bar -> Program -> Execute in background Job.

 You can analyze and manage the status of background job from transaction code SM37.

SAP Background Job Status

SAP Background Job Status
SAP Background Job Status
  1. Scheduled: – You have defined the Job name, variant but not defined start condition like Start Date, End Date, Frequency etc. Which means you have not defined when will be job scheduled in system.
  2. Released: – All required criteria are fulfilled for job definition in background. And job will activate when start condition of job will meet.
  3. Ready: – All the required conditions are met to run the job in a background. But job scheduler has put the job in the queue because scheduler is waiting for work process to be free.
  4. Active: – Job has started running in the background. Once active status is display, we cannot change the status of the job.
  5. Finished: – Job is executed successfully. Finished means the required process is competed without any error.
  6. Cancelled: – There are two possibilities for cancellation of job. First the Administrator has forcefully canceled the job and second there might be some issue in the scheduled job. You can check this from Job logs.

Types of background Job

Background jobs in SAP can be classified into three following categories:

Types of background Job
Types of background Job
  1. Class A (High/critical Priority): – Class A jobs are Highest priority jobs, Class A jobs for time-critical jobs. Some processes are urgent or critical and must be scheduled within class A priority job.
  2. Class B (Medium Priority): – Class B jobs are Medium Priority jobs, Class B jobs for periodic jobs. Once Class A jobs are completed, Class B job will start in the background before class C jobs.
  3. Class C (Low Priority): -Class C jobs are normal priority jobs, Class C jobs run after both class A and class B jobs are completed.

How to schedule background job in SAP?

To schedule background job we have two methods, here we will discuss one by one.

Schedule Background Job by Transaction code SM36.

Step#1.) Enter transaction code SM36 in command box.

How to schedule background job in SAP
SM36

Step#2.) Now define background job screen will open, in define background job screen you will fill below mention details and click on Step button or press enter key.

  1. Job Name: Name of Job.
  2. Job Class: Class A, Class B, Class C.
How to schedule background job in SAP
Define Background Job

Step#3.) Now Create Step 1 Screen will open here you have to enter the below mention details then click on check and save button.

  1. Name: Enter ABAP program name or program name of process which you want to schedule in background.
  2. Variant: Enter variant name which you create in program for scheduling background job. Variant is the details which we fill in selection screen before executing the report or program.
How to Create Background job in SAP ABAP Program
How to schedule background job in SAP

Step#4.) When you saved the program and variant details in step 1 screen then overview list of steps will open here program name, program type, parameters, user, and language related detail you can find which you fill in Step 1 screen.

How to Create Background job in SAP ABAP Program
Step List Overview

Step#5.) When you click on back button from step overview you will redirected to define background job screen, here all detail which you define earlier job name and job class is already available now click on Start condition button you will redirected to start time screen.

How to Create Background job in SAP ABAP Program
Define Background Job

Step#6.) In Start time screen select the job time condition:

  1. Immediate
  2. Date/Time
  3. After Job
  4. After Event
  5. At Operation Mode

Here we select Date/Time to schedule job in specific date and time.

Immediate Date/Time After Job After Event At Operation Mode
Immediate Date/Time After Job After Event At Operation Mode

Step#7.) Now enter scheduled date and time then click on check and Save button, your job has been created.

How to Create Background job in SAP ABAP Program
Immediate Date/Time After Job After Event At Operation Mode
How to Create Background job in SAP ABAP Program
Job Created

Schedule Background Job by (Menu Bar-Program-Execute in Background) directly from process transaction code.

Step#1.) Enter transaction code of that report or process which you want to schedule in background in command box.

MB52 Transaction code
Transaction code

Step#2.) Fill all the required details or details which behalf you want to execute your report.

Fill all the required details
Fill all the required details

Step#3.) Go to the Menu Bar and Select Program and click on execute in background or you can press the F-9 key from keyboard.

Step#4.) Background Print parameter screen will open, here you enter output device (LP01), select page area everything and in properties Print time (X Immediately) then click on OK.

Output device (LP01), Print time (X Immediately)
Output device (LP01), Print time (X Immediately)

Step#5.) When you click on OK button of Background print parameter you will redirected to start time screen.

Start Time
Start Time

Step#6.) In Start time screen select the job time condition:

  1. Immediate
  2. Date/Time
  3. After Job
  4. After Event
  5. At Operation Mode

Here we select Date/Time to schedule job in specific date and time.

Immediate Date/Time After Job After Event At Operation Mode
Immediate Date/Time After Job After Event At Operation Mode

Step#7.) Now enter scheduled date and time then click on check and Save button, your job has been created.

Create Background job in SAP ABAP Program

how to check the status of scheduled jobs in sAP ABAP ?

To check the Status of Background Jobs we have 2 methods, one is by transaction code SM37 and other one is by transaction code SMX.

Status of Background Jobs by transaction code SM37, below we will show you how to check status of scheduled background jobs.

STEP#1.) Enter the transaction code SM37 in command box.

SM37 in command box

STEP#2.) Simple job selection window will open here you have to enter Job Name, Username then select the job status then enter job start condition from date and to date and execute it.

Types of background Job

STEP#3.) Now Job overview status screen will open, here you can check the status of your background job.

Types of background Job
Job Overview

Status of Background Jobs by transaction code SMX, below we will show you how to check status of scheduled background jobs.

STEP#1.) Enter the transaction code SMX in command box.

SMX SAP

STEP#2.) Now Job overview status screen will open, here you can check the status of your background job.

SAP BACKGROUND JOB SCHEDULING IN SAP

TABLES RELATED WITH SCHEDULED BACKGROUND JOB

TABLE NAMEDESCRIPTION
TBTCOJob Status Overview Table
TBTCPBackground Job Step Overview

TRANSACTION CODE RELATED WITH SCHEDULED BACKGROUND JOB

TRANSACTION CODEDESCRIPTION
SM37Overview of job selection
SM36Schedule Background Job
SMXDisplay Own Jobs

TBTCO is the header table TBTCO has the job-related information like job name, start and end dates and times, job scheduler etc.

TBTCP is job step table TBTCP has the individual processing steps of the scheduled job.

FAQ Related : How to Create Background job in SAP ABAP Program

1.Background job scheduling in SAP?

Background job scheduling in SAP by two way By transaction Code SM36 and other is by directly from the process menu path ( Program-Execute in Background ). You can press F-9 instead of F-8 to run report in background.

2. what is the T-code to schedule a job in sap.

The transaction code used to schedule job in background in SAP is SM36 or press F-9 directly from process to run in background.

3. why do we use Background jobs in sap

Background Jobs in SAP is used for reduce the consumption of resources. Usually, when we have long run or resource-intensive process or operation then we use background job for that process.

4.How to check background jobs in SAP

To Check background jobs in SAP we can use Transaction Code SM37 or Transaction Code SMX .

5.What are the SAP background job Status.

Scheduled, Released, Ready, Active, Finished, Cancelled are the status of any background job scheduled in SAP.

6.How to get background job list in SAP?

In Transaction Code SM37 you can see the list of all scheduled jobs.

You May Also Like:

For the next blog please connect with us and follow us on twitter.com/einfonett

2 thoughts on “What is SAP Background Job | How to Create Background job in SAP ABAP Program”

Leave a Comment

%d bloggers like this: