Skip to content

§00Connect

Salesforce ↔ SAP S/4HANA

Quotes that know SAP’s price. Orders nobody retypes.

When sales runs on Salesforce and operations on SAP S/4HANA, SAP holds the commercial truth — price, availability, credit — and Salesforce has to ask. The gap shows up as quotes that don’t match the SAP order, orders keyed in twice and account teams asking customer service whether something shipped. PartnerMCP connects the two through SAP’s published Business Partner, Sales Order, Outbound Delivery and Billing Document APIs, so a quote is checked against SAP before it goes out and a won Opportunity becomes an SAP sales order without retyping.

Salesforce → S/4HANA
Sandbox

You

“Connect Salesforce to SAP S/4HANA. Synchronize accounts, quotations, sales orders, invoices and fulfillment.”

PartnerMCP· I will:

  1. Read the SAP side first: which published APIs and communication scenarios your S/4HANA edition exposes — sales order (SAP_COM_0109), business partner (SAP_COM_0008), delivery, billing — and flag any API SAP has deprecated.
  2. Link each Account to its SAP customer: match or create the business partner (API_BUSINESS_PARTNER) for a won account and store SAP’s customer number on the Account.
  3. Price quotes against SAP: send a Quote’s lines to SAP’s sales order simulation and return price, availability and credit results without creating a document.
  4. Turn a won Opportunity (IsWon = true) into one deep insert — header, to_Item lines and to_Partner — with the sales area and order type taken from your rule table.
  5. Before every create, look for an order with the same customer reference; send SAP’s CSRF token on every write and the ETag on every update.
  6. Follow the order through SAP business events and the outbound delivery API — goods issue posted means shipped.
  7. Return billing documents — number, status and PDF — to the Opportunity.
  8. Run as a reviewed, deterministic sequence of calls to SAP’s Published APIs; nothing improvises against SAP in production.
Opportunity · Closed WonCustomer lookupSchema mappingCreate / update customerCreate sales orderMonitor orderSync fulfillmentSync invoice statusUpdate Opportunity
Integration plan: Salesforce ↔ SAP S/4HANA. Salesforce to SAP S/4HANA.
  1. Opportunity · Closed Won — Salesforce: Trigger · Change Data Capture
  2. Customer lookup — PartnerMCP: Account ⇄ A_BusinessPartner
  3. Schema mapping — PartnerMCP: fields · products · prices
  4. Create / update customer — SAP S/4HANA: A_BusinessPartner
  5. Create sales order — SAP S/4HANA: A_SalesOrder + A_SalesOrderItem
  6. Monitor order — PartnerMCP: status · delivery · invoice
  7. Sync fulfillment — SAP S/4HANA: A_OutbDeliveryHeader
  8. Sync invoice status — SAP S/4HANA: API_BILLING_DOCUMENT_SRV
  9. Update Opportunity — Salesforce: fulfillment · invoice status
Product preview · sample data
§01—What syncs

What syncs, and which way.

Every record that moves between Salesforce and S/4HANA: what starts it, and what it produces on the other side.

SalesforceS/4HANA
  1. Both ways between Salesforce and SAP S/4HANA:

    Account ↔ A_BusinessPartner
    When
    A won Opportunity for a new account; sap.s4.beh.businesspartner.v1.BusinessPartner.Changed.v1 from SAP
    Result
    Business partner created or matched, its customer number on the Account; changes made in SAP reflected in Salesforce.
  2. Salesforce to SAP S/4HANA:

    Quote → API_SALES_ORDER_SIMULATION_SRV
    When
    A Quote marked ready for SAP pricing
    Result
    SAP’s price, availability and credit check on the Quote — no SAP document is created.
  3. Salesforce to SAP S/4HANA:

    Opportunity → A_SalesOrder + A_SalesOrderItem
    When
    OpportunityChangeEvent with IsWon = true
    Result
    SAP sales order created by deep insert through API_SALES_ORDER_SRV; the SAP order number written back to the Opportunity.
  4. SAP S/4HANA to Salesforce:

    A_SalesOrder → Opportunity
    When
    sap.s4.beh.salesorder.v1.SalesOrder.Changed.v1 via SAP Event Mesh, or polling on LastChangeDateTime
    Result
    Order status on the Opportunity, read back from the API after each event.
  5. SAP S/4HANA to Salesforce:

    A_OutbDeliveryHeader → Opportunity
    When
    Goods issue posted (PostGoodsIssue) on the outbound delivery
    Result
    Shipped status and the delivery on the Opportunity.
  6. SAP S/4HANA to Salesforce:

    Billing document → Opportunity
    When
    SAP billing creates the invoice for the order
    Result
    Billing document number, status and PDF from API_BILLING_DOCUMENT_SRV on the Opportunity.
