Skip to content

SAP S4HANA Cloud Integration Overview

Dr M H B Ariyaratne edited this page Jun 1, 2026 · 1 revision

SAP S/4HANA Cloud Integration — Overview

HMIS can connect to SAP S/4HANA Cloud to synchronize financial and inventory data between the two systems. This page gives an overview of what the integration does, what is required to set it up, and how to enable or disable it.


What the Integration Does

The SAP integration has three functions:

1. Push Bills to SAP Finance (Outbound)

When a bill is finalized in HMIS, it can be sent to SAP as a journal entry in the Finance (FI) module. SAP records a debit to the accounts-receivable ledger and credits the corresponding revenue accounts.

2. Receive Payment Confirmations from SAP (Inbound)

When SAP processes a payment against an HMIS bill, it can send a confirmation back to HMIS via a webhook. HMIS stores this confirmation against the bill for reconciliation.

3. Inventory Sync from SAP (Inbound)

HMIS can periodically fetch goods-receipt records from SAP Materials Management (MM) and compare them against the HMIS pharmacy item master. This is an audit sync — it checks which SAP items have matches in HMIS, but does not automatically create pharmacy stock entries.


Prerequisites

Before enabling the integration, you need the following from your SAP system administrator:

What you need Where it comes from
SAP tenant base URL SAP BTP cockpit (e.g. https://your-tenant.s4hana.cloud.sap)
OAuth token endpoint URL SAP BTP service binding credentials
Client ID SAP BTP service binding credentials
Client secret SAP BTP service binding credentials
Company code SAP Finance configuration (e.g. 1000)
AR (accounts receivable) G/L account SAP Finance chart of accounts
Revenue G/L account SAP Finance chart of accounts
Currency code ISO currency code used in SAP (e.g. LKR, USD)

Enabling the Integration

All SAP configuration is managed in the HMIS Application Configuration section.

  1. Go to Administration → Application Configuration.
  2. Search for SAP Integration.
  3. Set the following keys:
Configuration Key What to enter
SAP Integration - Enabled true
SAP Integration - Base URL Your SAP tenant base URL
SAP Integration - Token URL The OAuth token endpoint URL
SAP Integration - Client ID Your client ID
SAP Integration - Client Secret Your client secret
SAP Integration - Company Code Your SAP company code
SAP Integration - AR Account Your AR G/L account number
SAP Integration - Revenue Account Your revenue G/L account number
SAP Integration - Currency Currency code (default: LKR)
  1. Save each key.

Security note: Never write your SAP credentials into any document or file. Enter them only in the HMIS Application Configuration screen, where they are stored securely in the database.


Disabling the Integration

Set SAP Integration - Enabled to false. All SAP endpoints will immediately return a skipped status and make no calls to SAP.


Related Pages

Clone this wiki locally