Run drug sample operations across SAP and Life Sciences Cloud — sample orders from reps to SAP fulfillment, shipments and lot/expiry into rep inventory, signed disbursements back for accountability, and the PDMA reconciliation that proves every sample is accounted for.
Tags: life-sciences, life-sciences-cloud, pharma, sample-management, sap, pdma, salesforce, api-led
Sample Management: SAP and Life Sciences Cloud for Orders, Inventory, Lot, and PDMA Reconciliation
Objective: Give every drug sample an unbroken record from SAP warehouse to HCP signature. Reps order and disburse in Life Sciences Cloud; SAP fulfills and ships; MuleSoft carries the lot and expiry with each unit and reconciles rep inventory against what was shipped and signed, so PDMA accountability is a report rather than an annual scramble.
What's Getting Built
- SAP S/4HANA (System API) — creates sample orders and reads deliveries, lot, and expiry from SAP ·
POST /salesorders, GET /deliveries/{id}, GET /batches/{material}
- LSC samples (System API) — reads sample requests and disbursements and writes shipments and inventory to LSC ·
GET /samples/requests, POST /samples/shipments, GET /samples/disbursements
- Sample operations (Process API) — routes orders to SAP, posts shipments to rep inventory by lot, and applies eligibility checks ·
POST /sample-orders, POST /shipments/receive
- PDMA reconciliation (Scheduler) — compares shipped, received, disbursed, and on-hand by rep and lot and opens discrepancies ·
SCHEDULER monthly, GET /reconciliation/{period}
Value chain phase
Phase 06 — Commercial & Patient Services. Marketing to healthcare providers (HCPs) and patient support program delivery.
- Scope of this plan: Sample orders, shipments, rep inventory by lot, disbursement, and PDMA reconciliation between SAP and Life Sciences Cloud.
- Data in this phase: CRM (Veeva / Salesforce Life Sciences Cloud), prescription data, and logs.
- Receives from: Phase 05 — Supply Chain & Logistics.
- Hands off to: Nothing downstream — this phase closes the loop back to Research & Discovery with real-world evidence.
Prerequisites
- Anypoint Platform org with API Manager, Runtime Manager, and a non-production deployment target.
- Salesforce Life Sciences Cloud org with a connected app and an integration user scoped to the objects this plan writes.
- Secrets Manager or secure properties configured for every system credential.
- Named owner for each source system — integration stalls on access, not on code.
- SAP S/4HANA or ECC access for sales orders, deliveries, and batch master — OData or BAPI.
- LSC sample management configured: product catalog, rep inventory, and signature capture.
- HCP eligibility source — license status and sampling limits — usually the HCP master.
- Compliance owner for PDMA and state sampling rules.
Architecture
1. Order
- Create SAP orders from approved LSC requests, checking HCP license and sampling limits before submission where the request names an HCP.
- Return the SAP order number to LSC and keep it on every later step.
2. Ship and receive by lot
- Post shipments to the rep's in-transit inventory with lot and expiry per unit from the SAP delivery.
- Require rep acknowledgment of receipt and flag quantity differences immediately.
- Block disbursement of expired or recalled lots in LSC as soon as SAP marks them.
3. Disburse with signature
- Record HCP, product, lot, quantity, and signature for each disbursement, and send it for accountability.
- Reject disbursements against an HCP whose license lapsed since the order.
4. Reconcile for PDMA
- Reconcile shipped against received against disbursed against on-hand, by rep and lot, every period.
- Open a discrepancy for anything that does not balance and track it to closure for the annual inventory.
5. Security and GxP compliance
- Validate the integration under GAMP 5 — requirements, design, IQ/OQ/PQ evidence, and a traceability matrix retained for inspection.
- Meet 21 CFR Part 11 and EU Annex 11 for electronic records and signatures on every GxP-relevant flow.
- Preserve ALCOA+ data integrity — attributable, legible, contemporaneous, original, and accurate — with audit trails no operator can edit.
- Encrypt regulated data in transit and at rest, and keep production payload visibility to validated support roles only.
- Treat a mapping change on a GxP flow as a controlled change under change management, never as a hotfix.
- Meet PDMA (21 CFR 203) sample accountability and state sampling laws in every state in scope.
- Retain signatures and reconciliation records for the period the regulation requires.
For pre-built API specifications, implementation templates, and reference architecture, see the MuleSoft Accelerator for Life Sciences on Anypoint Exchange.
Sample payload — Shipment to rep inventory
{
"sapDelivery": "80012345",
"sapOrder": "4500098765",
"repUserId": "rep_84120",
"lines": [
{ "product": "PRODUCT-X-10MG", "lot": "L24A118", "expiry": "2027-08-31", "quantity": 60 }
],
"status": "in_transit"
}
Testing and validation
- Order samples for an HCP with an expired license and confirm the request is blocked before SAP.
- Recall a lot in SAP and confirm reps cannot disburse it.
- Receive a short shipment and confirm the discrepancy opens immediately.
- Run reconciliation with a known missing disbursement and confirm it is reported by rep and lot.
Phased rollout
Phase 1 — Connect
- Build the SAP and LSC System APIs and the order path for one product.
- Load batch master with lot and expiry.
Phase 2 — Map and validate
- Add shipments, receipt, and disbursement for a pilot district.
- Run a reconciliation period in parallel with the current process.
Phase 3 — Production
- Roll out by region and switch reconciliation to this pipeline.
- Hand discrepancy management to compliance.
Success metrics
- Reconciliation discrepancies per rep per period.
- Disbursements of expired or recalled lots, at zero.
- Days to close the annual sample inventory.
Troubleshooting
- Inventory goes negative in LSC — Likely cause: disbursement recorded before the shipment receipt posted. Fix: Post in-transit on delivery and block disbursement until receipt is acknowledged.
- Lot missing on shipments — Likely cause: delivery read before batch determination completed in SAP. Fix: Trigger on goods issue rather than delivery creation.
Deliverable: Sample orders, shipments, lot-tracked rep inventory, and signed disbursements flowing between SAP and Life Sciences Cloud, with a PDMA reconciliation by rep and lot each period.