Skip to content
IT Canvass
Integrations · Lesson

SAP integration

Quick answer

Integrate ServiceNow with SAP so service workflows can read master data and trigger SAP transactions in real time. On-prem SAP is reached through a MID Server; SAP S/4HANA Cloud exposes OData APIs.

Key takeaways

  • Prerequisites
  • Step 1, Choose the interface
  • Step 2, MID Server & connection
  • Step 3, Field mapping
  • Step 4, Outbound example (create a PR)

Integrate ServiceNow with SAP so service workflows can read master data and trigger SAP transactions in real time. On-prem SAP is reached through a MID Server; SAP S/4HANA Cloud exposes OData APIs.

Prerequisites

  • ServiceNow: admin, IntegrationHub, and (for on-prem) a running MID Server with network access to SAP.
  • SAP: a technical/RFC user, and the relevant OData service activated (or BAPI/RFC exposed).
  • Endpoint details: SAP host, service path, and client number.

Step 1, Choose the interface

  • OData/REST (S/4HANA, SAP Gateway), call directly via IntegrationHub REST or the SAP spoke.
  • BAPI/RFC (classic on-prem), expose as OData via SAP Gateway, or call through a MID Server + middleware.

Step 2, MID Server & connection

  • Confirm the MID Server is Up and validated (MID Server → Servers).
  • Create a Connection & Credential alias for SAP: base URL to the Gateway, Basic Auth (RFC user) or OAuth, and select Use MID Server for on-prem.

Step 3, Field mapping

SAP (BUS PurchaseRequisition)   ServiceNow (sc_req_item / custom)
PurchaseRequisition          <-  u_sap_pr_number
ItemText                     ->  short_description
Quantity                     ->  u_quantity
CostCenter                   ->  u_cost_center

Step 4, Outbound example (create a PR)

  • Build a flow on catalog request fulfilment.
  • Add a REST step (or SAP spoke action) that POSTs to the OData entity set, running via MID Server.
POST /sap/opu/odata/sap/API_PURCHASEREQ_PROCESS_SRV/A_PurchaseRequisition
Content-Type: application/json
{
  "PurchaseRequisitionType": "NB",
  "to_PurchaseReqnItem": [{
    "PurchaseRequisitionItemText": "Laptop - onboarding",
    "RequestedQuantity": "1",
    "CostCenter": "0001"
  }]
}

Step 5, Inbound / lookups

  • For real-time reads (asset, cost centre), call the OData GET entity from a flow or business rule when the record loads.
  • For SAP-initiated events, have SAP PI/PO or an iFlow POST to a ServiceNow Scripted REST API.

Step 6, Test & monitor

  • Fulfil a test request and confirm the PR number returns and is stored.
  • Watch ECC/Outbound HTTP Requests and the MID Server logs for the round trip.

Troubleshooting

  • Timeouts: MID Server can't reach SAP host/port, check firewall.
  • 403 from Gateway: OData service not activated or user missing authorisation object.
  • CSRF errors: fetch an x-csrf-token with a GET before the POST.
On-prem SAP almost always needs a MID Server; never expose SAP directly to the instance.

Want to learn this properly?

Our live, instructor-led ServiceNow Training covers this hands-on, with real projects and a certification path.

Check your understanding

  1. What often bridges to on-prem SAP?

    • A. A MID Server
    • B. A client script
    • C. A dashboard
    Show answer

    A. A MID Server

    The MID Server provides secure on-prem access.

  2. SAP typically owns which data?

    • A. Enterprise finance/HR processes
    • B. Incident routing
    • C. Form layouts
    Show answer

    A. Enterprise finance/HR processes

    SAP runs core ERP processes.

Frequently asked questions

What is worth checking first with - SAP integration?

Timeouts: MID Server can't reach SAP host/port, check firewall. 403 from Gateway: OData service not activated or user missing authorisation object. CSRF errors: fetch an x-csrf-token with a GET before the POST.

What is the ITSM role of - SAP integration?

Build a flow on catalog request fulfilment. Add a REST step (or SAP spoke action) that POSTs to the OData entity set, running via MID Server.
CallWhatsAppEnquire