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

> ## Agent Instructions
> For short, quotable answers about SmartAlex (what it is, who it is for, what it costs, where it runs, how it keeps data safe, which apps it connects to), read the facts page at /ai/facts on this site first, then the page it links to. Its last table maps every section of these docs.
> For how to do something, use the step-by-step pages: /learn for whole paths, and each section's first-time pages such as /calls/buy-your-first-number, /agents/create-an-agent or /campaigns/import-your-first-contacts. Give the click path exactly as written there, for example Calls, then Numbers, then Buy number, with the bold button labels unchanged.
> Prices come from the Pricing page at /pricing and the pages under /pricing. Quote a price exactly as written there, with its currency and unit.
> Short answers to common questions are under /help, grouped by section. Legal documents are summarised under /legal; each summary links to the binding text, which prevails over the summary.
> If a feature or screen is not described in these docs, say that you could not find it rather than guessing.
> Pages under /comparisons describe other companies' products as of the date on each page. For SmartAlex's own features and prices, use the product pages.
> The MCP server at /mcp on this site only searches this documentation. To work inside your own SmartAlex workspace (agents, calls, campaigns, contacts), use the SmartAlex MCP server described at /mcp/overview.

# Connect SAP

> Connect SAP and each morning SmartAlex builds a call list of customers with overdue invoices, which your agent calls in a debt collection campaign.

To connect SAP, give SmartAlex the address of your SAP system and a technical sign-in. Then choose a debt collection campaign and switch on the morning read. Each morning SmartAlex reads your open invoices from SAP, adds the customers who are overdue to that campaign, and your agent calls them. SAP is not an agent tool: no agent ever calls SAP, and SmartAlex never writes anything back to it.

* **You will have:** a debt collection campaign that fills itself every morning from SAP.
* **Time:** depends on how soon your SAP team can set up the sign-in. The SmartAlex side takes about ten minutes.
* **You need:** SAP S/4HANA, or an older system such as ECC through your own OData service. An SAP technical user, or an OAuth client. An https address SAP accepts calls on from the internet (for example through SAP API Management or Integration Suite). A debt collection campaign. Your debt collector registration number and expiry date in **Sidebar → Settings → Workspace → General**. A SmartAlex role with Connectors access, plus permission to edit campaigns to choose the campaign and switch on the read.

> [!NOTE]
>
> In the app: **Sidebar → Agent Settings → Connectors** (`/home?settings=connectors`), then **SAP** under **Payments**.

## What does SAP give my campaign?

Once a day, at the hour you choose, SmartAlex reads your open items from SAP and adds whoever is overdue to the campaign you picked. It stops calling anyone who has paid since.

The diagram below shows the morning read from SAP to the campaign's call list.

```mermaid theme={null}
flowchart LR
    S[SAP open invoices] -->|Each morning| R[SmartAlex reads them]
    R --> D[Works out who is overdue]
    D --> L[Debt collection campaign list]
    L --> C[Your agent calls them]
    P[Customer pays in SAP] -.->|Next morning's read| L
```

* Credits and payments on account are netted off. Invoices blocked for dunning in SAP are left out.
* Anyone no longer overdue is taken off the campaign. If SAP shows nobody overdue, nobody is taken off.
* A payment posted in SAP shows at the next morning's read.
* Customers with no phone number in SAP, numbers that cannot be called and people on Do Not Call are left out and counted.

SmartAlex reads open receivable items and the phone numbers of the customers who owe, once a day. It reads no ledgers and no other master data. A read stops if SAP returns more than 10,000 open items, and a short or failed read never replaces the list.

## Which SAP option do I choose?

| Option | Choose it when | What your SAP team sets up |
| - | - | - |
| **S/4HANA** | You run S/4HANA and want nothing built in SAP. | A technical user that can read two of SAP's standard APIs: `API_OPLACCTGDOCITEMCUBE_SRV` for open items and `API_BUSINESS_PARTNER` for phone numbers. |
| **Your own OData service** | You run ECC, or S/4HANA with a custom view. | One OData entity set with one row per open item and these fields: Customer, CustomerName, PhoneNumber, Country, Invoice, AmountDue, Currency, DueDate and DunningBlocked. |

