AspAlliance.com LogoASPAlliance: Articles, reviews, and samples for .NET Developers
URL:
http://aspalliance.com/articleViewer.aspx?aId=1129&pId=-1
Background Processing SAP R/3 System
page
by Arindam Ghosh
Feedback
Average Rating: 
Views (Total / Last 10 Days): 42664/ 93

Introduction

Background jobs are definitions of programs, printing specification, and interactively can be run automatically by the SAP background processing system. Any program that you can start interactively can be run automatically by the SAP system in the Background jobs. In background processing the system automatically runs the specified program or report at a specified and schedule time without the intervention of the user; even if you can monitor the background job and display results.  

Whenever you log on to the SAP System to perform any task, the R/3 System starts responding. SAP System can be operated in both interactive mode as well as non-interactive mode. In the non-interactive mode you can schedule execution of programs and reports that you need to run without further intervention by you. This mode of working is named Background Processing.

Sophisticate support for the background processing is provided by the SAP System. One can execute both internal and external programs of the SAP system.  You can perform variety of jobs like choosing a variety of methods for scheduling and managing the jobs offer by the SAP System. For ease of access of scheduling and management, within a single background processing job one can execute similar related programs as "job steps;" this allows the single background job to become more complex and have multiple steps.

The system has a number of sophisticated tools for managing jobs and diagnosing problems that occur during the runtime, including a graphic monitor and a powerful and easy-to-use job programming interface for developing your own background-processing applications. The system also provides job scheduling wizard automates basic background job definition.

Background Scheduling

To have an idea about the background scheduling let us take an example of a long report. Suppose we execute this report in interactive mode, it takes several minutes and during time the SAP System is blocked for any further input. As a result, you will not be able to interact with SAP sessions anymore.

However, when you run the report non-interactively, you can interact with the SAP sessions while processing the report in the background. For executing jobs in non-interactive mode, schedule the job for background processing. To create a background processing job you should specify:

·         The name of the report

·         The name of any variant it needs

·         What to do with output

·         When to start it

After this, the SAP system does not require user’s intervention and can proceed with the job even without you. It executes the report and prints the output using printer or output controller. While scheduling a job in background process, three parameters should be specified. These parameters are:

·         Definition of programs

·         Its start time

·         The printing specification for getting the prints as required

After this, you can check whether your job was executed successfully and display a log of any system messages.

For scheduling background processing, you have to direct the system to process an ABAP/4 or external program in the background. This is a two-step process:

·         Scheduling the program

·         Releasing the job

This needs to have a special authorization for releasing and scheduling the job. Generally, the system administrator, who organizes and monitors background processing, supervises the release of these jobs. Many users are also authorized to schedule background processing of reports. You cannot schedule a job unless and until you have a release authorization. If a user is authorized and has specified a start date or selected "start immediately," he or she can release the job.

Authorized users can change start time. A program can be scheduled as a separate job or you can append it to an existing job, which has not yet been processed. Background process can be run while doing some other online work. However, this can adversely affect online operation and should be avoided. For example, if you run a program that locks the database, the work of online users will be hampered or stopped. Often, long-running reports are scheduled automatically or semi-automatically for background processing.

First Step

Initiate the job scheduling function. Standard job scheduling must be used in case of scheduling of an external command or external program as a background job and ABAP job­ scheduling function can be used to schedule ABAP programs. For starting a standard job scheduling function choose the following:

Administration menu bar option à CCMS option à Jobs option à Definition option.

For starting ABAP job scheduling function, navigate to ABAP Editor and choose Program menu bar option àExecute option à Background option.

Second Step

Now define a job. Using the Job Wizard you can define your job. From the Application toolbar, choose the wizard button. After this, the initial screen of the SAP Job Wizard appears. The Job Wizard is available only from the standard job scheduling function.

Third Step

Now, you have to save the job. When it displays the message "Job saved" it means the job has been successfully scheduled. We know that a job must be released before it is scheduled. Only authorized users can release the job, otherwise your system administrator will release your job.

Fourth Step

This is the last step of scheduling. In this step you have to check the status of your job. For this you need to choose System menu bar option à Own jobs option.

In SAP System, the background processing runs according to your instructions. In case a list is generated by the report, the report either prints directly or waits for you in the SAP output controller. The status of background processing can be checked for its correctness.

Advantages of Background Processing

Background processing system has many advantages.

First, when you run a report in the background, the SAP System is not tied up or blocked. However, if you run the process in the interactive session, the SAP session, in which the process is running, is always blocked for any further inputs. On the other hand, in a non-interactive mode, the R/3 system starts the report in the background. Running the report in this manner has no influence on your interactive work with the R/3 system.