§02—Field mapping

Field by field.

Every mapping PartnerMCP proposes, with its transformation and confidence. Rules — keys, reconciliation, duplicate guards — carry no confidence: they’re decided and approved, not inferred.

Salesforce ⇄ S/4HANA
Draft
  1. Account.SAP_Customer_No__c

    to A_SalesOrder.SoldToParty

    The sold-to party on every order

    96% confidence
    SAP stays the master for customer data; Salesforce holds the reference.
  2. A_BusinessPartner / A_Customer · customer number

    to Account.SAP_Customer_No__c (External ID)

    Written back after create or match; used for upserts

    95% confidence
    An upsert that finds several matches returns 300 and writes nothing — PartnerMCP treats it as a data issue, not a retry.
  3. Rule table · account region, business unit

    to SalesOrderType · SalesOrganization · DistributionChannel · OrganizationDivision

    Set by a rule you approve

    Rule
    Sales area and order type drive SAP pricing, tax and routing, so they’re never guessed per record.
  4. Opportunity.Id

    to A_SalesOrder.PurchaseOrderByCustomer

    Customer reference, checked before every create

    90% confidence
    If your customers’ own PO numbers belong here, the Opportunity ID stays in PartnerMCP’s link table instead.
  5. OpportunityLineItem.ProductCode

    to to_Item.Material

    Must be set up for the order’s sales area

    94% confidence
  6. OpportunityLineItem.Quantity

    to to_Item.RequestedQuantity

    In the material’s sales unit

    96% confidence
  7. OpportunityLineItem.UnitPrice · Discount

    to to_PricingElement

    Only if your pricing procedure accepts manual conditions

    70% confidence
    Otherwise SAP prices the order and PartnerMCP reconciles the result.
  8. Opportunity.Amount

    to Simulated order value — reconciled, not written

    API_SALES_ORDER_SIMULATION_SRV before the create

    Rule
    Amount is a pre-tax sum of products, and Salesforce ignores updates to it once line items exist.
  9. A_SalesOrder · order number

    to Opportunity.SAP_Sales_Order__c

    Written back after create

    96% confidence
  10. A_OutbDeliveryHeader · goods issue

    to Opportunity.SAP_Delivery_Status__c

    PostGoodsIssue → Shipped

    90% confidence
  11. Billing document (API_BILLING_DOCUMENT_SRV)

    to Opportunity.SAP_Billing_Document__c

    Number and status, with the PDF from GetPDF

    92% confidence
    The billing API reads, cancels and returns PDFs; SAP billing creates the document.
9 field mappings · 2 rules Confidence Lower, or verify on tenant
Product preview · sample data
§03—Edge cases

Edge cases, handled.

