> For the complete documentation index, see [llms.txt](https://docs.theconfigteam.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.theconfigteam.com/prebilt-ewm/installation/neptune-installation/lock-handling.md).

# Lock Handling

{% hint style="info" %}
**Note**

This step is only applicable in the development environment so does not need to be completed in any other systems in the landscape.
{% endhint %}

{% stepper %}
{% step %}

#### Create a background event

* Open SAP transaction *SM62*.
* Navigate to **Goto > Background Events** and click **New**.
* Enter the following details:
  * **Event**: `NEPTUNE_LOCK`
  * **Description**: *Neptune Lock Handler*
    {% endstep %}

{% step %}

#### Configure the background job

* Open SAP transaction *SE38*.
* Enter program `/NEPTUNE/HANDLER_LOCKING` and click **Execute**.
* Provide the required parameters:
  * **Time between lock request checks (seconds)**: Recommended value is **2**.
  * **Background user name (mandatory)**: This must match the user running the background job.
  * **Automatic lock release time (minutes)**: Leave blank to disable. Recommended value is **180**.
* Click **Save** and create a variant named `DEFAULT`.
* Click **Save** again to store the variant.
  {% endstep %}

{% step %}

#### Create the background job

* Open SAP transaction *SM36*.
* Enter job name `NEPTUNE_LOCK_HANDLER` and press **Enter**.
* Configure the job step with the following:
  * **User**: Username responsible for locking/unlocking resources (must have sufficient permissions and not be subject to deletion or locking).
  * **ABAP Program Name**: `/NEPTUNE/HANDLER_LOCKING`
  * **Variant**: `DEFAULT`
* Click **Save**.
  {% endstep %}

{% step %}

#### Define the start condition

* Click **Start Condition**.
* Select **After Event** and enter event `NEPTUNE_LOCK`.
* Ensure **Periodic Job** is checked.
* Click **Save** to complete the setup.
  {% endstep %}
  {% endstepper %}
