> ## Documentation Index
> Fetch the complete documentation index at: https://docs.noxus.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# SAP

> Connect SAP S/4HANA through OData, or an SAP HANA database through SQL

Noxus connects to SAP in two ways. Which one you need depends on the address you were given.

| Integration | Talks to | Address you connect to | Use it to |
| :- | :- | :- | :- |
| **SAP S/4HANA** | The ABAP application server, through OData | The application server URL with its HTTP port, for example `https://s4hana.example.com:44300` | Read and write business objects (business partners, sales orders and so on) through SAP's OData services |
| **SAP HANA** | The HANA database, through SQL | The database host and its SQL port, for example `30015` | Run SQL on tables directly |

## SAP S/4HANA

### Connect

Open **Connections** → **Add connection** → **SAP S/4HANA**. Enter:

| Field | Default | What to enter |
| :- | :- | :- |
| **Server URL** | Empty | The application server URL including its port (commonly 8000 for HTTP, 44300 for HTTPS). This is the ABAP application server, not the HANA database host |
| **SAP Client** | Empty | The client (mandant) to log on to, for example `100` or `600` |
| **Username** | Empty | An ABAP user with access to the OData services you need |
| **Password** | Empty | That user's password |
| **OData Version** | OData v2 | **OData v2** (`/sap/opu/odata/`) or **OData v4** (`/sap/opu/odata4/`) |
| **Verify SSL Certificate** | On | Turn off for a server with a self-signed certificate |
| **Validation Service Path** *(advanced)* | Empty | A service to test the connection with, for example `/sap/opu/odata/sap/API_BUSINESS_PARTNER`. Leave it empty to test with the OData catalog. Set it when the catalog service is not activated in SICF |
| **Allow Private/Internal Host** *(advanced)* | Off | Needed when the SAP server has a private IP. Only honoured on self-hosted deployments |

Click **Connect**. Noxus makes a real call to your server when you save, so a wrong URL, client or password shows on the connection as **Invalid** with SAP's reason.

### Nodes

In the flow editor, the nodes are under **Integrations** → **SAP S/4HANA**. Each node has a **Connection** field to pick which SAP S/4HANA connection it uses. Every text field can hold a fixed value or a variable from earlier in the flow. Agents can also use these nodes as tools.

| Node | What it does |
| :- | :- |
| [List OData Services](#list-odata-services) | Lists the OData services in the SAP gateway catalog |
| [List Entity Sets](#list-entity-sets) | Lists the entity sets of one service |
| [Read Entities](#read-entities) | Reads records from an entity set, with filter, fields, order and paging |
| [Create Entity](#create-entity) | Creates a record in an entity set |
| [Update Entity](#update-entity) | Updates a record by its key |
| [Delete Entity](#delete-entity) | Deletes a record by its key |
| [OData Request](#odata-request) | Sends any OData request, including function imports |

Several nodes share these fields:

* **Service Path**: the OData service path on the SAP gateway, for example `/sap/opu/odata/sap/API_BUSINESS_PARTNER`. Required.
* **Entity Set**: the entity set to work on, for example `A_BusinessPartner`. Required.
* **Entity Key**: a single key value, such as `1000`, or a JSON object for a composite key, such as `{"SalesOrder": "4711", "Item": 10}`. Required.
* **Payload (JSON)**: a JSON object with the fields to send, such as `{"BusinessPartnerCategory": "1"}`. Required.

Noxus fetches SAP's CSRF token for you before every write.

#### List OData Services

| Field | Default | What it does |
| :- | :- | :- |
| **Filter** | Empty | Only services whose ID or title contains this text |

Outputs: **services** (a JSON list, each with its ID, title and service URL) and **count**.

#### List Entity Sets

Reads the service's `$metadata`.

| Field | Default | What it does |
| :- | :- | :- |
| **Service Path** | Empty (required) | |

Outputs: **entity\_sets** (the names as a JSON list) and **count**.

#### Read Entities

| Field | Default | What it does |
| :- | :- | :- |
| **Service Path** | Empty (required) | |
| **Entity Set** | Empty (required) | |
| **Filter** | Empty | An OData `$filter` expression, for example `Country eq 'PT'` |
| **Select Fields** | Empty | Fields to return, separated by commas |
| **Expand** *(advanced)* | Empty | Navigation properties to expand, separated by commas |
| **Order By** *(advanced)* | Empty | An OData `$orderby` expression, for example `BusinessPartner desc` |
| **Maximum Rows per Page** | `0` | Rows per page, up to 5000. `0` uses the server's page size |
| **Skip** *(advanced)* | `0` | Rows to skip |
| **Maximum Pages to Follow** *(advanced)* | `10` | SAP returns large results in pages. The node follows the next page link up to this many pages (1 to 200) |

Outputs: **results** (the records as a JSON list) and **row\_count**.

#### Create Entity

| Field | Default |
| :- | :- |
| **Service Path** | Empty (required) |
| **Entity Set** | Empty (required) |
| **Payload (JSON)** | Empty (required) |

Output: **result** (SAP's response as JSON).

#### Update Entity

Sends a `MERGE` on OData v2 and a `PATCH` on OData v4, so only the fields in the payload change.

| Field | Default |
| :- | :- |
| **Service Path** | Empty (required) |
| **Entity Set** | Empty (required) |
| **Entity Key** | Empty (required) |
| **Payload (JSON)** | Empty (required) |

Output: **result** (SAP's response as JSON).

#### Delete Entity

| Field | Default |
| :- | :- |
| **Service Path** | Empty (required) |
| **Entity Set** | Empty (required) |
| **Entity Key** | Empty (required) |

Output: **result** (SAP's response as JSON).

#### OData Request

For function imports and anything the other nodes do not cover.

| Field | Default | What it does |
| :- | :- | :- |
| **Method** | GET | GET, POST, PATCH, MERGE, PUT or DELETE |
| **Path** | Empty (required) | The path after the server URL, for example `/sap/opu/odata/sap/API_BUSINESS_PARTNER/A_BusinessPartner('1000')` |
| **Query Parameters (JSON)** *(advanced)* | Empty | A JSON object of query parameters, for example `{"$top": "5"}` |
| **Body (JSON)** | Empty | A JSON object to send with a write method |

Outputs: **response** (the response body, as JSON when SAP returns JSON) and **status\_code**. An error status from SAP does not fail this node: check **status\_code**.

### When a node fails

The other nodes fail with SAP's own error message when SAP returns one, for example "Business Partner 1 does not exist". Otherwise:

| Message contains | What to do |
| :- | :- |
| authentication failed (401) | Check the username, password and SAP client of the connection. |
| forbidden (403) | Activate the OData service in SICF, or give the user authorization for it. |
| response is not JSON | Check the host, port and service path: the address may not be an OData service. |
| must be valid JSON | Fix the JSON in the payload, body or query parameters field. |

## SAP HANA

### Connect

Open **Connections** → **Add connection** → **SAP HANA**. Enter:

| Field | Default | What to enter |
| :- | :- | :- |
| **Server Address** | Empty | The database host, for example `your-server.hana.ondemand.com` |
| **Port** | `443` | The SQL port, for example `443` or `30015` |
| **Username** | Empty | A HANA database user |
| **Password** | Empty | That user's password |
| **Tenant Database (Optional)** *(advanced)* | Empty | The tenant to connect to, for example `S4D`. Required when you connect through the SYSTEMDB port (3\<nn>13). Leave it empty when the port already selects the tenant (3\<nn>15 or 3\<nn>41) |
| **Use SSL Encryption** | On | |
| **Validate SSL Certificate** | Off | |

Click **Connect**. Noxus connects to the database when you save, so a wrong address, port or password shows on the connection as **Invalid** with the reason.

> [!NOTE]
>
> An SAP HANA connection pointed at an HTTP port such as 8000 fails: that port belongs to the application server, not the database. Use SAP S/4HANA for it instead.

### Nodes

In the flow editor, the nodes are under **Integrations** → **SAP HANA**. Each node has a **Connection** field. Every text field can hold a fixed value or a variable from earlier in the flow. Agents can also use these nodes as tools.

| Node | What it does |
| :- | :- |
| [Execute Query](#execute-query) | Runs a SELECT query |
| [Execute Custom SQL](#execute-custom-sql) | Runs any SQL statement |
| [Insert Row](#insert-row) | Inserts one row into a table |
| [Update Rows](#update-rows) | Updates the rows that match a WHERE clause |
| [Delete Rows](#delete-rows) | Deletes the rows that match a WHERE clause |

#### Execute Query

| Field | Default | What it does |
| :- | :- | :- |
| **SQL Query** | Empty (required) | A SELECT query, for example `SELECT * FROM MY_TABLE WHERE STATUS = 'A'` |
| **Maximum Rows (Optional)** *(advanced)* | `0` | The maximum number of rows to fetch, up to 100000. `0` fetches all rows |

Outputs: **results** (the rows) and **row\_count**.

#### Execute Custom SQL

| Field | Default | What it does |
| :- | :- | :- |
| **SQL Statement** | Empty (required) | Any SQL statement, for example an `INSERT` |

Outputs: **result** (what the statement returned) and **success** (`true`).

#### Insert Row

| Field | Default | What it does |
| :- | :- | :- |
| **Table Name** | Empty (required) | For example `Z_DELIVERY_HEADER` |
| **Data (JSON)** | Empty (required) | A JSON object of column and value pairs, for example `{"COL1": "value1"}` |

Outputs: **rows\_affected** and **success** (`true` when at least one row was inserted).

#### Update Rows

| Field | Default | What it does |
| :- | :- | :- |
| **Table Name** | Empty (required) | |
| **WHERE Clause** | Empty (required) | Without the `WHERE` keyword, for example `DELIVERY_ID = '8000000004'` |
| **Update Data (JSON)** | Empty (required) | A JSON object of the columns to change and their new values |

Outputs: **rows\_affected** and **success** (`true` when at least one row changed).

#### Delete Rows

| Field | Default | What it does |
| :- | :- | :- |
| **Table Name** | Empty (required) | |
| **WHERE Clause** | Empty (required) | Without the `WHERE` keyword. It is required for safety: use `1=1` to delete every row |

Outputs: **rows\_affected** and **success** (`true` when at least one row was deleted).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.