IT CanvassTalk to an advisor
Integrations · LessonReviewed by Neelima, ServiceNow Architect · Updated · Published · current release · integration

ServiceNow SAP integration

Bridge ITSM and enterprise processes with SAP.

Quick answer

A ServiceNow to SAP integration lets a workflow read master data and trigger SAP transactions in real time. On-premise SAP is reached through a MID Server with an RFC user, S/4HANA through its OData APIs. You create a connection alias, map the fields, call the entity set from a flow, and receive SAP-initiated events on a Scripted REST API.

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.
Already working on ServiceNow and stuck on a live ticket?Get an expert ServiceNow developer on screen-share to finish your daily tasks with you. Deliver on time, protect your reputation and your job. Monthly support only, no task-wise plans.Task assigned · no idea where to startStill stuck · your job on the lineExpert joins your screenDelivered on timeExplore On Job Support