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

# SAP S/4HANA

SAP S/4HANA is a core enterprise resource planning (ERP) system that manages finance, procurement, supply chain, and operations data. Connecting SAP S/4HANA to Duvo enables your agents to query and retrieve live enterprise data directly from your SAP environment, eliminating manual data extraction and SAP transactions.

<Note>
  SAP S/4HANA is **read-only** in Duvo. Agents can search and retrieve records but cannot create, update, or delete data in your SAP system.
</Note>

## Setup

Connecting SAP S/4HANA to Duvo requires three setup steps in your SAP system — creating a technical user, activating the required OData services with OAuth enabled, and registering an OAuth 2.0 client. Once complete, enter the credentials in Duvo to enable the connection.

<Steps>
  <Step title="Create a technical user" icon="user">
    In your SAP system, run transaction `SU01` and create a technical user.

    * Set **User Type** to **System**.
    * Save the password — this becomes the `Client Secret` in Duvo.
    * Assign authorizations:
      * **Sandbox / testing:** `SAP_ALL` (validate connectivity only — never use in production).
      * **Production:** `SAP_BC_OAUTH2_API` plus the SAP-delivered specialist role for each API you plan to use — for example, `SAP_BR_BUPA_MASTER_SPECIALIST` (Business Partner), `SAP_BR_PRODMASTER_SPECIALIST` (Product), `SAP_BR_PRICING_SPECIALIST` (Pricing), `SAP_EWM_*` (Warehouse).

    Role names vary by S/4HANA release — check PFCG for your system's equivalents.

    <Warning>
      `SAP_ALL` is a highly privileged profile that grants full access to the SAP system. Use it only to validate connectivity in a sandbox, never in production. For production, assign least-privilege roles: `SAP_BC_OAUTH2_API` plus the SAP-delivered specialist role per activated API.
    </Warning>
  </Step>

  <Step title="Activate the OData services" icon="plug">
    Run transaction `/IWFND/MAINT_SERVICE`. For each service below, add it with **System Alias** = `LOCAL` and check **Enable OAuth for Service**:

    * `API_BUSINESS_PARTNER` — Business partner, customer, and vendor data
    * `API_PRODUCT_SRV` — Product and material master data
    * `API_SLSPRICINGCONDITIONRECORD_SRV` — Sales pricing conditions
    * `API_WAREHOUSE` — Extended Warehouse Management (EWM) data
  </Step>

  <Step title="Register an OAuth 2.0 client" icon="key">
    Run transaction `SOAUTH2` and register a new OAuth 2.0 client.

    * **Client Type:** Confidential.
    * **Client ID** must match the technical user's username from the first step.
    * **Grant Type:** Client Credentials (uncheck all others).
    * Assign scopes for every service activated in the previous step.
    * After creating the client, edit it and check **Scope parameter may be omitted**.
    * Copy the **Token Endpoint URL** — you'll enter this as the `Token URL` in Duvo.
  </Step>

  <Step title="Add the connection in Duvo" icon="circle-check">
    On the [Connections page](https://app.duvo.ai/integrations), open SAP S/4HANA and fill in these fields:

    <ParamField body="Integration Name" type="string" required>
      Any name to help you identify this connection later.
    </ParamField>

    <ParamField body="SAP Host" type="URL" required>
      Your SAP S/4HANA host URL (for example, `https://your-sap-host.com`). This is the base URL for all OData API calls.
    </ParamField>

    <ParamField body="Token URL" type="URL" required>
      The OAuth 2.0 token endpoint copied in the previous step (for example, `https://your-sap-host.com/sap/bc/sec/oauth2/token`).
    </ParamField>

    <ParamField body="Client ID" type="string" required>
      Your technical user's username from the first step (for example, `MCP_DUVO`).
    </ParamField>

    <ParamField body="Client Secret" type="string" required>
      Your technical user's password from the first step.
    </ParamField>

    <Note>
      SAP Client Number defaults to `100`. If your system uses a non-standard client number, contact your Duvo representative.
    </Note>
  </Step>
</Steps>

<AccordionGroup>
  <Accordion title="Third-party documentation" icon="book">
    * [SAP Help Portal — Activate and Maintain Services](https://help.sap.com/docs/SAP_S4HANA_CLOUD) — Guide for `/IWFND/MAINT_SERVICE` and OData service activation.
    * [SAP Help Portal — OAuth 2.0 configuration](https://help.sap.com/docs/SAP_NETWEAVER_AS_ABAP_752/916a7da9481e4265809f28010a113a6a/cdb122d5c82e4b4da48e7c6f18535dfa.html) — Setting up OAuth clients and scopes in `SOAUTH2`.
  </Accordion>

  <Accordion title="Detailed setup walkthrough with screenshots" icon="images">
    A step-by-step version of the setup above, with screenshots from a live SAP system. Use this if you're new to SAP administration or want to verify each screen before moving on.

    #### Step 1 — Create the technical user

    The technical user represents the Duvo connection in your SAP system. Already have one? Skip this step. If you don't know the password, reset it and note the new value.

    1. Run transaction `SU01`.

           <Frame>
             <img src="https://mintcdn.com/duvo-d8027998/vP3-0V6Q0VBvZeLx/images/user-guide/sap-s4hana/step-1-1-su01-initial-screen.png?fit=max&auto=format&n=vP3-0V6Q0VBvZeLx&q=85&s=ed016aa7c10209502e982b2549f531ef" alt="SU01 initial screen" width="1030" height="723" data-path="images/user-guide/sap-s4hana/step-1-1-su01-initial-screen.png" />
           </Frame>

    2. Enter a username (e.g. `MCP_DUVO`) and click **Technical User**.

           <Frame>
             <img src="https://mintcdn.com/duvo-d8027998/vP3-0V6Q0VBvZeLx/images/user-guide/sap-s4hana/step-1-2-technical-user-name.png?fit=max&auto=format&n=vP3-0V6Q0VBvZeLx&q=85&s=06184b6d85f039fc990a5067c41f9e76" alt="Entering technical user name in SU01" width="1425" height="651" data-path="images/user-guide/sap-s4hana/step-1-2-technical-user-name.png" />
           </Frame>

    3. On the **Logon Data** tab, set **User Type** to **System**.

    4. Generate or set a password. Save it securely — this is the `client_secret` you'll enter in Duvo.

           <Frame>
             <img src="https://mintcdn.com/duvo-d8027998/vP3-0V6Q0VBvZeLx/images/user-guide/sap-s4hana/step-1-3-generate-password.png?fit=max&auto=format&n=vP3-0V6Q0VBvZeLx&q=85&s=5c500d5af5e6aa9e92c92da3d2478b08" alt="Generating a password for the technical user" width="1166" height="307" data-path="images/user-guide/sap-s4hana/step-1-3-generate-password.png" />
           </Frame>

    5. On the **Profiles** (or **Roles**) tab, assign authorizations.

           <Frame>
             <img src="https://mintcdn.com/duvo-d8027998/vP3-0V6Q0VBvZeLx/images/user-guide/sap-s4hana/step-1-4-assign-profiles.png?fit=max&auto=format&n=vP3-0V6Q0VBvZeLx&q=85&s=169982e2f62199dba7ef03a1123db759" alt="Assigning profiles or roles to the technical user" width="1533" height="589" data-path="images/user-guide/sap-s4hana/step-1-4-assign-profiles.png" />
           </Frame>

       > Role and profile agents depend on your specific SAP system. Always prefer least-privilege roles.
       >
       > * **Sandbox / testing only:** you can temporarily use `SAP_ALL` to validate connectivity. `SAP_ALL` is a highly privileged profile that grants full access to the SAP system — never use it in production.
       > * **Production:** ask your administrator to assign least-privilege roles. At minimum, this should include:
       >   * `SAP_BC_OAUTH2_API` — OAuth plumbing (always required)
       >   * The SAP-delivered role per activated API, for example `SAP_BR_BUPA_MASTER_SPECIALIST` (Business Partner), `SAP_BR_PRODMASTER_SPECIALIST` (Product), `SAP_BR_PRICING_SPECIALIST` (Pricing), `SAP_EWM_*` (Warehouse).
       >
       > Role names vary by S/4HANA release — check PFCG for your system's equivalents.

    6. Save (`Ctrl+S`).

    #### Step 2 — Activate the OData services

    Four services need to be active with OAuth enabled:

    * `API_BUSINESS_PARTNER`
    * `API_PRODUCT_SRV`
    * `API_SLSPRICINGCONDITIONRECORD_SRV`
    * `API_WAREHOUSE`

    If they are already activated, skip this step. If a service is active but OAuth is not enabled, select it in the list and click the **OAuth** button in the toolbar.

    <Frame>
      <img src="https://mintcdn.com/duvo-d8027998/vP3-0V6Q0VBvZeLx/images/user-guide/sap-s4hana/step-2-1-oauth-button-toolbar.png?fit=max&auto=format&n=vP3-0V6Q0VBvZeLx&q=85&s=10660452d8a225c5399935dfb4e1c85a" alt="OAuth button in the /IWFND/MAINT_SERVICE toolbar" width="2197" height="527" data-path="images/user-guide/sap-s4hana/step-2-1-oauth-button-toolbar.png" />
    </Frame>

    Repeat the steps below for each service.

    1. Run transaction `/IWFND/MAINT_SERVICE`.

           <Frame>
             <img src="https://mintcdn.com/duvo-d8027998/vP3-0V6Q0VBvZeLx/images/user-guide/sap-s4hana/step-2-2-maint-service-initial.png?fit=max&auto=format&n=vP3-0V6Q0VBvZeLx&q=85&s=c440866fe8ac62214a38d8a2c5051a5d" alt="/IWFND/MAINT_SERVICE initial screen" width="997" height="553" data-path="images/user-guide/sap-s4hana/step-2-2-maint-service-initial.png" />
           </Frame>

    2. Click **Add Service**.

           <Frame>
             <img src="https://mintcdn.com/duvo-d8027998/vP3-0V6Q0VBvZeLx/images/user-guide/sap-s4hana/step-2-3-add-service-button.png?fit=max&auto=format&n=vP3-0V6Q0VBvZeLx&q=85&s=7539cd005f2446214fca7da3d427b48a" alt="Add Service button in /IWFND/MAINT_SERVICE" width="1551" height="420" data-path="images/user-guide/sap-s4hana/step-2-3-add-service-button.png" />
           </Frame>

    3. Enter **System Alias** = `LOCAL` and the **Technical Service Name** (for example `API_BUSINESS_PARTNER`). Click **Get Services** (or press Enter).

    4. Select the service from the results and click **Add Selected Services**.

           <Frame>
             <img src="https://mintcdn.com/duvo-d8027998/vP3-0V6Q0VBvZeLx/images/user-guide/sap-s4hana/step-2-4-add-selected-services.png?fit=max&auto=format&n=vP3-0V6Q0VBvZeLx&q=85&s=20b4260ff450d76780a2a4136072c298" alt="Selecting the service and clicking Add Selected Services" width="1889" height="570" data-path="images/user-guide/sap-s4hana/step-2-4-add-selected-services.png" />
           </Frame>

    5. In the **Add Service** dialog:

       * **Package Agent:** click **Local Object** for `$TMP` (sandbox), or enter a transport request (production).
       * Check **Enable OAuth for Service**.
       * Leave **ICF Node** and **System Alias** at their defaults.
       * Click **Continue**.

           <Frame>
             <img src="https://mintcdn.com/duvo-d8027998/vP3-0V6Q0VBvZeLx/images/user-guide/sap-s4hana/step-2-5-enable-oauth-dialog.png?fit=max&auto=format&n=vP3-0V6Q0VBvZeLx&q=85&s=e262d001dab3e01d96b4af98ac16613a" alt="Add Service dialog with Enable OAuth checked" width="1758" height="1213" data-path="images/user-guide/sap-s4hana/step-2-5-enable-oauth-dialog.png" />
           </Frame>

    6. Verify the service appears in the list with OAuth enabled (checkbox column on the right).

           <Frame>
             <img src="https://mintcdn.com/duvo-d8027998/vP3-0V6Q0VBvZeLx/images/user-guide/sap-s4hana/step-2-6-verify-oauth-enabled.png?fit=max&auto=format&n=vP3-0V6Q0VBvZeLx&q=85&s=f61583a977722b63e59d8f88bcf023f5" alt="Verifying OAuth enabled for the service" width="2458" height="1212" data-path="images/user-guide/sap-s4hana/step-2-6-verify-oauth-enabled.png" />
           </Frame>

    #### Step 3 — Register the OAuth 2.0 client

    Create an OAuth 2.0 client bound to the technical user from Step 1, with Client Credentials grant and the scopes from Step 2.

    1. Run transaction `SOAUTH2`.

           <Frame>
             <img src="https://mintcdn.com/duvo-d8027998/vP3-0V6Q0VBvZeLx/images/user-guide/sap-s4hana/step-3-1-soauth2-initial.png?fit=max&auto=format&n=vP3-0V6Q0VBvZeLx&q=85&s=acd4c55f7229c5dcfea0292ef3711f1d" alt="SOAUTH2 initial screen" width="1018" height="530" data-path="images/user-guide/sap-s4hana/step-3-1-soauth2-initial.png" />
           </Frame>

    2. In **OAuth 2.0 Administration**, click **Create**.

           <Frame>
             <img src="https://mintcdn.com/duvo-d8027998/vP3-0V6Q0VBvZeLx/images/user-guide/sap-s4hana/step-3-2-create-client.png?fit=max&auto=format&n=vP3-0V6Q0VBvZeLx&q=85&s=b3fc2cd8e50c4ca3f109562db6d12e86" alt="Clicking Create in OAuth 2.0 Administration" width="1002" height="353" data-path="images/user-guide/sap-s4hana/step-3-2-create-client.png" />
           </Frame>

    3. **Client ID** (wizard step 1):

       * **Client Type:** Confidential
       * **OAuth 2.0 Client ID:** must match your technical user's username (for example `MCP_DUVO`)
       * **Description:** any description
       * Keep **Token Lifetime** at `3600`.
       * Click **Next**.

           <Frame>
             <img src="https://mintcdn.com/duvo-d8027998/vP3-0V6Q0VBvZeLx/images/user-guide/sap-s4hana/step-3-3-wizard-client-id.png?fit=max&auto=format&n=vP3-0V6Q0VBvZeLx&q=85&s=7be661ab8f3883a03792671e3e3e9fed" alt="Wizard step 1 — Client ID configuration" width="1294" height="718" data-path="images/user-guide/sap-s4hana/step-3-3-wizard-client-id.png" />
           </Frame>

    4. **Client Authentication** (wizard step 2): leave defaults. Click **Next**.

           <Frame>
             <img src="https://mintcdn.com/duvo-d8027998/vP3-0V6Q0VBvZeLx/images/user-guide/sap-s4hana/step-3-4-wizard-client-auth.png?fit=max&auto=format&n=vP3-0V6Q0VBvZeLx&q=85&s=4b788600a3c1c4a0da8532e0d5a15401" alt="Wizard step 2 — Client Authentication defaults" width="1303" height="652" data-path="images/user-guide/sap-s4hana/step-3-4-wizard-client-auth.png" />
           </Frame>

    5. **Grant Type Settings** (wizard step 3): check **Grant Type Client Credentials Active**, uncheck all others. Click **Next**.

           <Frame>
             <img src="https://mintcdn.com/duvo-d8027998/vP3-0V6Q0VBvZeLx/images/user-guide/sap-s4hana/step-3-5-wizard-grant-type.png?fit=max&auto=format&n=vP3-0V6Q0VBvZeLx&q=85&s=999255b394d4c5d5d0292d7c8d94567b" alt="Wizard step 3 — Grant Type Client Credentials Active" width="1222" height="802" data-path="images/user-guide/sap-s4hana/step-3-5-wizard-grant-type.png" />
           </Frame>

    6. **Scope Agent** (wizard step 4): add all the scopes for the OData services activated in Step 2. You can also assign scopes after creating the client.

           <Frame>
             <img src="https://mintcdn.com/duvo-d8027998/vP3-0V6Q0VBvZeLx/images/user-guide/sap-s4hana/step-3-6-wizard-scope-assignment.png?fit=max&auto=format&n=vP3-0V6Q0VBvZeLx&q=85&s=6d7a84ed734cae3b1b8fdab28b3b98a4" alt="Wizard step 4 — Scope Agent" width="1453" height="710" data-path="images/user-guide/sap-s4hana/step-3-6-wizard-scope-assignment.png" />
           </Frame>

    7. **Summary** (wizard step 5): review and click **Finish**.

    8. Select the new client from the list, click **Edit** and check **Scope parameter may be omitted**, then click **Save**.

    9. Copy the **Token Endpoint URL** — you'll need it for Duvo.

           <Frame>
             <img src="https://mintcdn.com/duvo-d8027998/vP3-0V6Q0VBvZeLx/images/user-guide/sap-s4hana/step-3-7-token-endpoint-url.png?fit=max&auto=format&n=vP3-0V6Q0VBvZeLx&q=85&s=c863e54f6bb4d9a00979cec7ae7317f5" alt="Copying the Token Endpoint URL" width="2150" height="965" data-path="images/user-guide/sap-s4hana/step-3-7-token-endpoint-url.png" />
           </Frame>

    You now have everything you need to enable S/4HANA in Duvo. Return to the top of this page and fill out the **Connection Fields** with the values you collected.
  </Accordion>
</AccordionGroup>

## Capabilities

* **Business partner management** — Search, filter, and retrieve detailed records for customers, vendors, and organizations, including addresses, bank accounts, tax numbers, and roles.
* **Product and material lookup** — Query the product master for materials, finished goods, services, and raw materials with descriptions, plant-level data, and inventory valuations.
* **Sales pricing analysis** — Look up base prices, discounts, and surcharges for products, filter by customer or sales organization, and review pricing validity periods.
* **Warehouse visibility** — List EWM warehouses and inspect storage types and warehouse details.
* **Flexible OData queries** — Run advanced queries across the Business Partner, Product, Pricing, and Warehouse OData APIs when standard searches are not sufficient.

## Key Benefits

* **Live enterprise data** — Agents read directly from your SAP system, so reports and decisions reflect current data without manual exports.
* **Secure OAuth authentication** — Uses the standard OAuth 2.0 Client Credentials flow with automatic token caching and refresh, keeping credentials safe and minimizing token endpoint calls.
* **Cross-functional coverage** — A single connection spans finance, procurement, supply chain, pricing, and warehouse data across four SAP APIs.
* **No SAP expertise required after setup** — Once your administrator completes the initial setup, agents translate natural-language questions into the correct OData queries, so business users do not need to know SAP transaction codes or API structures.

## Works Well With

<CardGroup cols={3}>
  <Card title="Google Sheets" icon="https://mintcdn.com/duvo-d8027998/O3tlM6eCuFk2uJpN/images/connections/google-sheets.svg?fit=max&auto=format&n=O3tlM6eCuFk2uJpN&q=85&s=0ef8d55e05c34e7a4a618933bdf0ceb3" href="/user-guide/connections/available-connections/google-sheets" width="24" height="24" data-path="images/connections/google-sheets.svg">
    Pull SAP business partner lists, pricing tables, or inventory valuations into spreadsheets for analysis and stakeholder reporting.
  </Card>

  <Card title="Microsoft Excel" icon="https://mintcdn.com/duvo-d8027998/O3tlM6eCuFk2uJpN/images/connections/excel.svg?fit=max&auto=format&n=O3tlM6eCuFk2uJpN&q=85&s=986599d60d09acee47293fda2b62df99" href="/user-guide/connections/available-connections/microsoft-excel" width="2290" height="2130" data-path="images/connections/excel.svg">
    Pull SAP business partner lists, pricing tables, or inventory valuations into workbooks for analysis and stakeholder reporting.
  </Card>

  <Card title="Gmail" icon="https://mintcdn.com/duvo-d8027998/O3tlM6eCuFk2uJpN/images/connections/gmail.svg?fit=max&auto=format&n=O3tlM6eCuFk2uJpN&q=85&s=ad4e229283f3fe2f26c0f96a49f28e13" href="/user-guide/connections/available-connections/gmail" width="88" height="66" data-path="images/connections/gmail.svg">
    Retrieve SAP records and include them in automated notification or compliance reporting emails.
  </Card>

  <Card title="Microsoft Outlook" icon="https://mintcdn.com/duvo-d8027998/O3tlM6eCuFk2uJpN/images/connections/outlook.svg?fit=max&auto=format&n=O3tlM6eCuFk2uJpN&q=85&s=e29aeb65c8cffce1cd3c83b81289b71f" href="/user-guide/connections/available-connections/microsoft-outlook" width="1831" height="1703" data-path="images/connections/outlook.svg">
    Retrieve SAP records and include them in automated notification or compliance reporting emails.
  </Card>

  <Card title="Slack" icon="https://mintcdn.com/duvo-d8027998/O3tlM6eCuFk2uJpN/images/connections/slack.svg?fit=max&auto=format&n=O3tlM6eCuFk2uJpN&q=85&s=8a64bdd1af39e903923e4a273b4a4618" href="/user-guide/connections/available-connections/slack" width="512" height="512" data-path="images/connections/slack.svg">
    Query SAP data and post operational summaries, procurement alerts, or pricing updates to team channels.
  </Card>

  <Card title="Microsoft Teams" icon="https://mintcdn.com/duvo-d8027998/O3tlM6eCuFk2uJpN/images/connections/teams.svg?fit=max&auto=format&n=O3tlM6eCuFk2uJpN&q=85&s=6402a90678b560d0b0a4fc3b02c0d3e0" href="/user-guide/connections/available-connections/microsoft-teams" width="2229" height="2073" data-path="images/connections/teams.svg">
    Query SAP data and post operational summaries, procurement alerts, or pricing updates to team channels.
  </Card>
</CardGroup>
