SAP function moduleObjectDEQUEUE_ALLModuleABAP

DEQUEUE_ALL — DEQUEUE_ALL Function Module Reference

DEQUEUE_ALL releases every lock entry the current user or session holds in the SAP enqueue table, regardless of which lock object created them. It has no exception interface, so a call always returns without error whether or not any locks actually existed or were removed. It is a blunt cleanup tool, not a substitute for dequeuing a specific lock object with its generated DEQUEUE_ function module.

Covers what DEQUEUE_ALL actually does inside the enqueue mechanism, why its interface has no exceptions to check, and the operational mistakes that follow from treating it as a safe general-purpose lock cleanup call. Also covers ownership between application development and Basis when stray or missing locks are being investigated.

Published 16 Sept 2026· 998 words

What it does

DEQUEUE_ALL is a standard, released function module that instructs the enqueue server to remove all lock entries owned by the calling user context, without regard to which lock object or table those entries belong to. It exists for situations where a program needs to guarantee a clean lock state without tracking the exact set of individual locks it set, such as generic error recovery or end-of-dialog cleanup in older custom code. It is callable directly from ABAP and is part of the standard runtime; it is not a generated lock-object function module and does not target a single business object. Because of this breadth, it is meant as a last-resort cleanup mechanism, not the normal way to release a lock that a program itself acquired deliberately.

Parameters

The interface takes only importing parameters, all optional with defaults, and returns nothing.

  • _SCOPE: controls which lock scope is targeted, mirroring the scope values used by generated ENQUEUE_/DEQUEUE_ modules (transaction-local versus update-task/global); default releases both, meaning the call is genuinely comprehensive unless narrowed.
  • _SYNCHRON: determines whether the dequeue request is sent synchronously to the enqueue server, waiting for confirmation, or queued asynchronously (default), meaning the call can return before the lock table entry is physically gone.
  • _COLLECT: determines whether the dequeue request is bundled with other pending lock requests and flushed together at the next synchronization point, instead of being sent immediately.

Exceptions

DEQUEUE_ALL exposes no EXCEPTIONS in its interface at all. This is not an oversight to work around; dequeue operations in the SAP lock concept are designed as fire-and-forget requests to the enqueue server, so there is nothing for the caller to catch. The practical consequence is that sy-subrc after the call is always zero, independent of whether any locks were actually held, whether the enqueue server was reachable, or whether the removal has physically completed by the time control returns. Code that checks sy-subrc to decide whether the cleanup 'worked' is checking a value that carries no information. The real failure mode is silent: a call can appear to succeed while locks are still visible to other work processes for a short window, or while locks the caller assumed were theirs were never touched because the scope or session context did not match what was expected.

How to call it safely

Call it with explicit scope rather than relying on the default when the intent is narrower than 'release everything this session holds'. After the call, do not test sy-subrc; instead verify the actual lock state directly if the outcome matters, by checking the enqueue table for the specific object the program cares about. If the code path depends on the lock being gone before the next statement executes, pass _SYNCHRON as active rather than leaving the request queued, since the default asynchronous behaviour only guarantees the request was sent, not that it has been processed.

ECC vs S/4HANA

DEQUEUE_ALL remains available on S/4HANA as part of the kernel-level enqueue/dequeue function module set; it has not been deprecated or replaced by a named successor. It sits outside the clean-core extensibility model in the sense that direct calls to generic lock-management function modules from custom code are discouraged in favour of letting locks fall away naturally at commit or rollback, or dequeuing through the specific generated function module tied to the lock object that was used to set the lock in the first place.

Common pitfalls

  • Using DEQUEUE_ALL as a quick fix for a stuck-lock support ticket inside a long transaction releases locks other parts of the same logical unit of work still depend on, producing inconsistent updates later in the same LUW rather than fixing anything.
  • Assuming a missing exception means the release actually happened; there is no exception to raise in the first place, so error-handling code built around checking the return is dead code that hides real failures.
  • Calling it from background jobs on a schedule to 'clear stale locks' when the locks are legitimately held by active dialog users, letting a second user overwrite data mid-edit and creating a lost-update situation that looks like a data corruption bug days later.
  • Relying on the default asynchronous mode when a subsequent step in the same program immediately tries to re-lock the same object, and hitting an intermittent foreign-lock error because the original dequeue had not yet completed on the enqueue server.
  • Treating DEQUEUE_ALL as scoped to one business object because it was called right after finishing work on that object, when in fact it releases unrelated locks the same session is holding elsewhere in the transaction.

Whose problem this is

The application developer who added the explicit call owns the consequences of what gets released and when. Basis gets pulled in when investigating enqueue table contents during a lock-related incident, typically via the standard lock display transaction, but the decision to call DEQUEUE_ALL rather than a targeted dequeue is a design choice made in custom or inherited ABAP code, and fixing a misuse means changing that code, not tuning the enqueue server.

Related SAP objects

Reviewed pages this object connects to in the ERPClimb knowledge graph.

Source: ERPClimb — https://erpclimb.com/sap-function-modules/dequeue-allERPClimb is an independent platform and is not affiliated with SAP SE. Reference pages are written and reviewed by SAP consultants for learning and troubleshooting.