Friday 7 June 2013

How to schedule the background job in SAP (SM36)

Advertisement


You can schedule the background job using  SM36. Planned or immediate jobs can be scheduled.
Step 1) Execute T-code SM36.
Background Job Processing basis
Step 2) Fill the job name, priority(A/B/C) and the target server. Background jobs once scheduled on a target server run on that server. Main purpose of defining target server is the workload balancing.
Background Job Processing basis
Step 3) Click on “spool list recipient”. You will get output in your mailbox. You can check email from SBWP.
Background Job Processing basis
Step 4) Insert your SAP username and click copy button.
Background Job Processing basis

Step 5) Click Step button to define ABAP program, variant’s details, etc.
Background Job Processing basis
Step 6) Define program name, variant details.
  1. Enter  your program name,Variant name in the field. If you have not created variant as per your requirement ,then leave it blank.
  2. Press save button.
Background Job Processing basis
Step 7) Once you schedule the job you will get the following screen.
Background Job Processing basis

Step 8) Click Start conditions to fill start date, end date, frequency,etc for job. If you do not specify start condition then job will always remain in scheduled status. A  job in scheduled status will never run.
  1. Click on Date/Time(For periodic jobs). If you click “Immediate” then job will start running right away. But it will not be set as periodic job. It’s like “press and run”.
  2. Define job’s start date/time, end date/time. The job will be released only once it meets its Scheduled start date/time.
  3. Press periodic values.
Background Job Processing basis

Step 9) Click on Hourly/Daily/Weekly period to define the frequency of the job as per your requirement.We will select Other Period
Background Job Processing basis

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 job to run every 10 minutes
Background Job Processing basis

Step 11) Click on save button.
Background Job Processing basis
Step 12) Click on save again.
Background Job Processing basis
Step 13) Click save again

I will explain each start condition you can use then if you require

Start Conditions.

Immediate: -
 It will run batch jobs immediately
Date/Time:-Specify the date/Time to run the Batch Jobs
After Job: - Dependent on other job which should be run
After Event:-
Dependent on other event which should be run
At Operation Mode:-  job will run At Operation Mode which we define in RZ04 (Day Or Night)

Background Job Processing basis
Step 14) Once Job step and start conditions are defined the following window will appear.

Background Job Processing basis
Step 15) Press save.
Background Job Processing basis


Step 16) Goto SM37 to know the status of the job.
Background Job Processing basis
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.
Background Job Processing basis
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 background work process to be free.

Background Job Processing basis


EmoticonEmoticon