SAP S4HANA Cloud Integration Overview - hmislk/hmis GitHub Wiki
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.
- Go to Administration → Application Configuration.
- Search for
SAP Integration. - 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) |
- 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
- SAP S/4HANA Billing Outbound — Pushing HMIS bills to SAP Finance
- SAP S/4HANA Billing Inbound — Receiving SAP payment confirmations
- SAP S/4HANA Inventory Sync — Matching SAP goods receipts to HMIS items