TH_WPINFO — Reading work process status via TH_WPINFO
TH_WPINFO is a kernel-interfacing function module that returns the current status of all work processes on an application server instance, the same data shown in SM50 or SM51. It is not a released, stable customer API; it is an internal Basis tool commonly called by monitoring scripts and CCMS-style tooling via RFC to poll a local or remote instance's work process table.
This page covers TH_WPINFO, the function module Basis teams use to pull SM50-style work process data programmatically, often across instances via RFC. It focuses on the exceptions that get swallowed in monitoring code, the difference between a failed call and a genuinely idle instance, and the load implications of polling it too aggressively.
Published 16 Sept 2026· 1,186 words
What it does
TH_WPINFO reads the work process table of an application server instance and returns it to the caller in the same shape and content that SM50 or SM51 render on screen: process number, type, status, current user, report or transaction, and timing figures. It talks directly to the kernel/dispatcher interface rather than to an application table, so the data reflects the instance's live state at the moment of the call, not a persisted snapshot. It is not part of any released customer API contract; SAP does not guarantee interface stability across releases the way it does for a BAPI. In practice it is widely used inside Basis-written monitoring jobs, health-check scripts, and third-party monitoring tools that need work process load without opening SM50 manually, frequently invoked against a remote instance through an RFC destination rather than only locally.
Parameters
Only the parameters that can be stated with confidence are described here in functional terms rather than by exact technical name, since the precise signature is not something to guess at for a page like this.
- An import parameter identifying which instance to query; left blank it defaults to the calling instance, populated it targets a specific application server by its instance identifier.
- An exporting table parameter that returns one row per work process, carrying process number, work process type (dialog, background, update, enqueue, spool), current status (running, waiting, stopped, private mode), the report or transaction currently executing, the logged-on user, and elapsed and CPU time for the current action.
- The call is almost always made via an RFC destination pointing at the target instance rather than locally, since the whole point of using it is usually to inspect a remote server without logging on there directly.
Exceptions
The exceptions on this function module map to failure to reach or read the target instance, not to business logic problems, and treating them as optional is where monitoring code goes wrong.
- A communication failure means the RFC connection to the target instance's gateway could not be established or dropped mid-call; this happens when the instance is down, the gateway is not listening, or a firewall between systems blocks the port. Swallowed, the caller gets an empty or partial table and a monitoring job reports the instance as idle when it is actually unreachable.
- A system failure means the kernel-level call itself failed on the target side, for example the dispatcher was in the middle of a restart or the work process table could not be read at that instant. Ignoring it produces the same false-idle symptom as above but is transient rather than persistent, so retrying briefly is the correct response instead of alerting immediately.
- An invalid or badly formed destination or instance identifier causes an immediate failure before any RFC call is attempted; this is a caller-side configuration error, most often a typo in the instance name or a destination maintained with the wrong host and system number.
- In all three cases the returned work process table is empty or stale if the exception is not checked, and downstream code that averages load or counts busy work processes across instances will silently under-report, masking a real outage as low load.
How to call it safely
Resolve the target instance identifier first, either from the system's own instance list or from configuration, and decide whether the call is local or should go through an RFC destination pointing at that specific instance. Call the function module, check the return code and each exception explicitly rather than relying on a generic catch-all, and treat a non-zero return as a failed read, not as zero work processes. After a successful call, inspect the returned table for plausibility: an unexpectedly empty table on an instance known to be up is itself a signal worth logging, since it usually means the exception handling upstream discarded a real error. Do not call this in a tight polling loop across many instances without a minimum interval; each call has real cost on the dispatcher being queried.
ECC vs S/4HANA
The underlying kernel and dispatcher architecture that TH_WPINFO reads from is common to both ECC and S/4HANA, and the function module continues to exist and behave the same way on S/4HANA on-premise systems. It has not been published as a released, whitelisted API and is not appropriate to call from custom code in an S/4HANA Cloud, public edition system under clean-core rules. There is no announced customer-facing successor; current SAP monitoring direction for work process and instance health runs through the standard CCMS monitoring infrastructure and, at the landscape level, through dedicated monitoring products, rather than through a new function module replacing this one.
Common pitfalls
Most incidents involving this function module trace back to how its output is interpreted rather than to the function module misbehaving.
- Treating an empty result table as proof the instance has no busy work processes, when the actual cause is a swallowed communication or system failure and the instance was unreachable at the time of the call.
- Polling every instance in a landscape every few seconds from a central monitoring job, which adds measurable dispatcher and gateway overhead across the estate and can itself contribute to the load being measured.
- Calling it during an instance restart or kernel patch window and treating the inconsistent, half-populated data returned as a real steady-state snapshot rather than a transient artefact.
- Assuming the function module can influence or terminate work processes because the data resembles the SM50 screen; it is read-only and has no effect on the processes it reports on.
- Hardcoding an RFC destination to a specific instance and never revalidating it after an instance is moved, renamed, or decommissioned, so the monitoring job quietly starts failing against a target that no longer exists.
Whose problem this is
This sits squarely with the Basis or infrastructure team responsible for instance and work process monitoring. Application development teams should not be building business logic that depends on it, and any custom job that calls it should be documented and owned by whoever maintains the monitoring landscape, since it is the team that will be paged when the polling job itself starts failing.
Related SAP objects
Reviewed pages this object connects to in the ERPClimb knowledge graph.
Source: ERPClimb — https://erpclimb.com/sap-function-modules/th-wpinfoERPClimb is an independent platform and is not affiliated with SAP SE. Reference pages are written and reviewed by SAP consultants for learning and troubleshooting.