Tool 09 · Algorithm Deep Dive
Static Analysis + Dependency Graph
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.
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.
Direct change to SAP standard code. High risk. Slows upgrades, may break during patches.
Custom code in Z-namespace on SAP server. Medium risk. Uses released APIs.
Extension on SAP BTP or separate platform. Low risk. Clean Core compliant.
Routes each object into on-stack / side-by-side / custom core / modification based on object type, namespace, and enhancement spot.
Scores intensity (0-100) on gray cases using object metadata, usage statistics, and dependency graph position.
Weights objects by business criticality: usage frequency, number of dependent objects, and module importance.
Weighted average of object scores × exposure → overall Clean Core Health Score (0-100).
| Object | Type | Tier | Intensity | Exposure | Priority Score |
|---|---|---|---|---|---|
| Z_IMPL_SAPMF02D | Enhancement | Tier 1 | 95 | High (8.2k users) | 779 |
| Z_CDS_VENDOR_EXT | Enhancement | Tier 2 | 45 | Medium (1.2k users) | 54 |
| Z_FIORI_APP_EXT | Extension | Tier 3 | 10 | Low (50 users) | 0.5 |
┌─────────────────────────────────────────────────────────────────────────────────────────┐
│ 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 │ │
│ │ } │ │
│ └─────────────────────────────────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────────────────────┘
Tool 09 aligns with SAP's RISE methodology and provides actionable remediation priorities.
| Metric | Value | Benchmark |
|---|---|---|
| Class Accuracy | 94.8% | 2,400 audited objects |
| Intensity MAE | 8.7 points | vs. Clean Core practice lead scores |
| Tier 1 Detection Recall | 97.2% | Critical modifications |
| Tier 3 Detection Precision | 95.1% | Side-by-side extensions |
| Portfolio Score Correlation | 0.89 | with SAP Readiness Check |
Result: Client avoids $600k in upgrade costs by remediating before RISE migration.