Skip to content
Tutorials Center
My learning

Topics

Lesson 26 of 36 ยท Basis and Administration

Background Jobs, Monitoring and Housekeeping

Learn SAP background jobs (SM36, SM37), work processes (SM50), system log (SM21), short dumps (ST22), lock entries (SM12) and routine housekeeping.

A running SAP system is busy even when nobody is logged in: invoices are posted overnight, interfaces move data, old logs are deleted. A Basis administrator needs to know what runs, what failed and what is stuck. This lesson covers the work-process model, background jobs, and the monitoring transactions you will use daily.

The real system cannot run here, so tcodes are described and the runnable parts are labelled stand-ins.

Work processes

An SAP application server executes requests in work processes, each of a fixed type:

Type Task
Dialog (DIA) Interactive user requests; short runtime limit
Background (BTC) Scheduled jobs; no time limit by default
Update (UPD, UP2) Writes changes to the database asynchronously
Enqueue (ENQ) Manages logical locks
Spool (SPO) Handles print output
Gateway (GW) Communication for RFC

SM50 shows all work processes of one server (with status such as running, waiting or on hold), and SM66 shows them across the whole system. A dialog work process stuck on a long report is a classic cause of "the system is slow".

flowchart LR
  U["User request"] --> D["Dispatcher"]
  D --> W1["Dialog WP"]
  D --> W2["Dialog WP"]
  W1 --> DB[("Database")]
  W2 --> DB

The dispatcher queues requests and hands each to a free work process. If all are busy, requests wait.

Background jobs

A background job runs programs without a user watching. A job has one or more steps (an ABAP program with a variant, an external command or an external program). You schedule them in:

  • SM36: define a job, pick start condition (immediate, date/time, after another job, after an event, periodic).
  • SM37: job overview: status, runtime, log, spool.
  • SM35: batch input sessions (legacy data load).

Job statuses you must know: Scheduled, Released, Ready, Active, Finished and Canceled (red). For a canceled job, open its job log in SM37 to read the reason: often a short dump, a locked table or missing authorization, since a job runs under the authorizations of its step user.

A variant stores the selection screen values of a program, so the same report can run every night with the same parameters.

Monitoring toolbox

Tcode What you see
SM21 System log: kernel and system messages
ST22 ABAP short dumps (runtime errors)
SM12 Lock entries (logical locks held by users)
SM13 Update requests, failed updates
SM04 / AL08 Logged-on users
ST03N Workload statistics
ST06 Operating system load
DB02 Database size and growth
SM59 RFC connections (test them)
SMQ1/SMQ2 Queued RFC
SLG1 Application log

ST22 is invaluable: each dump lists the error type, the program, the line and a variable snapshot, for example TIME_OUT, DBIF_RSQL_INVALID_REQUEST or ZERODIVIDE.

JS Stand-in: reading a job overview

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Locks and updates

When you change a document, SAP sets a logical lock (enqueue) so nobody else changes it at the same time; you see them in SM12. A stuck lock (a user left a transaction open or a dump killed the session) may be deleted there, but only after checking that the owner is really gone. Update processing is asynchronous: if it fails, the data does not reach the database, and SM13 shows the update request in error.

Housekeeping

Systems collect clutter. Typical standard jobs run daily:

  • SAP_REORG_JOBS: delete old job logs.
  • SAP_REORG_SPOOL: delete old spool requests.
  • SAP_REORG_BATCHINPUT: clean batch-input sessions.
  • SAP_REORG_UPDATERECORDS: clean old update records.
  • SAP_COLLECTOR_FOR_PERFMONITOR: collects performance data for ST03N.

A basic health routine for a Basis administrator is the daily check list: failed jobs, dumps, system log errors, locks, update errors, queue backlog, free disk space and database growth.

JS Stand-in: a daily health checklist

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Interfaces and communication

Systems talk through RFC (Remote Function Call) destinations defined in SM59, IDocs (WE02, WE05 monitor them, with BD87 for reprocessing) and web services (SOAMANAGER). A failed interface often shows as a stuck IDoc or a queue in SMQ1. After a change of landscape or system copy, testing connections in SM59 is usually the first task. Remember that connections and users also need correct authorizations (see Users, Roles and Authorizations).

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which tcode shows the status of background jobs?

    SM37 is the job overview. SM36 schedules jobs.
  2. 2. A job is canceled. Where do you read the cause?

    The job log and any short dump in ST22 give the reason.
  3. 3. What do SM12 entries represent?

    SM12 lists enqueue locks set by users or processes.
  4. 4. Which work process type writes changes to the database asynchronously?

    Update work processes execute the update requests.

Summary

  • Work processes (dialog, background, update, enqueue, spool) execute everything.
  • SM36 schedules and SM37 monitors jobs; the job log explains failures.
  • ST22, SM21, SM12, SM13 and SM50 form the daily toolbox.
  • Housekeeping jobs remove old logs, spool and update records.
  • A checklist-based daily routine catches problems early.

Next: Your First ABAP Program