What goes wrong between Salesforce and S/4HANA in production, and what PartnerMCP does about it.

  1. 01

    Deterministic at runtime

    SAP’s API Policy, published in April 2026, restricts autonomous AI access to SAP APIs outside SAP-endorsed architectures; its FAQ places pre-defined, deterministic call sequences without LLM decision-making outside that restriction. PartnerMCP plans, maps and tests with AI; what runs in production is a reviewed, versioned sequence of calls to SAP’s Published APIs.

  2. 02

    V2 or V4 is a real choice

    SAP’s V4 Sales Order API can’t delete whole orders, can’t take an external order number and can’t change schedule lines; the V2 API has no asynchronous mode and can’t retrigger pricing. PartnerMCP picks the API per operation from SAP’s feature comparison for your release.

  3. 03

    CSRF tokens and ETags

    SAP requires a CSRF token on every write, including inside $batch, and V4 updates must carry If-Match. To change an item safely on V2, PartnerMCP sends the header PATCH with If-Match — the ETag lives on LastChangeDateTime — together with the item change in one $batch changeset.

  4. 04

    APIs retire between releases

    In S/4HANA Cloud Public Edition, SAP deprecates APIs inside its release cycle: API_OUTBOUND_DELIVERY_SRV now has a successor, API_OUTBOUND_DELIVERY_SRV_0002. PartnerMCP records which API each step uses and raises deprecations as planned changes, not production errors.

  5. 05

    Billing documents come from SAP

    API_BILLING_DOCUMENT_SRV reads, cancels and returns the PDF of billing documents; it doesn’t create them. PartnerMCP follows the order to the billing document SAP produced and returns it to Salesforce.

  6. 06

    SAP decides the price

    An order needs a sales organization, distribution channel and division, and your pricing procedure decides the price. PartnerMCP sets the sales area from a rule table you approve, simulates the order first and sends manual price conditions only where the procedure allows them.

  7. 07

    Events go through a broker

    S/4HANA publishes business events through SAP Event Mesh or SAP Cloud Application Event Hub, set up with communication arrangement SAP_COM_0092 — not to arbitrary webhook URLs. Where events aren’t enabled, PartnerMCP polls on LastChangeDateTime.

  8. 08

    No echo loops

    Writing SAP status back to an Opportunity creates a new Salesforce change event. PartnerMCP tags its own writes with Sforce-Call-Options and ignores events whose changeOrigin is its own, so a status update never re-triggers the order flow.

§04—Questions

Questions about Salesforce and S/4HANA.

Does SAP’s 2026 API Policy allow this?

The policy restricts autonomous AI access to SAP APIs unless the access pattern is SAP-endorsed, and its FAQ says deterministic, pre-defined API call sequences without LLM decision-making fall outside that restriction. PartnerMCP is built around that line: AI at design time, a reviewed and versioned integration at runtime, Published APIs only. For conversational access, SAP names the MCP Gateway in SAP Integration Suite as an endorsed pathway. Your SAP agreement and governance team have the final word.

Which S/4HANA editions does it work with?

Cloud Public Edition, Cloud Private Edition (RISE) and on-premise. They differ: Public Edition works through communication arrangements and allows only a short whitelist of BAPIs and IDocs, inbound only; private cloud and on-premise also offer the classic BAPI/RFC and IDoc interfaces. PartnerMCP discovers what your edition exposes before it plans anything.

Our S/4HANA is on-premise. How does PartnerMCP reach it?

Through the Edge Agent, which is designed to run inside your network and connect out — the same outbound-only pattern as SAP’s own Cloud Connector, which needs no inbound ports. Outbound allow-listing is usually still required.

Is this the same as SAP Sales Cloud?

No. SAP Sales Cloud is SAP’s CRM, with its own APIs. This page covers Salesforce with SAP S/4HANA, and PartnerMCP names the exact SAP product in every plan, because the APIs differ.

Can it create SAP quotations instead of simulating?

Yes, where your process keeps quotations in SAP: PartnerMCP creates them through the Sales Quotation API (API_SALES_QUOTATION_SRV) and links each one to its Salesforce Quote. Simulation is the lighter choice when sales only needs SAP’s answer on price, availability and credit.

§05—References

§06Build

Build this integration.

Start from this plan, or change it in your own words. PartnerMCP builds it against your Salesforce and S/4HANA: sandbox first, production when you approve.