Tuesday, November 07, 2006

BACKGROUND PROCESSING IN SAP R/3

Background Job/Scheduler

1. What the scheduler can do

*

Many steps within a job: A job can consist of many steps, each running a different program. Each step waits for the previous step to run before it starts.
*

Periodic jobs: A job can be scheduled to run every minute, hour, day, week, month, or any other specified time frame.
*

Dependent jobs: A jobs can be scheduled to wait for another job to finish before it executes.

2. What the scheduler cannot do

*

Periodic dependent jobs: If you have a job that runs every night and another that depends on it, the dependent job will run the first time, but not again after that.
*

Continuing a job that has crashed: If a job crashes on step 1, the whole job stops, and there is no way to continue processing.
*

Re-running from certain job steps: If your job crashes at step 2, there is no facility to re-run, without changing the job and removing step 1 so it does not run again.
*

Waiting for a Batch Input Session: If you run a job which runs RSBDCSUB, the second step will not wait for the batch input session to process, as it is executing in a separate job.

3. Suggested methods for processing

*

Using a self-scheduling job: A program can be set up to re-schedule itself in a job after a specified time. This is more flexible than a periodic job.
*

Jobs that create other jobs: An alternative to dependent jobs, is to run a program in the first job which will create the next job.
*

Jobs that wait for other jobs: A program can be set up that will wait for a specified job, and runs a batch input session. Use this as a step in your job after a batch input session has run.


4. System messaging

*

Information and Success messages: Write the message text to the job log. Program and job continues as normal
*

Error and Abend messages: Write the message text to the job log. Stop the current program from running. Cancel the entire job.
*

-> any dependent programs must be scheduled in a different job

5. Suggested methods for error handling & reprocessing

*

If subsequent steps in a job are not dependent on the first one finishing successfully, the first program should be set up to crash using a success message followed by the 'STOP' statement.
*

* Before every error message, call a routine which notifies the 'Operations Center' of error type, severity, action, etc.

6. Transactions used for Background JOBS:

*

SM36 - Define Background Jobs
*

SM37 - Background Jobs Overview

How to define Periodic Jobs

*

Execute transaction SM36
*

Define Job name, Job class, Target server
*

Click on 'START CONDITION' button
*

Click on 'Date/Time' button
*

Enter Scheduled start DATE & TIME. Check mark 'Periodic Job' field. Click on 'Period values' button and select 'Hourly' or 'Dialy' or 'Weekly' or 'Monthly' or Other period and SAVE. Go back to main screen.
*

Click on 'STEPS' button and enter Program name and Variant under box 'ABAP Program'. Click on 'Print Specification' button and enter Printer name under 'Output device' and SAVE
*

Click on SAVE button until you get message on bottom of the screen that describes 'Job XYZ saved with status: Scheduled'.
*

Click on 'Job overview' button or execute SM37 transaction.
*

Select the appropriate 'Job name', 'User name', 'Job Status' & Schedule date under 'Job start condition' and click on 'Execute' button or press F8.
*

You will now see all your scheduled JOBS.

No comments: