> For the complete documentation index, see [llms.txt](https://docs.kognitos.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kognitos.com/legacy/legacy-experience/books/reference/sap.md).

# SAP

Procedures and concepts for the SAP integration.

{% hint style="info" %}
The following documentation is for **SAP v2.7.0** *(BDK)*.
{% endhint %}

## Overview

SAP is an enterprise resource planning (ERP) software providing comprehensive business process management. This integration enables automated data synchronization, transaction processing, and business workflow automation within SAP systems. Streamline enterprise operations and improve ERP system efficiency.

## Prerequisites

### 1. Required Books

The following Book(s) need to be added to your agent so it can learn and understand the automation procedures defined within them:

* **SAP**

#### How to Add the Book(s)

1. Go to **Books** → **All Books**.
2. Search for the name of the book and click on it.
3. Click on <kbd>**Install**</kbd> or <kbd>**Add Connection**</kbd> to add the book to your agent.
4. If adding a connection, you'll be prompted for [**connectivity**](#connectivity) details.

## Connectivity

This section outlines the available methods for connecting to the Book, along with the required configuration details for each.

### Connect using Base URL, Username and Password

Connects to the SAP OData API.

| Label    | Description                                                                                                                                                                                                                               | Type        |
| -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- |
| Base URL | The base URL of the SAP OData API endpoint, including the protocol and hostname (e.g. '<https://my-sap-system.example.com>'). Do not include a trailing slash or any service-specific path segments — only the root server URL is needed. | `text`      |
| Username | The SAP user account name used for Basic Authentication. This is typically a technical communication user or dialog user with the appropriate authorizations configured in the SAP system (e.g. 'SAP\_INTEGRATION\_USER').                | `text`      |
| Password | The password associated with the SAP user account. This value is stored securely and transmitted using Basic Authentication over HTTPS. Ensure the password has not expired and the user account is not locked in the SAP system.         | `sensitive` |

## Procedures

### to retrieve some entities from *sap*

Retrieve the list of available SAP entities for a given API service.

**Input Concepts**

| Concept       | Description                                    | Type   | Required | Default Value |
| ------------- | ---------------------------------------------- | ------ | -------- | ------------- |
| `api service` | The API service to retrieve the entities from. | `text` | Yes      | (no default)  |

**Output Concepts**

| Concept  | Description                                       | Type   |
| -------- | ------------------------------------------------- | ------ |
| `answer` | the list of available SAP entities in the Service | `json` |

**Examples**

```generic
retrieve some services from sap
use the first service as the api service
retrieve some entities from sap
    the api service is the api service
```

### to retrieve some services from *sap*

Retrieve the list of available SAP services.

**Output Concepts**

| Concept  | Description                        | Type   |
| -------- | ---------------------------------- | ------ |
| `answer` | the list of available SAP services | `file` |

**Examples**

```generic
retrieve some services from sap
```

### to upload an attachment to *sap*

Upload an attachment to SAP.

**Input Concepts**

| Concept                 | Description                | Type   | Required | Default Value |
| ----------------------- | -------------------------- | ------ | -------- | ------------- |
| `attachment`            | The attachment to upload.  | `file` | Yes      | (no default)  |
| `file name`             | The name of the file.      | `text` | Yes      | (no default)  |
| `business object type`  | The business object type.  | `text` | Yes      | (no default)  |
| `linked sap object key` | The linked SAP object key. | `text` | Yes      | (no default)  |

**Output Concepts**

| Concept  | Description              | Type   |
| -------- | ------------------------ | ------ |
| `answer` | The created entity data. | `json` |

**Examples**

```generic
the attachment
upload the attachment to sap
    the file name is "from-pg2.pdf"
    the business object type is "BUS2012"
    the linked sap object key is "4500002088"
```
