---
version: "2026.1.0"
language: "en"
---
# Close SAP

The **Close SAP** building block closes the **SAP GUI** application if it is already open. Depending on the selected action, you can close all open connections and sessions, or target a specific connection or session.  
![image-20260204-142306.png](https://docs.leapwork.com/__attachments/a_59381c55ac09eb8ce7db296c7d657ff49c5921209e95a1211fa08de6f431f96f/image-20260204-142306.png?cb=efa9ecfb7abfd24669b88fdbae46d2c5)

**Note:** The screenshot on this page uses the **Elegance Design** , introduced in **2025.3**. If you are using an earlier version, your layout may look different.

## Quick-start

1. Drag **Close SAP** onto the canvas.

2. Connect the block in the flow and set **Action**.

3. Run the flow when it's ready.

## Building block parameters

Parameters  
* **Block header** : The green input connector triggers the block to start executing. The green output connector triggers when the SAP application has been successfully closed. You can rename the block by double-clicking the header text and typing in a new title.

* **Action**: Selects what should be closed.

  * **Close all**: Closes all open SAP connections and sessions.

  * **Close connection**: Closes the specified connection.

  * **Close session**: Closes the specified session.

## Resources

|                                                **Topic**                                                |                                                   **Description**                                                   |
|---------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------|
| [Flows FAQ](https://docs.leapwork.com/faq/latest/leapwork-flow-faq/flows-faq.md)                                                 | Common questions about creating, running, and managing flows in Leapwork.                                           |
| [Flows Troubleshooting](https://docs.leapwork.com/troubleshooting/latest/leapwork-flow-troubleshooting/flows-troubleshooting.md) | Guidelines and solutions for identifying and fixing issues that occur when building or running flows in Leapwork.   |
| [SAP FAQ](https://docs.leapwork.com/faq/latest/leapwork-flow-faq/sap-faq.md)                                                     | Provides quick answers and guidance for common questions and issues when automating SAP applications with Leapwork. |