# ENQUEUE_E_TABLE — Lock Table Entries (Generic)

> Generated lock module of lock object E_TABLE that sets a logical SAP lock on a whole table or on entries identified by a generic key. Developers use it before changing custom or customizing tables in programs that have no dedicated lock object. Pass the table name in TABNAME and the key prefix in VARKEY, handle FOREIGN_LOCK and release the lock with DEQUEUE_E_TABLE.

- Modules: CA
- Type: Function module
- Function group: /1BCDWBEN/SEN4
- Remote-enabled (RFC): No
- S/4HANA status: Used the same way in S/4HANA
- URL: https://nekuhub.com/en/functions/enqueue-e-table/

## Importing parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| MODE_RSTABLE | DD26E-ENQMODE | Lock mode (E, S, X) | - |
| TABNAME | RSTABLE-TABNAME | Table name | - |
| VARKEY | RSTABLE-VARKEY | Key of the entries to lock | - |
| X_TABNAME | - | Lock initial table name value | - |
| X_VARKEY | - | Lock initial key value | - |
| _SCOPE | - | Lock scope (dialog, update task or both) | - |
| _WAIT | - | Wait and retry if the lock is held | - |
| _COLLECT | - | Collect lock request | - |

## Exceptions

- FOREIGN_LOCK: Entry already locked by another user
- SYSTEM_FAILURE: Lock server error

## Call template (ABAP)

```abap
CALL FUNCTION 'ENQUEUE_E_TABLE'
  EXCEPTIONS
    foreign_lock = 1
    system_failure = 2
    OTHERS = 3.
```


