SAP S/4HANA
Connect Riff to SAP S/4HANA to build procurement apps and agents on live ERP data.
Connect Riff to SAP S/4HANA or the SAP Business Technology Platform (BTP) to give your apps and agents live access to purchase orders, vendor data, materials, invoices, and cost centres.
What you connect
Riff connects to SAP using the SAP OData V4 APIs (for S/4HANA Cloud) or the SAP API Business Hub REST APIs. Authentication uses an OAuth 2.0 service key issued from SAP BTP.
Credentials needed:
OAuth token URL
SAP BTP → Service Instances → OAuth credentials
Client ID + Client Secret
SAP BTP service key JSON
API endpoint base URL
SAP API Business Hub or your S/4HANA instance URL
SAP Client (MANDT)
Your SAP system configuration
What your apps and agents can read
Purchase Orders
/API_PURCHASEORDER_PROCESS_SRV
Confirmation status, delivery dates, line items
Goods Receipts / GR-IR
/API_MATERIAL_DOCUMENT_SRV
Posted receipts, quantity variances
Vendor Master
/API_BUSINESS_PARTNER
Supplier contacts, payment terms, bank details
Supplier Invoices
/API_SUPPLIERINVOICE_PROCESS_SRV
Invoice headers, line items, payment status
Material Master
/API_PRODUCT_SRV
Material descriptions, units, plant data
Cost Centres
/API_COSTCENTER_0002
Cost centre hierarchy, budget vs. actuals
What your agents can do
Monitor overdue deliveries
Query PO lines where delivery date has passed with no GR → alert buyer
Chase confirmations
Read unconfirmed POs → send confirmation request → log response
Three-way match
Compare PO quantity/price → GR posting → supplier invoice → approve or flag
Cost variance reporting
Read cost centre actuals vs. plan → flag variances above threshold
GR/IR reconciliation
List GR/IR open items → identify blocked invoices → route to AP
App use cases
Procurement Dashboard
Build an App that reads open PO lines from S/4HANA and displays delivery status by supplier, site, and category — colour-coded by days overdue. Buyers filter, search, and click through to the original PO. No SAP login needed for the team.
Invoice Verification Queue
Display all supplier invoices pending three-way match. Show PO quantity, GR quantity, and invoice quantity side by side. AP clerks approve matched invoices directly in the app — the agent posts the approval back to SAP.
Cost Centre Variance Monitor
Pull cost centre actuals and planned values from SAP. Flag cost centres where actuals exceed plan by more than 10%. Output a weekly digest to Finance with drill-down by GL account.
Agent use cases
Overdue Delivery Monitor
Trigger: Daily at 06:30 Input: Open SAP PO lines where scheduled delivery date is before today Action: Group by supplier → send delivery status request via Outlook → log replies Output: Slack digest to procurement team; unresolved items escalated to buyer
Invoice Matching Agent
Trigger: New invoice notification (Outlook or SAP workflow)
Input: Invoice header and lines from /API_SUPPLIERINVOICE_PROCESS_SRV
Action: Match against PO and GR; calculate quantity and price variance
Output: Auto-post matched invoices; queue mismatches for manual review with match summary
GR/IR Reconciliation Agent
Trigger: Weekly, Monday 07:00 Input: GR/IR open items list from SAP Action: Categorise by root cause (price difference, quantity difference, missing GR, missing invoice) Output: Structured exception report to AP manager with recommended actions per item
Connecting SAP in Riff
In SAP BTP, create a service instance for the SAP API you need (e.g., Purchase Orders)
Download the service key JSON — this contains your Client ID, Client Secret, and token URL
Open Secrets in Riff and store each credential
In your app or agent, reference the secrets to authenticate via OAuth 2.0 and call the API
Ask your agent: "Read all open purchase orders from SAP where the delivery date is in the past and no goods receipt has been posted"
S/4HANA Cloud vs. On-Premise: The OData V4 APIs described here are for S/4HANA Cloud Public Edition. For on-premise or private cloud deployments, connection is via SAP Integration Suite or direct OData V2 — ask your SAP Basis team for the correct endpoint and authentication method.
Last updated
Was this helpful?