ABAP Cloud and Released APIs
RAP / CDS / ODataadvanced

ABAP Cloud Part 5: On-Stack Developer Extension vs BTP Side-by-Side

Key takeaway

Choose between on-stack developer extensibility and a side-by-side extension on SAP BTP using clear criteria: data proximity, transactional coupling, latency, lifecycle, scalability, skills and cost.

Explanation

📌 KEY POINTS
✅ On-stack: logic runs inside S/4HANA — best for tight coupling to SAP data and transactions.

✅ Side-by-side: separate app on BTP — best for decoupled, independent or cross-system scenarios.

✅ Both follow clean core: only released local APIs (on-stack) or released remote APIs/events (side-by-side).

⚠️ Side-by-side cannot join SAP data in the same transaction — plan for eventual consistency.

━━━━━━━━━━━━━━━━━━━━
▶ WHERE WE ARE

Part 2 listed the extensibility options. This part helps you decide between the two developer options.

━━━━━━━━━━━━━━━━━━━━
▶ 1. ON-STACK DEVELOPER EXTENSIBILITY

ABAP Cloud code in the S/4HANA system itself.

Strengths:

  • Direct, fast access to SAP data via released CDS views (joins, analytics in one query).
  • Same transaction as SAP processes: validations in released BAdIs, EML on released SAP BOs in the same LUW.
  • No additional runtime, no data replication.

Limits:

  • Runs on the S/4HANA system's resources and lifecycle (upgrades, downtime).
  • Tied to one S/4HANA system.

━━━━━━━━━━━━━━━━━━━━
▶ 2. SIDE-BY-SIDE ON BTP

A separate application (SAP BTP ABAP environment with RAP, or CAP with Node.js/Java) that talks to S/4HANA through released remote APIs (OData, SOAP) and business events.

Strengths:

  • Independent lifecycle and scaling; can be updated without touching S/4HANA.
  • Can combine several backends (S/4HANA, SuccessFactors, non-SAP).
  • Suitable for external users, partners, heavy workloads.

Limits:

  • Network latency and API limits; no shared transaction — changes in both systems need compensation or eventual consistency.
  • Data must be read via APIs or replicated.
  • Additional runtime cost and operations.

━━━━━━━━━━━━━━━━━━━━
▶ 3. DECISION CRITERIA

Choose ON-STACK when:

  • the logic belongs to an S/4HANA business transaction (checks, derivations, follow-up postings);
  • you need joins with large SAP data volumes or real-time analytics;
  • low latency and transactional consistency matter.

Choose SIDE-BY-SIDE when:

  • the app has its own data and lifecycle (e.g. supplier portal, mobile field app);
  • several systems are involved;
  • external users or high, variable load are expected;
  • you want to isolate innovation from the ERP release cycle.

━━━━━━━━━━━━━━━━━━━━
▶ 4. HYBRID

Common pattern: on-stack for checks and events in S/4HANA; side-by-side app for the user experience, reacting to events and calling released APIs.

━━━━━━━━━━━━━━━━━━━━
▶ STEP BY STEP

Use the decision table in the code example for each requirement; document the choice in an architecture decision record.

✅ CHECKPOINT: you can justify where an extension should run.

Code example

ABAP Code
" ===== Decision table (fill per requirement) =====" Criterion                         | On-stack ABAP Cloud | BTP side-by-side" Needs same LUW as SAP posting     |        ✔            |   ✘ (compensate)" Joins with large SAP data         |        ✔            |   ✘ (API / replicate)" Own data + own lifecycle          |        ~            |        ✔" Several backends / non-SAP        |        ✘            |        ✔" External users / partners         |        ~            |        ✔" Independent scaling / releases    |        ✘            |        ✔" Minimal extra runtime cost        |        ✔            |        ✘ " ===== On-stack example: check in the same transaction =====" Released BAdI implementation (ABAP Cloud) validating a purchase requisition:"   IF supplier_is_blocked( ... )."     " return error message -> SAP transaction rejects the save"   ENDIF. " ===== Side-by-side example: react to an event, call a released API =====" BTP app subscribes to a business event such as "purchase requisition created"" -> reads details via the released OData API" -> stores its own approval workflow data" -> writes the result back via a released API (separate transaction!) " ===== Architecture decision record (ADR) template =====" Context | Options (on-stack / side-by-side / hybrid) | Decision |" Consequences (consistency, latency, cost, operations) | Released APIs used

Real project scenario

A company wanted a supplier self-service portal and, at the same time, stricter checks when buyers create purchase requisitions. The first plan put everything on-stack, including external supplier access.
The architecture review split it: the supplier portal went side-by-side on BTP (external users, independent releases, scaling during onboarding campaigns), consuming released APIs and events; the purchase requisition checks went on-stack as a released BAdI implementation because they had to reject the save in the same transaction. Both parts stayed clean core.

Common mistakes

  • Building side-by-side apps that need the same transaction as SAP postings.
  • Replicating large SAP data sets to BTP just to join them.
  • Putting external-user portals on-stack.
  • Ignoring API limits and latency in side-by-side designs.
  • Assuming side-by-side is automatically "cleaner" than on-stack ABAP Cloud.

Best practices

  • Decide per requirement with explicit criteria.
  • Use on-stack for transactional checks and data-heavy logic.
  • Use side-by-side for independent apps, multi-system and external users.
  • Use events to decouple; design compensation for cross-system changes.
  • Record decisions in architecture decision records.

Interview angle

Questions: "When do you choose on-stack vs side-by-side?", "What are the consistency implications of side-by-side?"
Strong answer: on-stack ABAP Cloud when logic belongs to SAP transactions, needs joins on SAP data or low latency; side-by-side on BTP for own lifecycle, multiple backends, external users and independent scaling; side-by-side uses released remote APIs and events, has no shared LUW and needs eventual consistency or compensation; hybrids are common. Both follow clean core.

Practice this lesson

Quick check

1. Which scenario fits a side-by-side extension on SAP BTP best?

2. A clean-core extension on S/4HANA private cloud needs a BAPI that is not released. What is the recommended approach?

3. A validation must reject a purchase requisition save synchronously. Where should it run?

Interview questions

1. How do you decide between on-stack developer extensibility and a BTP side-by-side extension?

Answer it in your own words first, then compare.

2. A team proposes moving a save-time validation of purchase requisitions to a BTP microservice. What is your assessment?

Answer it in your own words first, then compare.

Practice more with Interview AI →

Reference-verified: the steps are checked against official SAP documentation and tutorials, and object and field names in the sample code are checked for consistency. The code has not been compiled or run on an SAP system by ERPClimb. Syntax marked release-dependent varies by SAP release, so check it in your own system.

More lessons in this topic

Interview questions on this topic

Related SAP topics