SAP Background Job Processing
What is a Background Job?
A non-interactive procedure known as a background job follows the usual interactive activities. They operate concurrently and don't interfere with interactive (foreground tasks) operations.
It is scheduled from SM36. You can analyze it from SM37 by viewing its job log.
Advantages of Background Jobs
l It automates the process and minimizes manual labour.
l It can be scheduled as per user's choice.
l It requires little user engagement and may operate without input in the background.
l The user doesn't have to worry about value entered in the field once the variation for the background job is defined.
l This also lessens user confusion. Ideal for lengthy or resource-intensive programs that may be set to run at night (when system load is low).
Background jobs are classified into three categories -
Class A (High/critical Priority): - Some jobs need to be planned with Class A priority because they are urgent or important. One or more background work procedures are reserved for class A priorities. The number of background work processes that should be allocated to a Class A priority job must be decided by the users. If a user selects two background work processes for this category, the number of background work processes that are accessible for classes B and C is equal to the total number of work processes that have been set up in operating mode RZ03 (Background work processes allowed to Class A category).
Class B (Medium Priority): - Class B jobs will begin running in the background before class C jobs after Class A jobs are finished.
Class C (Low Priority): - It starts after jobs in classes A and B have finished.
Possible status of background jobs
Scheduled: - The programme name and variation have been defined, but the start conditions, such as the start date, end date, and frequency, have not. That implies that you haven't specified in the system how a job should be scheduled.
Released: - All requirements for the job description are met. The work must meet the start condition requirement in order to be released.
Ready: - Everything is in place for the job to execute in a background workprocess. But because it is awaiting the availability of the background workprocess, the job scheduler has placed the job in the queue.
Active: - Background job has started to run. Once a job is in the "Active" status, we are unable to update it.
Finished: - The task is successfully completed. It denotes flawless completion of the targeted task.
Canceled: - There are two potential outcomes here. The Administrator has abruptly terminated the position, or there may be a problem with the position. Job logs are a good place to look at this.
How to schedule the background job?
SM36 can be used to schedule the background task. You can schedule immediate or planned tasks.
Step 1) Execute T-code SM36.
Step 2) Fill in the destination server, priority (A, B, or C), and task name. Once scheduled on a target server, background tasks are executed on that server. Workload balancing is the primary goal of target server definition.
Step 3) Go to "spool list recipient" and click. The result will arrive in your mailbox. From SBWP, you may check your email.
Step 4) Select the copy button after entering your SAP login.
Step 5) To define the ABAP program, variant's information, etc., click the Step button.
Step 6) Give the program's name and details about its variants.
In the field, type the name of your application or variant. Leave it blank if you haven't produced a version that meets your needs.
Press save button.
Step 7) You will get the following page after scheduling the job.
Step 8) To enter the job's start date, termination date, frequency, etc., click Start conditions. The work will always be in the scheduled status if you don't provide a start condition. A work that is planned won't ever run.
Select Date/Time (For periodic jobs). If "Immediate" is selected, the job will begin running immediately. But it won't be designated as a recurring task. Similar to "push and run,"
Set the start and finish times for the job. Only once the job starts and ends on schedule will it be revealed.
Press periodic values.
Step 9) In order to define the frequency of the task according to your requirements, click on Hourly/Daily/Weekly period. We'll choose Other Period.
Step 10) Here, you list the job's recurring requirements. For instance, you may schedule the job to run every five days starting from the start date. Here, we choose to perform this task every 10 minutes.
Step 11) Click on save button.
Step 12) Click on save again.
Step 13) Click save again
Step 14) The following window will show once the job step and start circumstances have been established.
Step 15) Press save.
Step 16) Goto SM37 to know the status of the job.
Step 17) Choose your criterion for the work you wish to track.
Include the username and name of the task you planned.
Select the status of the job.
Indicate the time frame. In our example, the From Date is left open and we just supply the End Date.
Step 18) If you look at the status, released indicates that the requirements for starting the task have been completed, and the job is waiting in line for the background work procedure to be finished.
How to reschedule a background job
Jobs that were rescheduled won't run in the future. Keep in mind that once the work is in the active stage, you cannot reschedule it.
Step 1) Execute SM37.
Step 2) Fill the criteria.
Job name and username by which job is scheduled.
choosing the status. You may only pick Released/Ready status in order to reschedule the project.
Specify the date range.
Press Execute (F8) button.
Step 3) Select specified job and press Job -> (Released -> Scheduled).
Step 4) By selecting "Released -> Scheduled," you may see the notice in the status bar.
How to Monitor a Background Job
Monitoring background jobs is crucial since they could be canceled after being scheduled due to a mistake. Use SM37 to look at the root cause.
Step 1) Execute T-code SM37.
Step 2) Fill the required criteria.
username and job title (who scheduled the job). To get information on all jobs planned by all users, enter *.
Choose the employment status that you wish to keep an eye on. Choose Canceled status if you discover that a background check has not been completed.
Put the date range as per your requirement.
Step 3) You will get a screen as shown below.
Step 4) To identify the mistake that led to a work cancellation, click the Job Log button.
Step 5) You'll learn the following information. In the case below, the job was aborted because the RFC connection to the remote system proved problematic. Use SM59 to see whether there is a remote system authorization problem as a fix.
Sometimes jobs in Active status may also cause an issue.
Table spaces may be full; a duplicate job may be operating at the same time and with the same settings; a task may be choosing or updating a lot of data, among other problems.
You can also check such jobs from SM37. Follow the procedure as below.
Step 1) Execute SM37.
Step 2) Fill the required criteria.
Job name and username (by which job is scheduled).
Choose the employment status that you wish to keep an eye on. Select active status if there is a problem with the system's performance or if a job hasn't been finished for a very long period.
Put the date range as per your requirement.
Step 3) Examine the Duration column (which signifies the job is running since n seconds). If you see a lot of these, look at the job specifics in the work log. Some occupations require a lot of data. For the tables utilized by the task, SE16 check table entries are used. Jobs occasionally display as having an Active Status even after they have been finished.
How to correct them? Follow the below set of procedure -
Step 1) 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 status.
Step 4) The window's status bar will display the message listed below. The Job Status will be corrected if there was an issue.
Step 5) if still job is in running status then goto SM50. Below screen will open. Have a look at "Reason" column which shows any errors or exceptional issue. Investigate it further.
How to Delete a Background Job
Why Delete Background Job?
On the system, outdated jobs take up space. Normally, we destroy the logs to prevent any systemic discrepancies. Because your SAP system will crash if the file system fills up!
You can delete jobs in two ways:-
Multiple jobs at once.
Single job deletion.
Delete Multiple Jobs at once
Use report RSBTCDEL2 for the best results (New version of RSBTCDEL). The job overview will not contain and old job logs will be removed.
Step 1) Execute T-code SE38.
Step 2) put the program name in the field as RSBRCDEL2.
Step 3) Fill the proper details.
Which job do you want to delete?
All jobs are meant by *. Give Username if you wish to remove a specific user's jobs.
Indicate the status of the deleted job. Give a time frame for deletion. For example, remove jobs that are more than 14 days old. NOTE: It is not possible to remove a job after it has reached the inactive state..
Indicate Commit. Performance of the programme is proportional to commit value. A high commit value will result in a quicker work termination. Recommended value is more than 1000.
To replicate the deletion, run the test. Jobs won't be eliminated. Only unchecked the Test run box when you are certain.
Press Execute.
Single job deletion
You can also delete a single job from SM37.
Step 1) Execute SM37.
Step 2) Complete the requirements. username and job title the state of the work. Decide on a date range.
Step 3) Select the job you want to delete
Step 4) Goto Job-> Delete.
You can also delete the jobs from OS level under directory
/usr/sap/<SID>/SYS/global/<CLNT>JOBLG. Folder.
However, deletion at the OS level can result in a Temse consistency problem. Go to SP12-> Consistency check to eliminate discrepancies. Delete the objects from the list after you have it.
Normally, the system requires programme RSBTCDEL2 to schedule Job- SAP_REORG_JOBS (Program to remove obsolete background jobs) at the daily frequency.
0 Comments
Post a Comment