Tier 2
In-System
BAdI
Clean Core

Embedded Extensions (Tier 2)

In-system S/4HANA extensions using SAP-released extension points — BAdIs, Custom Fields, Custom Business Objects, and SSCUI configuration. Everything you need to extend S/4HANA without modifying standard code.

Tier 2 Embedded Extension Architecture

Tier 2 extensions run inside S/4HANA but exclusively through released extension points. SAP Standard code (Tier 1) is never modified — only extended through the published extension API surface.

Embedded Extension Architecture — Tier 2 Patterns
Rendering diagram…

Executive Summary

Two categories of embedded extension
Tier 2 (embedded) extensions come in two categories. (1) Key User tools — no-code/low-code extensions performed by business power users without ABAP knowledge, using guided Fiori apps. (2) Developer extensions — ABAP Cloud code implementing released BAdIs, enhancement spots, and RAP extension patterns. Both categories are fully upgrade-safe because they use only the officially published extension API surface.

Key User vs Developer Extensions

DimensionKey User (No-code)Developer (ABAP Cloud)
ToolingFiori apps (F1481, F1731)ADT (Eclipse) / SAP BAS
LanguageNo code / decision tablesABAP Cloud (restricted)
Upgrade safetyFull (SAP-managed)Full (API contract C1)
Complexity limitSimple fields, validationsComplex business logic
TransportCustomising transportABAP transport (Workbench)
Suitable forBusiness consultantsABAP developers
ExamplesCustom field on SalesOrderBAdI for pricing logic

Key User Extension Points

Custom Fields (F1481)

Add fields to standard BOs (Sales Order, PO, Customer, etc.). Fields appear automatically in Fiori UIs and are exposed in the standard OData V4 API. Supports validation logic via a guided rule builder. Naming convention: YY1_ prefix.

Custom Business Objects (F1731)

Create complete new transactional objects (header + item structure, draft workflow, OData service). Auto-generated Fiori Elements app. No ABAP coding — fully guided UI generator. Supports associations to standard objects.

Business Rules (F1481 → Rules tab)

Decision-table-based logic for pricing, routing, and approval thresholds. Maintained by business users directly — no transport required for rule changes. Can be called from BAdIs, workflow steps, or directly from process code.

Manage Your Solution (F2048)

Fiori-based SPRO replacement. Scoped configuration by business process area. Role-based access so different users see only their relevant configuration activities. All changes tracked in Cloud ALM.

Developer Extension Points (ABAP Cloud)

Released BAdIs

SAP-published switch points where customer code injects logic. The implementing class must use ABAP Cloud language version. BAdI interface is C1-released — guaranteed stable across upgrades.

Enhancement Spots

Source code exit points published by SAP. Implemented via Enhancement Implementation Objects. Only enhancements in the released enhancement catalog are permitted in ABAP Cloud.

RAP Extensions

Extend standard RAP business objects by adding custom validations, determinations, and actions to the standard BO behaviour definition. Fully integrated with the RAP framework lifecycle.

BAdI Implementation Example

A released BAdI implementation for Sales Order item creation. The implementing class uses ABAP Cloud language version — direct database access is forbidden; only released CDS views and BAPI/EML entities are used.

abap
" Implementing a released BAdI — SD_DOC_ITEM_CREATE
" This BAdI fires when a Sales Order item is created

CLASS zcl_dewa_so_item_badi DEFINITION
  PUBLIC FINAL
  CREATE PUBLIC.

  PUBLIC SECTION.
    INTERFACES if_badi_so_item_create.  " Released BAdI interface

  PRIVATE SECTION.
    METHODS validate_item_data
      IMPORTING is_item TYPE badi_so_item_data
      RAISING   cx_badi_validation_error.

ENDCLASS.

CLASS zcl_dewa_so_item_badi IMPLEMENTATION.

  METHOD if_badi_so_item_create~check_item.
    " Called for every new sales order item
    " Only ABAP Cloud language version allowed here

    " Validate DEWA-specific business rule: items above AED 1M need approval flag
    IF is_item-net_value > 1000000 AND is_item-currency = 'AED'.
      IF is_item-yy1_approval_required_sdh IS INITIAL.
        " Set custom field (defined via Custom Fields F1481)
        MODIFY ENTITIES OF i_salesorderitem_api01
          ENTITY salesorderitem
          UPDATE FIELDS ( yy1_approval_required_sdh )
          WITH VALUE #( (
            %key-salesorder     = is_item-salesorder
            %key-salesorderitem = is_item-salesorderitem
            yy1_approval_required_sdh = abap_true
          ) ).
      ENDIF.
    ENDIF.
  ENDMETHOD.

ENDCLASS.

Enterprise Example: DEWA Order-to-Cash Tier 2 Extensions

Total Tier 2 extensions implemented
14
Custom Fields
6 — Sales Order, Customer, Delivery
Custom Business Objects
2 — DEWA approval objects
Released BAdIs
4 — Pricing, shipping, billing, credit check
Business Rules
2 — Customer routing and classification
ATC status
All 14 extensions ATC-clean
Upgrade rework (2025 OP)
Zero — all extensions survived unchanged

Best Practices

Check BAdI catalog before going Tier 3

Always check SAP's released BAdI catalog before building a side-by-side extension — an existing BAdI is faster to build and simpler to maintain.

Key User tools first

If the business requirement fits Key User tools, use them — they are faster to build and fully upgrade-safe with zero developer involvement.

ABAP Cloud language version from day 1

Set ABAP Cloud language version on ALL new development objects from the first day of the project — retrofitting is painful and error-prone.

Single-purpose BAdI classes

Implement BAdIs in single-purpose classes (one BAdI per class, not "God classes" implementing five BAdIs). Easier to test, debug, and transport independently.

Document every BAdI in Cloud ALM

Register every BAdI implementation in Cloud ALM with its business rationale — prevents accidental deletion and helps future developers understand why it exists.

Common Pitfalls

BAdI with standard ABAP language version
Using ABAP Standard (not ABAP Cloud) language version in BAdI implementations allows unreleased APIs to creep in — defeats clean core enforcement entirely.
Direct database access in BAdIs
SELECT directly on DDIC tables inside BAdI implementations is forbidden in ABAP Cloud. Use released CDS views for all data access.
Custom Business Object for a BAdI use case
Building a Custom Business Object when a released BAdI would suffice adds unnecessary complexity. CBOs are for new transactional objects, not for simple validation logic.
Not testing across all document types
BAdI implementations must be tested across all relevant document types and edge cases. Production failures often come from untested edge cases (partial deliveries, credit blocks, etc.).

Security Considerations

BAdIs and Custom BOs require careful access control
BAdIs run inside S/4HANA with system-level privileges — validate all input data and never bypass SAP authorisation checks inside BAdI code. Custom Fields can expose sensitive data in the auto-generated OData V4 API — review field-level access control settings per field. Custom Business Objects automatically generate OData services — restrict access via IAM Business Catalogs and role assignments, not just transport restrictions.