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.

**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) | Common questions about creating, running, and managing flows in Leapwork. |
| [Flows Troubleshooting](https://docs.leapwork.com/troubleshooting/latest/leapwork-flow-troubleshooting/flows-troubleshooting) | 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) | Provides quick answers and guidance for common questions and issues when automating SAP applications with Leapwork.
