Home / Architecture / Tool 09 Demo / Algorithm Detail

Tool 09 · Algorithm Deep Dive

Clean Core Scorer

Static Analysis + Dependency Graph

94.8%Class Accuracy
8.7Intensity MAE
2,400Audited Objects
0-100Score Range
Try Interactive Demo

🎯 Why This Algorithm

📋 Problem Statement

SAP's RISE with SAP program fundamentally changes the economics of custom development. Modifications to core SAP code increase TCO because they slow down upgrades and break during quarterly releases. Clean Core is a spectrum, not a binary label — a small modification in a low-impact area may be acceptable, while a core modification in FI is critical.

✅ Solution

Hybrid approach: Rules classify obvious cases (on-stack BAdI = safe, core modification = red). XGBoost regressor scores intensity (0-100) on gray cases using object metadata and usage stats. Exposure weighting aggregates scores to portfolio level, prioritizing high-impact objects for remediation.

🏗️ Clean Core Tiers

Tier 1: Modification

Direct change to SAP standard code. High risk. Slows upgrades, may break during patches.

Tier 2: On-Stack Extension

Custom code in Z-namespace on SAP server. Medium risk. Uses released APIs.

Tier 3: Side-by-Side

Extension on SAP BTP or separate platform. Low risk. Clean Core compliant.

🧩 What It Comprises

📏 Rules Classifier

Routes each object into on-stack / side-by-side / custom core / modification based on object type, namespace, and enhancement spot.

🌲 XGBoost Regressor

Scores intensity (0-100) on gray cases using object metadata, usage statistics, and dependency graph position.

⚖️ Exposure Weighting

Weights objects by business criticality: usage frequency, number of dependent objects, and module importance.

📊 Portfolio Aggregator

Weighted average of object scores × exposure → overall Clean Core Health Score (0-100).

📥 Inputs & 📤 Outputs

📥 Inputs

  • Object registry from SolMan/Signavio
  • RICEFW classification (from Tool 08)
  • Usage metrics (transaction counts, user frequency)
  • Dependency graph position (from Tool 10)

📤 Outputs

  • Per-object Clean Core class + intensity (0-100)
  • Portfolio-level Clean Core Health Score
  • Priority remediation list (sorted by score × exposure)
  • SAP EII/CMF alignment metrics

📊 Portfolio Clean Core Score: 72/100

⬤ Critical (0-40) ⬤ Needs Work (41-70) ⬤ Clean (71-100)

Top Remediation Priorities

ObjectTypeTierIntensityExposurePriority Score
Z_IMPL_SAPMF02DEnhancementTier 195High (8.2k users)779
Z_CDS_VENDOR_EXTEnhancementTier 245Medium (1.2k users)54
Z_FIORI_APP_EXTExtensionTier 310Low (50 users)0.5

🔄 How It Runs — Step by Step

┌─────────────────────────────────────────────────────────────────────────────────────────┐
│                          CLEAN CORE SCORER PIPELINE                                        │
├─────────────────────────────────────────────────────────────────────────────────────────┤
│                                                                                           │
│   ┌─────────────────────────────────────────────────────────────────────────────────┐   │
│   │                              STEP 1: OBJECT CLASSIFICATION                         │   │
│   │                                                                                   │   │
│   │   For each object in registry:                                                    │   │
│   │                                                                                   │   │
│   │   ┌─────────────────────────────────────────────────────────────────────────┐    │   │
│   │   │  RULES LAYER (handles ~60% of cases):                                    │    │   │
│   │   │                                                                          │    │   │
│   │   │  IF object modifies SAP standard code → Tier 1 (Modification)            │    │   │
│   │   │  IF object is BAdI implementation → Tier 2 (On-Stack Extension)          │    │   │
│   │   │  IF object on SAP BTP / Cloud Foundry → Tier 3 (Side-by-Side)            │    │   │
│   │   │  IF object in Z-namespace on SAP server → Tier 2 (On-Stack)              │    │   │
│   │   │  IF object uses released API only → Tier 2                                │    │   │
│   │   └─────────────────────────────────────────────────────────────────────────┘    │   │
│   │                                                                                   │   │
│   │   For ambiguous cases (40%):                                                       │   │
│   │   → XGBoost classifier predicts Tier (1/2/3)                                       │   │
│   └─────────────────────────────────────────────────────────────────────────────────┘   │
│          │                                                                                 │
│          ▼                                                                                 │
│   ┌─────────────────────────────────────────────────────────────────────────────────┐   │
│   │                    STEP 2: INTENSITY SCORING (XGBoost Regressor)                   │   │
│   │                                                                                   │   │
│   │   For each object, score intensity 0-100:                                          │   │
│   │                                                                                   │   │
│   │   Features:                                                                        │   │
│   │   • Object complexity (lines of code, cyclomatic complexity)                        │   │
│   │   • Dependency count (from Tool 10)                                                │   │
│   │   • Usage frequency (transaction counts, user sessions)                             │   │
│   │   • Module criticality (FI/CO > MM/SD > Others)                                     │   │
│   │   • Age of modification (older = higher risk)                                       │   │
│   │   • SAP release version                                                             │   │
│   │                                                                                   │   │
│   │   Intensity Score = XGBoost.predict(features) ∈ [0, 100]                           │   │
│   └─────────────────────────────────────────────────────────────────────────────────┘   │
│          │                                                                                 │
│          ▼                                                                                 │
│   ┌─────────────────────────────────────────────────────────────────────────────────┐   │
│   │                    STEP 3: EXPOSURE WEIGHTING                                      │   │
│   │                                                                                   │   │
│   │   Exposure Weight = f(usage_freq, dependency_count, module_criticality)           │   │
│   │                                                                                   │   │
│   │   Normalized to [0, 1]:                                                           │   │
│   │   • Tier 1 object in FI with 10k daily users → Exposure = 1.0                      │   │
│   │   • Tier 3 object with 5 daily users → Exposure = 0.01                             │   │
│   │                                                                                   │   │
│   │   Weighted Score = Intensity × Exposure                                            │   │
│   └─────────────────────────────────────────────────────────────────────────────────┘   │
│          │                                                                                 │
│          ▼                                                                                 │
│   ┌─────────────────────────────────────────────────────────────────────────────────┐   │
│   │                    STEP 4: PORTFOLIO AGGREGATION                                   │   │
│   │                                                                                   │   │
│   │   Portfolio Clean Core Score = 100 - ( Σ Weighted_Scores / Σ Exposures )          │   │
│   │                                                                                   │   │
│   │   ┌─────────────────────────────────────────────────────────────────────────┐    │   │
│   │   │  Example Calculation:                                                     │    │   │
│   │   │                                                                          │    │   │
│   │   │  Object A: Intensity=95, Exposure=1.0 → Weighted=95                       │    │   │
│   │   │  Object B: Intensity=45, Exposure=0.5 → Weighted=22.5                     │    │   │
│   │   │  Object C: Intensity=10, Exposure=0.1 → Weighted=1.0                      │    │   │
│   │   │                                                                          │    │   │
│   │   │  Σ Weighted = 118.5, Σ Exposure = 1.6                                     │    │   │
│   │   │  Average Risk = 118.5 / 1.6 = 74.1                                        │    │   │
│   │   │  Clean Core Score = 100 - 74.1 = 25.9 (Critical)                          │    │   │
│   │   └─────────────────────────────────────────────────────────────────────────┘    │   │
│   └─────────────────────────────────────────────────────────────────────────────────┘   │
│          │                                                                                 │
│          ▼                                                                                 │
│   ┌─────────────────────────────────────────────────────────────────────────────────┐   │
│   │   OUTPUT:                                                                         │   │
│   │   {                                                                               │   │
│   │     "portfolio_score": 25.9,                                                      │   │
│   │     "tier_distribution": {"Tier1": 12, "Tier2": 45, "Tier3": 120},                │   │
│   │     "top_remediations": [                                                          │   │
│   │       {"object": "Z_IMPL_SAPMF02D", "weighted_score": 95, "action": "Migrate"}    │   │
│   │     ],                                                                            │   │
│   │     "sap_eii_equivalent": 26                                                       │   │
│   │   }                                                                               │   │
│   └─────────────────────────────────────────────────────────────────────────────────┘   │
│                                                                                           │
└─────────────────────────────────────────────────────────────────────────────────────────┘
                    

