SAP S/4HANA Connector
Connect to SAP S/4HANA to index ERP data including business partners, sales orders, purchase orders, and master data for AI-powered search.
Overview
The SAP connector allows you to:
- Access OData v2 and v4 services
- Index business partner, customer, and supplier data
- Sync sales and purchasing documents
- Query master data tables (products, cost centers, GL accounts)
- Perform incremental sync based on modification dates
- Enable permission-aware search based on entity-level authorizations
Prerequisites
- SAP S/4HANA system with OData services exposed
- A service user with read access to the required OData entity sets
- Network connectivity between ZenSearch and the SAP system
- API credentials (Basic authentication or OAuth for SAP Cloud)
Authentication
Basic Authentication
Standard username and password against the SAP system:
- Enter the SAP OData service base URL
- Provide the SAP username and password
- Specify the SAP client number (e.g.,
100)
OAuth 2.0 (SAP Cloud Platform)
For SAP systems hosted on SAP Business Technology Platform:
- Register an OAuth client in the SAP BTP cockpit
- Obtain the client ID, client secret, and token endpoint URL
- Enter these credentials in ZenSearch
Configuration Reference
| Setting | Type | Required | Description |
|---|---|---|---|
| Base URL | string | Yes | SAP OData service endpoint (e.g., https://my-sap.com/sap/opu/odata/sap/) |
| Service Path | string | No | OData service path (e.g., API_BUSINESS_PARTNER) |
| OData Version | string | No | Protocol version: v2 or v4 (default: v4) |
| Auth Type | string | Yes | Authentication method: basic or oauth2 |
| Username | string | Yes* | SAP username (*required for basic auth) |
| Password | string | Yes* | SAP password (*required for basic auth) |
| Client ID | string | No | OAuth client ID (for oauth2 auth) |
| Client Secret | string | No | OAuth client secret (for oauth2 auth) |
| Token URL | string | No | OAuth token endpoint (for oauth2 auth) |
| SAP Client | string | No | SAP client number (e.g., 100) |
| Language | string | No | SAP language key (e.g., EN) |
| Entity Sets | array | No | Specific OData entity sets to sync (empty = default set) |
| Filter | string | No | OData $filter expression for record filtering |
| Select | array | No | OData $select fields to fetch |
| Expand | array | No | OData $expand navigation properties to include |
| Modified After | string | No | ISO 8601 datetime — only sync records modified after this date |
| Include Permissions | boolean | No | Sync entity-level permissions for permission-aware search |
| Page Size | integer | No | Records per page (default: 1,000; max: 5,000) |
| Max Records | integer | No | Maximum records per entity set (default: 100,000; 0 = unlimited) |
Setup Steps
- Add Connector: Navigate to Knowledge → Add Data Source → SAP S/4HANA
- Enter Base URL: The OData service endpoint for your SAP system
- Configure Authentication: Basic auth or OAuth credentials
- Set SAP Client: Specify the SAP client number
- Select Entity Sets: Choose which OData entities to index
- Configure Filters (optional): Add OData filter expressions
- Test & Create: Verify the connection and save
Common Entity Sets
| Entity Set | Module | Content |
|---|---|---|
A_BusinessPartner | Master Data | Customer and vendor master records |
A_Customer | Master Data | Customer-specific data |
A_Supplier | Master Data | Supplier-specific data |
A_SalesOrder | Sales | Sales order headers |
A_SalesOrderItem | Sales | Sales order line items |
A_PurchaseOrder | Procurement | Purchase order headers |
A_PurchaseOrderItem | Procurement | Purchase order line items |
A_Product | Master Data | Material master records |
A_ProductDescription | Master Data | Material descriptions in multiple languages |
A_CostCenter | Finance | Cost center master data |
A_GLAccountInChartOfAccounts | Finance | General ledger account definitions |
OData Filtering
Use OData $filter expressions to limit which records are synced:
# Sales orders from the last year
CreationDate gt datetime'2025-01-01T00:00:00'
# Business partners in a specific country
Country eq 'US'
# Active customers only
CustomerAccountGroup eq 'KUNA'
Best Practices
- Start with key entities — Begin with
A_BusinessPartnerandA_SalesOrder, then expand to other entity sets - Use OData v4 when available — v4 offers better filtering, pagination, and data type support
- Filter by date — Use
modified_afterfor incremental sync to reduce load on the SAP system - Use
$selectto limit fields — Only fetch the properties you need to reduce data transfer - Use
$expandfor related data — Include navigation properties to fetch related entities in a single request - Monitor OData rate limits — SAP systems may enforce concurrent request limits; the connector defaults to 20 requests/second
- Set a language key — Configure
language(e.g.,EN) to get descriptions in the correct language - Coordinate with your SAP Basis team — Ensure the OData services are activated and the service user has appropriate authorizations
Troubleshooting
Connection failed
- Verify the base URL is correct and includes the full OData service path
- Check that the OData service is activated in SAP (transaction
/IWFND/MAINT_SERVICE) - Verify network connectivity between ZenSearch and the SAP system
Authentication error
- Check the username, password, and client number
- Verify the user has authorization for the specified OData services
- For OAuth, confirm the client ID, secret, and token URL are correct
Missing data
- Check that the entity sets are activated in the SAP system
- Verify the user has authorization objects for the requested data
- Check if OData
$filterexpressions are filtering out expected records
Timeout on large entity sets
- Reduce
page_sizefor entity sets with large records - Use
$filterto limit the scope of the sync - Set
max_recordsto cap the total volume
OData version mismatch
- Some SAP services only support v2 — check the service definition and switch if needed
- v4 services use different URL patterns and query syntax than v2