Second, in background processing of the system you can schedule the processes, i.e. a report or external program can run at any scheduled time when R/3 system is active, during the night or other periods of low load on the R/3 system. Automatic periodic repetition of the jobs can be scheduled using background-processing system.

Third, background processing is an efficient way to execute long-running jobs. For interactive sessions, the SAP System has a built-in time limit. Therefore, whenever a report exceeds that specified limit, the R/3 system terminates the processing of the report automatically. This is the only way to run long-running ABAP/4 reports. Mostly ABAP/ 4 reports do not require any scheduling, since such reports are automatically scheduled for execution in the background system.

Processing Scheduling ABAP Jobs

For scheduling ABAP job, you need to choose a variant for your report. The report name that will run gets filled in automatically. However, note that this report can be overwritten in case you want to enter different report to be run. Printer specifications can be set for output from the report. In case you do no set the printer options, the system uses the options saved with your user account. For this you have to Select –System menu bar option à User profile option à User defaults option for displaying these options. Now you can either execute immediately (using Execute immed) or schedule the job (using Schedule) at some specified date and time. You can also specify your job to be restarted periodically. To access the more complete function choose – Goto option à Define job.

Scheduling Standard Jobs

For scheduling standard jobs, first specify a recipient for spool requests generated by your job on the screen. The spool output is automatically mailed to this user or distribution list. Next, choose the time (Start time) at which you have to start the job. Save the start time and return to the first screen. You can confirm the start specifications using the Check function in the Start time option. Start time option allows you to repeat your job automatically. Even if you specify immediate start, no job can be started until it has been released. If the system asks for any additional information you have to enter that information.

For different start time option for background jobs the effects are different. For option Immediate, the effect is that the jobs starts immediately as soon as you save the jobs definitions.

For the date/time the jobs does not start until the date and time are specified.

If the option is "After job" then the jobs starts when another job that you specified has been completed.

And if the option is "After event" then the job starts when the selected events occur. You have to use possible values arrow to choose from the available events.

For the option "At Operation Mode" the job starts when the selected operation mode becomes active. You need to use the possible values arrow to choose an operation mode. Lastly, if you choose "Start on workday" as the Start time option, your job starts on a particular workday. The system displays a screen where you can give your specification.

After saving the start time you can return to the job Identification screen.

Specifying a Recipient

For specifying a recipient, select Spool lists recipient option and Execute Enter button from the initial screen. A dialog box gets displayed. In the Recipient field, enter a user's SAPoffice mail name, a SAPoffice distribution list, a SAP user ID, or an external e-mail address. If desired, activate the mailing options. The recipient receives all spool requests generated by the job. If you want to save the recipient, choose Copy.

Specifying ABAP Program to Run in Background

ABAP program or external program can be specified to be run in the background. More than one program can be executed with a single background job. To do it you should add a job step for each program.

Let us first discuss the procedure for creating an ABAP report.

The Users field will, by default, display your name, indicating that the user (you) is authorized to run this program.

In case there is another user authorized for scheduling the job, then the default name is changed and system displays the name of the other user.

Now choose ABAP and enter the name of the report.

Choose variant from the Variant list. Specify the language you want the report to be in.

With Print specifications, you can specify whether you want the report output to be held in the SAP spool system or have it printed as soon as the job has run.

For external command, by default, the job step will run under your SAP System authorizations. So your name will appear in the User field.

But if the program is running under the authorization of another user, you can change this default option by entering another user name.

Then choose External command and enter the predefined SAP name. If required, enter any additional arguments required for the command.

The host system on which the command should run and the type of operating system at the host should be specified. You can determine the host name using the host name command on the target host system.

You can also specify how the output from the external program should be treated, as well as other runtime options by using Control flags. It is advisable to use default settings for these options. If you are authorized for background processing, you can also choose External programs as a job step option.

To run an external program, enter the exact path, program or script name, arguments required by the program, and the name of the host system on which the program is to run. After this, save the job step and return to the job identification screen.

Note that in the SAP system the ABAP programs are not predefined; therefore, the system does not perform an authorization check. Hence, the system does not bother to check whether you are allowed to use the command.

Conclusion

In this discussion I have tried to explain the concept of background processing in the SAP R/3 System and why background processing necessarily becomes so important. I have touched on its needs and advantages of background scheduling. I have also discussed about how one can schedule the background jobs by means of standard scheduling jobs and one can specify a recipient and how to run ABAP Program in the background. By this discussion one is able to understand the basic concept of background processing.

 


Product Spotlight
Product Spotlight 

©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-03-28 8:32:26 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search