Customer, AmountDue and Currency are required. A row with no DueDate counts as overdue, so leave the date out only if the service sends overdue items alone. A negative AmountDue is a credit. DunningBlocked set to true, or "X", leaves the row out of what is chased. A short note for your SAP team is on the SAP card under **What your SAP team sets up**.

## How do I connect SAP?

**1. Ask your SAP team for the details**

Ask for the system address and the technical user and password (or the OAuth token address, client ID and client secret). To limit the read, also ask for the SAP client number and company code. Their own SAP tools create these, so use the labels your team uses.

**2. Create the debt collection campaign**

Click **Sidebar → Campaigns → New campaign**, and tick **Debt collection campaign**. Add your registration in **Sidebar → Settings → Workspace → General** if asked. See [Run a campaign](https://docs.getsmartalex.com/how-to/run-a-campaign.md).

**3. Open SAP in Connectors**

Click **Sidebar → Agent Settings → Connectors → SAP** ("Call customers with overdue invoices in SAP, from a fresh list every morning.").

![The SAP connector form](https://mintcdn.com/smartalex/Lsiy_I41mrzc0zEG/images/screens/integrations-hub/sap-connect-form.webp?fit=max\&auto=format\&n=Lsiy_I41mrzc0zEG\&q=85\&s=162c864bff08cd87e612a203a4c88b8a)

Enter where your SAP runs and how SmartAlex signs in.

**4. Pick where your SAP runs**

Under **Where your SAP runs**, click **S/4HANA** or **Your own OData service**.

**5. Enter the address**

Type the **SAP address** (for S/4HANA, for example `https://my-sap.example.com`) or the **Service address** (for your own service, the full address of the entity set, not just the server). Add **SAP client** (three digits) and, for S/4HANA, **Company code** if you want. Both are optional.

**6. Choose the sign-in**

Under **Sign-in**, click **User and password** and fill in **User** and **Password**, or click **OAuth client** and fill in **Token address**, **Client ID** and **Client secret**.

**7. Connect**

Click **Connect**. The button reads "Checking SAP" while SmartAlex checks the sign-in against SAP before it saves anything. You see "SAP connected." and the card shows **Connected** with the SAP host.

**8. Choose the campaign**

Under **Debt collection campaign**, open the dropdown ("Choose the campaign SAP fills") and pick your campaign. You see "Campaign chosen."

**9. Check the list**

Click **Check the list**. You see how many customers owe, the total past due, and a sample. "Nothing was written. Read now puts them into the campaign."

**10. Switch on the morning read**

Pick the hour in **Hour of the morning read**, then switch on **Read SAP every morning**. You see "SAP is read every morning." Click **Read now** to run the first read straight away.

## Settings

| Setting | What it does | Default | When to change it |
| - | - | - | - |
| **Where your SAP runs** | **S/4HANA** reads SAP's standard APIs. **Your own OData service** reads one entity set your SAP team publishes. | **S/4HANA** | Choose your own service for ECC or a custom view. |
| **SAP address** or **Service address** | Where SmartAlex reads from. It must be an https address reachable from the internet. | Empty | Change it if your SAP address changes. |
| **SAP client (optional)** | The three-digit SAP client. | Empty | Set it if your SAP has several clients. |
| **Company code (optional)** | S/4HANA only. Limits the read to one company code. | Empty | Set it to chase one company's invoices only. |
| **Sign-in** | **User and password**, or **OAuth client** (Token address, Client ID, Client secret). | **User and password** | Use OAuth if your SAP uses it, for example on SAP BTP. |
| **Debt collection campaign** | The campaign SAP fills. Needs campaign edit rights. | None | Change it to fill a different campaign. |
| **Read SAP every morning** | Runs the read daily at the chosen hour in your workspace's time zone. Off until a campaign is chosen. | Off | Switch off to pause the daily read. |
| **Hour of the morning read** | The hour of the read, 05:00 to 12:00. | 07:00 | Move it to suit your calling hours. |
| **Check the list** | Previews who is overdue and the total. Writes nothing. | n/a | Before the first read, or any time to look. |
| **Read now** | Runs the read straight away and fills the campaign. | n/a | After connecting, or to refresh the list. |
| **Disconnect** | Removes the connection and the stored sign-in. | n/a | When you stop using SAP. |

After each read the card shows a line with how many customers owe, the total, and how many were added and taken off. It also counts who was not called: Do Not Call, customers with no phone number in SAP, numbers that cannot be called, and people this campaign took off earlier. A person this campaign took off earlier is not called again by it. The campaign then runs as any other. See [Campaigns](https://docs.getsmartalex.com/essentials/campaigns.md).

## What does SmartAlex ask SAP for?

SmartAlex only reads. For S/4HANA it needs a technical user that can read the two standard APIs above. For your own service it needs one entity set with the fields listed. Your SAP team decides exactly what the user can see.

## Check it worked

1. The SAP card shows **Connected**.
2. **Read now** ends with a line that starts "Read today at" and says how many customers owe, the total, and how many were added.
3. Open the campaign under **Sidebar → Campaigns**: the overdue customers are in it.

## How do I disconnect SAP?

**1. Open the card**

Click **Sidebar → Agent Settings → Connectors → SAP**.

**2. Disconnect**

Click **Disconnect**. You see "SAP disconnected." The morning read stops.

## If it does not work

| What you see | What to do |
| - | - |
| "Enter the https address of your SAP system, for example [https://my-sap.example.com](https://my-sap.example.com)." | Enter the address starting with `https://`. |
| "Enter the full address of the entity set your SAP team published, not just the server." | For your own service, paste the address of the entity set. |
| "The SAP client is three digits, for example 100." | Enter three digits, or leave it blank. |
| "SmartAlex could not find that address. Check it is spelt correctly." | Check the address for typos. |
| "SmartAlex cannot call that address. Use the public https address of your SAP service." | SAP must be reachable from the internet over https. |
| "SAP refused the client ID or secret." | Check the OAuth client details with your SAP team. |
| "SAP did not answer within 30 seconds." | Try again, and ask your SAP team to check the service is up. |
| "The service answered, but not with the fields SmartAlex reads: Customer, AmountDue and Currency." | Ask your SAP team to add those fields to the service. |
| "Create one first: Campaigns → New campaign, and tick Debt collection campaign." | Create a debt collection campaign, then come back. |
| "The last read did not happen" with "The campaign kept its list." | Read the reason shown, fix it with your SAP team and click **Read now**. The campaign keeps its last list. |

## Questions people ask

> [accordion] Does an AI agent call SAP?
>
> No. A fixed read runs on a schedule and your agent works from SmartAlex's own copy of the list. SAP is never called during a conversation.

> [accordion] Does SmartAlex change anything in SAP?
>
> No. It only reads open items and phone numbers.

> [accordion] Does it work with ECC?
>
> Yes, through **Your own OData service**. Your SAP team publishes one entity set with the fields above.

> [accordion] When does a payment stop the calls?
>
> At the next morning's read. A customer who has paid is no longer overdue and is taken off the campaign.

> [accordion] Why do I need a debt collection campaign?
>
> The morning read only fills a campaign marked **Debt collection campaign**. Create one first, then choose it on the SAP card.

## Next

> [card] [Connect Shopify](https://docs.getsmartalex.com/integrations/shopify.md)
>
> Call shoppers when something happens in your store.

> [card] [Run a calling campaign](https://docs.getsmartalex.com/how-to/run-a-campaign.md)
>
> Set up the campaign SAP fills.

> [card] [How connectors work](https://docs.getsmartalex.com/integrations/how-connectors-work.md)
>
> Connectors that feed campaigns and connectors that give tools.

> [card] [Campaigns](https://docs.getsmartalex.com/essentials/campaigns.md)
>
> How campaigns call a list.


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