🏗️ Architecture & Integration

Where Clean Core Scorer Sits in A²AI

🧩 TOOL 08
RICEFW Classifier
🕸️ TOOL 10
Change Impact
📊 SolMan
Usage Stats
🧹 TOOL 09
Clean Core Scorer
XGBoost + Exposure
Executive Dashboard
Health Score
Remediation Plan
Priority List
RISE Assessment
Migration Readiness

Tool 09 aligns with SAP's RISE methodology and provides actionable remediation priorities.

📐 Mathematical Explanation

Portfolio Clean Core Score:

Score = 100 - [ Σ (I_i × E_i) / Σ E_i ]

Where:
• I_i = Intensity score for object i ∈ [0, 100]
• E_i = Exposure weight for object i ∈ [0, 1]

Exposure Weight Calculation:

E_i = σ( w₁·U_i + w₂·D_i + w₃·M_i )

Where:
• U_i = Normalized usage frequency (log-scale)
• D_i = Normalized dependency count (from Tool 10)
• M_i = Module criticality weight (FI=1.0, CO=0.9, MM=0.7, etc.)
• σ = Sigmoid normalization to [0,1]

XGBoost Intensity Regression Loss (MAE):

L = (1/N) Σ |I_i - Î_i|

SAP EII (Extension Innovation Index) Alignment:

EII ≈ 100 - (Tier1_Count × 10 + Tier2_Count × 2) / Total_Objects

📊 Measured Performance

MetricValueBenchmark
Class Accuracy94.8%2,400 audited objects
Intensity MAE8.7 pointsvs. Clean Core practice lead scores
Tier 1 Detection Recall97.2%Critical modifications
Tier 3 Detection Precision95.1%Side-by-side extensions
Portfolio Score Correlation0.89with SAP Readiness Check

📚 Training & Calibration Set

  • Size: 2,400 objects audited by Clean Core practice leads
  • Source: 18 client SAP landscapes (S/4HANA and ECC)
  • Labels: Tier classification + intensity score (0-100)
  • Ground Truth: Curated with SAP RISE methodology
  • Validation: 5-fold cross-validation by client
  • Calibration: Isotonic regression on intensity scores

🎬 End-to-End Example

Scenario: RISE Migration Readiness Assessment

  1. Input: 1,847 custom objects from client's ECC system
  2. Classification: 23 Tier 1 (modifications), 312 Tier 2 (on-stack), 1,512 Tier 3 (side-by-side)
  3. Intensity Scoring: XGBoost scores 23 modifications; 12 are high-intensity (>80)
  4. Exposure Weighting: High-intensity modifications in FI/CO get top priority
  5. Portfolio Score: 58/100 (Needs Work)
  6. Output: Remediation plan with 12 priority items; estimated 180 hours to fix

Result: Client avoids $600k in upgrade costs by remediating before RISE migration.