Monitoring Background Processing

Objectives

After completing this lesson, you will be able to:
  • Explain the status flow of a job
  • Use the Job Overview to monitor jobs

Status of a Job

As listed in the figure above, a job can have the following statuses:

Planned

The steps that make up the job have already been defined, but the start condition must still be defined. This job will not run without further activities on your part.

Released

The job has been completely defined, including its start condition. A job cannot be released without a start condition. Only an administrator or a user with the relevant authorizations for background processing can release a job. This ensures that unauthorized users cannot execute jobs without approval.

Ready

The start condition of a released job has been fulfilled. A job scheduler has placed the job in the request queue of background work processes.

Active

The job is currently being executed and cannot be deleted or changed.

Hint

To capture a job, you must be logged on to the instance where the job is running.

Finished

All steps of the job have been completed successfully.

Canceled

The job has terminated. There are two ways this can happen:

  • An administrator deliberately terminates the job in transaction SM37 by choosing JobCancel active job.

  • A job step terminates with an error.

Note

If a background job remains in state Ready or Active for an unexpectedly long time and you want to check whether the display is still current for the job status, you can use the following function in transaction SM37: JobCheck status. If necessary, the check changes the job status to the correct status.

You can change a job as long as the job still has the status Scheduled or Released.

If job execution has already begun, you can monitor its processing in the Job log (see the following section).

If the job contains ABAP programs that generate output lists, they are saved in spool lists.

Monitoring Jobs

You can monitor jobs in transaction SM37 (or transaction SM37DISP which offers only display options (and no change options)).

You can select jobs using a diverse range of criteria on the initial screen of this transaction. In this way, you can display all jobs that contain a particular job step, that have a particular status, or that react to a defined event (for this, you must select a particular event or "*").

Note

For a job selection with more selection criteria, you can use the Extended Job Selection button in the application toolbar (see figure above). Any selection criteria that you have defined in the Simple Job Selection screen will be transferred to the Extended Job Selection screen.

After you have chosen Execute, a Job Overview screen (see figure above) appears that is implemented in SAP List Viewer (ALV). By choosing Settings from the menu, (among other things) you can determine the columns that are displayed, and the sorting. You can set this layout as the standard layout (for the current user or for all users).

Hint

The transaction SM37 offers the following two ALV-based display types:

  • LIST: Offers a quick list structure (standard setting).

  • GRID: Enables you to change the layout easily (required for accessibility).

A batch administrator can use the program BTC_SWITCH_LIST_GRID to define the display type for individual users or all users.

You can navigate from the Job Overview shown in the figure to other job-specific views:

  • The Spool List contains the output lists for ABAP programs (if any).

  • The Job Details contain, among other information, the job definition, duration of the processing of the job, and the start time of the job.

  • The Job Log stores all messages output by a background program. You can display this log to obtain information about a program that terminated with errors or to perform a detailed investigation about a background processing run.

    Note

    For SAP systems belonging to SAP Business Suite, job logs are stored in the file system (as subdirectories of DIR_GLOBAL). For SAP S/4HANA Server systems, the job log is now no longer written to a file, but instead to a database table through a service connection. This ensures that a job log is rollback proof. You can switch off this new behaviour by maintaining an entry in table BTCOPTIONS. For details, see SAP Note 2360818Job log in the database and its attachments.

Outlook: Job Monitoring in SAP Solution Manager and SAP Cloud ALM

Both SAP Solution Manager and SAP Cloud ALM offer job monitoring as well:

  • Job Management in SAP Solution Manager is a process that supports management of solution-wide background operations that automate your business processes. It allows you to request, document, analyze, and schedule background jobs in your system environment from a central location, with a standardized workflow.

    As a prerequisite, your system landscape and the Job Management scenario must be configured in the SAP Solution Manager Configuration.

  • Job & Automation Monitoring in SAP Cloud ALM ensures business operations without disruptions and increases the business process execution quality and performance:

    • by monitoring job executions health and detection of anomalies during job execution
    • by directly alerting both business and IT users on disruptions and exceptions
    • by providing details at job execution level to enable fact based root cause analysis
    • by reducing configuration effort by making use of historical execution information.

For more information, see SAP Support Portal (https://support.sap.com), area ALMSAP Solution Manager and then (in section Overview of ALM Processes) enter section Business Process Operations.

For SAP Cloud ALM, see area ALMSAP Cloud ALMOperations and then (in section Core Capabilities) enter section Job & Automation Monitoring.

Working with the Job Overview

Business Example

Programs that should run on a regular basis are scheduled as background jobs in the system. It is the responsibility of the system administrator to monitor the system's background processing to ensure that it is running correctly. As a system administrator, you want to check whether these periodic jobs run smoothly.

Task 1: Monitor the Latest Run of the Job that Checks the Spool Consistency

In your SAP S/4HANA Server system, check the result of the latest run of Job SAP_SPOOL_CONSISTENCY_CHECK.

Steps

  1. In your SAP S/4HANA Server system, check the status of the last run of job SAP_SPOOL_CONSISTENCY_CHECK.

    1. Log on to your assigned SAP system with the credentials that your instructor provides. Start transaction SM37 (Job Overview).

    2. On screen Simple Job Selection, enter the following and keep the other settings unchanged. Then choose Execute.

      Job NameSAP_SPOOL_*
      User Name*
      From (Date)<two days ago>
      To (Date)<today>
    3. On the resulting screen, check the Status for the last run of this job (Start date might be yesterday). The status should be Finished.

  2. Which report has been executed by this job?

    1. Following the previous step, select the line of the last run of this job and choose Step in the application toolbar.

      The job SAP_SPOOL_CONSISTENCY_CHECK has executed the ABAP program RSPO1043.

  3. Check the Job Log and (if applicable) the spool list of this job.

    1. Following the previous step, choose Back to get back to the Job Overview screen.

    2. If you have not yet already done, select the line of the last run of this job. Now choose Job log in the application toolbar.

      Here you can see that start time and the time when the job has finished (both displayed in system time).

    3. Again, choose Back to get back to the Job Overview screen.

    4. Now choose Spool in the application toolbar.

    5. On screen Output Controller: List of Spool Requests, select the line with the spool request and choose Display contents in the application toolbar.

      The spool list is displayed.

  4. Is this job scheduled periodically? And – if "yes" – what is its frequency?

    1. Following the previous step, choose Back twice to get back to the Job Overview screen.

    2. Make sure that you have still selected the line of the last run of this job. Now choose JobJob details from the menu.

      The Job Frequency should be Daily.

  5. On which application server has this job been executed?

    1. Following the previous task, on screen Display Job SAP_SPOOL_CONSISTENCY_CHECK, choose Job details from the application toolbar.

    2. In field Executing Server, you can see which application server has executed this job.

    3. Finally close this screen and choose Back twice to go back to the start screen of transaction SM37.

Log in to track your progress & complete quizzes