# Login

Logs in to a system in SAP GUI with a username and password and brings the session window to the front. If a session with the same system, client, language and user is already open, no new login is made and that session is used. If SAP Logon is not running, it is started with its window hidden. If any field other than `Timeout` is empty, the activity throws an error.


---

### :arrow_left:**INPUT**

| **Parameter** | **Type** | **Required** | **Description** |
|-----------|------|----------|-------------|
| `Host`    | `String` | ✅ Yes    | The Description of the connection entry in SAP Logon, or the server name. The connection is opened first from the SAP Logon entry that matches `SystemId`, otherwise from the entry that matches this value; if there is none either, the value is used directly as a connection string (e.g. `/H/...`). |
| `Username` | `String` | ✅ Yes    | SAP username. |
| `Password` | `SecureString` | ✅ Yes    | The user's password. |
| `Client`  | `String` | ✅ Yes    | SAP client (mandant) number (e.g. `100`). |
| `Language` | `String` | ✅ Yes    | Session language (e.g. `TR`, `EN`). |
| `SystemId` | `String` | ✅ Yes    | SAP system ID (SID). An open session is searched for with this value; the system name of the session opened after login must also match it, otherwise the activity throws an error when the time runs out. |
| `Timeout` | `TimeSpan` | ❌ No     | Maximum time to wait for the login to complete. If empty, 0 or negative, 30 seconds. If the session cannot be opened within this time (e.g. wrong password, unreachable server), the activity throws an error. |


---

### Usage

* If the user is also logged on elsewhere, SAP's multiple logon prompt is answered by continuing without closing the other sessions.
* If an error message appears on the login screen, the opened session is closed.
* Scripting support (SAP GUI Scripting) must be enabled in SAP GUI. If it is disabled, the activity cannot access the opened session and throws an error; the other SAP activities do not work either.