Mentor SAP

Background Job Creation

To start a program in the background, include it in a job. Use the job definition to determine the programs or steps that run during this job. You can specify print parameters and set the start time for the execution of the job.

 

The job overview (transaction code SM37 ) informs the user about the current status of the job. The Job Wizard simplifies the creation of background jobs.

 

 

Definition of Steps

The procedure to define a job is as follows:

  1. Choose SystemServicesJobsDefine Job (transaction code SM36 ).
  2. Assign a job name of your choice, and define the priority (job class) and the target host (F4 help).
  3. If the program has a selection screen, specify a selection screen variant. The output list of the report can be stored in the spool or printed immediately. Whether this list is stored or printed depends on the specified print parameters.
  4. Save the steps after you have defined them and return to the initial screen of the job definition.

 

Determination of the Start Date and Releasing the Job

The steps to determine the start date and release of the job are as follows:

  1. After defining the job steps, determine the start condition for the job. For example, you can start the job on a certain day at a certain time.
  2. Save your entries and return to the initial screen of the job definition.
  3. Save the job.

By following the above procedure, the job is released to run at the specified time. You can also use automated job scheduling with the function modules in the BTCH and BTC2 function groups.

 

 

Background Processing of an ALV Grid

When an ALV is called in the background, a print list (Classic ALV) is generated, which has a different appearance to an ALV which is displayed in dialog.

 

You can change the layout settings explicitly by programming initial sorting or aggregations, for example, or by specifying a layout variant.

 

If you try to instantiate a container control in the background an exception occurs. To avoid this, check the sy-batch system variable to ensure that you do not execute the CREATE OBJECT statement in this SY-BATCH will have the value ‘X’ if a program is run in the background, and space if not.