BitFlow
Back to BlogArchitecture

The Clean Architecture Stack for SAP S/4HANA

22 January 20252 min read

The Clean Architecture Stack for SAP S/4HANA

Most SAP implementations violate Clean Architecture without knowing it. Business logic in ABAP. Integration logic in ABAP. Presentation logic in ABAP. Everything in ABAP. The result: systems that work but cannot be changed, tested, or understood by anyone except the original developer.

What Clean Architecture Means for SAP

Clean Architecture (from Robert C. Martin) separates concerns into layers: entities, use cases, interface adapters, and frameworks. Applied to SAP S/4HANA:

Layer 1: Data (SAP S/4HANA)

  • CDS Views for business data access
  • RAP (Restful ABAP Programming) for APIs
  • No business logic — pure data access

Layer 2: Business Rules (Camunda DMN)

  • Decision tables for pricing, approval thresholds, routing
  • Owned by business analysts, not developers
  • Versioned, auditable, testable in isolation

Layer 3: Process Orchestration (Camunda BPMN)

  • Business process flows — Order-to-Cash, Procure-to-Pay
  • Visible to all stakeholders
  • Change without re-developing SAP

Layer 4: Integration (Connectors)

  • OData connectors to SAP APIs
  • Event Mesh for asynchronous events
  • External service adapters

Why This Matters for S/4HANA Migration

SAP ECC to S/4HANA migrations fail or overrun for one reason: everything is tangled. Business logic, integration logic, and SAP customization are all in the same ABAP codebase.

With Clean Architecture, migration becomes surgical:

  • SAP layer handles: data migration, Fiori apps, finance tables
  • Camunda layer handles: process continuity, business rules
  • Integration layer handles: external system reconnection

You can migrate SAP while Camunda keeps the business running.

The Practical Stack

Frontend (Fiori / Portal / Custom)
          ↕
Process Layer (Camunda 8 — BPMN + DMN)
          ↕
Integration Layer (OData / RFC / Event Mesh)
          ↕
Data Layer (SAP S/4HANA — CDS + RAP)

Each layer has one job. Each layer can be changed independently.

Getting Started

You don't need a full architecture overhaul to start. Pick one process — Order-to-Cash is usually the best first candidate — and implement it with Clean Architecture. The patterns become clear, the team learns, and the architecture proves itself.


Want to see what Clean Architecture looks like for your SAP landscape? Book a free process audit.

Related Articles

Ready to apply this?

Book a free 30-minute process audit. We'll map your processes and deliver an automation roadmap.

Book Free Audit