Sunday, 1 September 2013

How to schedule an SAP program as background job

Many times, organizations need to run SAP programs on a periodic basis for eg. Automatic PO creation from PR, MRP, stock replenishment report etc. Instead of executing them manually everytime, it makes sense to schedule them as background jobs, so that system will trigger their execution at the scheduled time.  In some other cases, there may not be any periodicity required for a program, but due to the sheer time that the program takes to complete, it may be desirable to have system execute it in the background and user can later check the results or output of the program.

In both the above cases, we can schedule the program for background execution.
To do so, please follow the below steps:
1. Execute the program in SE38 or start the transaction from the SAP command prompt.
2. From menu, choose "Execute in background".
3. SAP will show a screen where the options "Immediate" & "Periodic".
If you want to immediately start the background job, select "immediate".
Otherwise, choose "Periodic" and select the periodicity for eg. "Once every 1 hour" or "Once a day" whichever is required and continue.
4. SAP will ask for the device for output of the program/report. Specify the printer.
5. Save the background job settings.

To check for the progress/status of the job,
1.Start transaction SM37.
2.Specify program name/job name , date/date range.
3.Specify status to be included eg. Scheduled, completed etc. & execute.
3.SAP shows a list of jobs that meet the criteria.
4. If the job execution has been completed, it shows status as "Finished" in green.
Otherwise, it shows an appropriate status as "Waiting"/"Cancelled" etc.
5. To know more about the job status, click on job log.
    Job log shows whether the program has run successfully or had errors.
6. To view the output of the program/report, click on "Spool".
    If the program has generated an output, will show the spool request.
    Select the spool and click on "Display" icon to view the spool output.

No comments:

Post a Comment