CASE STUDY/GLOBAL PLYWOOD MANUFACTURER

>50% faster SAP reporting through autonomous AI

Autonomous AI refactored a DB-heavy SAP report into HANA-aligned execution, cutting runtime in half while preserving 100% functional accuracy.

Pattern
Performance
~52%faster
Manual ABAP Intervention
Zero
Delivery Velocity
1 dayvs 7 days
Functional Parity
100%
THE CHALLENGE

Outdated ABAP Creating Performance and Migration Risk

As part of its S/4HANA migration initiative, the organization uncovered a growing risk inside its SAP ECC landscape: years of custom ABAP code written for legacy databases, not HANA.

Business-critical reports were running significantly slower than acceptable, impacting finance and operational teams. Many programs relied on outdated coding patterns that degraded performance as data volumes grew.

Traditional remediation estimates ranged from 1-2 weeks per program, making large-scale optimization impractical. The approach depended heavily on specialized ABAP expertise, increasing both delivery risk and cost.

With migration timelines under pressure, the organization needed a faster, safer alternative-without expanding teams or delaying transformation.

THE APPROACH

AI-Driven ABAP Optimization for S/4HANA Readiness

Sookti AI deployed autonomous agents to analyze and optimize the client’s custom SAP programs end-to-end.

The workflow included:

1
Static code scan: The agent performs deep static analysis to identify anti-patterns, spotting SELECT * queries, SQL calls inside loops, unnecessary nested loops, linear table scans where binary search was possible, missing parallel cursor techniques, legacy syntax incompatible with HANA optimization, and other performance killers. This scan pinpoints exactly where legacy code would violate HANA best practices or slow down execution.
2
Automated code transformation: Sookti's transformation engine rewrites the ABAP to use modern, efficient constructs. It replaces inefficient logic with CDS views and set-based SQL, moving data processing to HANA where possible. The transformed code is also injected with clear, business-aligned comments for readability.
3
Regression testing harness: The agent automatically replays historical test data through the new code, guaranteeing 100% functional parity before and after transformation. Every unit test passed on the first run, confirming the converted programs behaved exactly like the originals, just faster.
4
Intelligent performance optimization: The agent introduces sorted indexes and parallel cursor techniques to eliminate nested loop slowdowns, replaces linear searches with binary search, leverages hashed tables for quick lookups, and consolidates multiple selects into single queries, aligning with HANA’s in-memory strengths.
5
Upgrade-proof output: Sookti AI's agents introduce SAP Standard CDS Views, Functions, and Classes into custom programs, making them ready for any future SAP upgrades without rework.
6
Self-documenting output: The agent produces clean, maintainable ABAP code annotated with the rationale for each change. It references relevant SAP Notes and labels where HANA clean-core principles are applied, making it a future-proof asset for the client’s IT team.
Each program was transformed in days instead of weeks, producing optimized, fully documented code ready for S/4HANA, with no human intervention required.
THE RESULTS

Data-driven improvements measured on live enterprise workloads. Results below represent a subset of optimized programs from a broader SAP performance initiative.

PROGRAM / REPORT
ZDSALEMIS_GST Report Runtime
BEFORE (LEGACY)
~8.63sec
AFTER (SOOKTI AI)
~4.16sec
PROGRAM / REPORT
DB Time Share
BEFORE (LEGACY)
~80.8%
AFTER (SOOKTI AI)
~52.9%
PROGRAM / REPORT
Outcome
BEFORE (LEGACY)
DB-boundexecution
AFTER (SOOKTI AI)
HANA-alignedscalable execution
PROGRAM / REPORT
Processing Balance
BEFORE (LEGACY)
ABAP waitingon database
AFTER (SOOKTI AI)
App-layerefficiency optimized
PROGRAM / REPORT
Scalability
BEFORE (LEGACY)
Fragileunder scale
AFTER (SOOKTI AI)
Predictableunder load
Before vs. After — SAP Runtime Analysis (ZDSALEMIS_GST, live production) Runtime: 8.63s → 4.16s | DB time share: 80.81% → 52.90%

Before vs. After — SAP Runtime Analysis (ZDSALEMIS_GST, live production) Runtime: 8.63s → 4.16s | DB time share: 80.81% → 52.90%

Execution shifted from DB-bound behavior to balanced, HANA-optimized processing through structural code refactoring.

Code refactored
4,889lines
STABILITY
ZEROregressions
OPERATIONAL RISK
100%eliminated
DOCUMENTATION
Automatic
WHAT CHANGED

Pro-Level Parallel Cursor Logic

For massive nested datasets, agents implement parallel cursors to scan two sorted tables simultaneously, avoiding repeated lookups.

Before
O(n²) Nested Loops
LOOP AT it_final1 ASSIGNING <gv>.
  " Legacy: Nested loop causes O(n*m) complexity
  LOOP AT it1_final ASSIGNING<gv1> 
    WHERE delv_no = <gv>-delv_no 
      AND length = <gv>-length.
    < gv > -bundle = <gv>-bundle + <gv1>-bundle.
        ENDLOOP.
        ENDLOOP.
After
Parallel Cursor (O(n+m))
" Sort once for Parallel Cursor logic
SORT it1_final BY delv_no length.
        DATA(lv_curr_idx) = 1.

LOOP AT it_final1 ASSIGNING <gv>.
  " Parallel Cursor: Linear traversal (O(n+m))
  LOOP AT it1_final ASSIGNING < gv1 > FROM lv_curr_idx.
        IF < gv1 > -delv_no < <gv>-delv_no.
          CONTINUE. " Skip to start of match
    ELSEIF < gv1 > -delv_no > <gv>-delv_no.
        EXIT. " Early exit: No more matches possible
    ELSE.
        lv_curr_idx = sy - tabix. " Update starting point
        < gv > -bundle += <gv1>-bundle.
          ENDIF.
          ENDLOOP.
          ENDLOOP.
SOOKTI AI'S VALUE
ASPECT
Code Transformation Time/ Time to Go-Live
BEFORE (MANUAL)
1 week per report (7 man-days per 5,000+ lines)
NOW WITH SOOKTI AI
Minutes per report, no manual intervention
ASPECT
Performance
BEFORE (MANUAL)
Bottlenecks from outdated patterns (SELECT * , loop-in-loop)
NOW WITH SOOKTI AI
50–90%faster execution with HANA-specific techniques
ASPECT
Code Optimization
BEFORE (MANUAL)
Manual identification and patching of inefficient code
NOW WITH SOOKTI AI
Automatic identification and correction; rewritten for HANA (CDS views, parallel cursors)
ASPECT
Quality Assurance
BEFORE (MANUAL)
Manual testing; high dependency on key developers
NOW WITH SOOKTI AI
100%functional parity validated with automated regression testing
ASPECT
Risk Management
BEFORE (MANUAL)
High dependency on key developers; risk of human error
NOW WITH SOOKTI AI
No “hero-developer” dependency; consistent, repeatable, auditable process with self-documenting output
ASPECT
SAP Clean-Core & Future/Upgrade-Proof
BEFORE (MANUAL)
Customizations break with SAP upgrades, manual checking to ensure HANA-compliant code
NOW WITH SOOKTI AI
Built-in clean-core compliance; SAP Standard CDS, Functions and Classes
ASPECT
Long-Term Maintainability
BEFORE (MANUAL)
Difficult to maintain; lack of documentation and poor readability
NOW WITH SOOKTI AI
Annotated ABAP with rationale per change; easy to maintain
TESTIMONIALS

We'd been living with this report's performance issues for years. Sookti AI fixed in a day what we'd been putting off for months, and the code it produced was cleaner than anything we'd have written ourselves.

- Technical Lead, Plywood Manufacturer
ENGAGEMENT DETAILS

Engagement Details

Industry
Manufacturing (Plywood)
Landscape
SAP ECC S/4HANA (Brownfield)
Scope
Custom Code Optimization
Environment
Live Enterprise Production Workloads

Ready to Unlock Similar Performance Gains?

Run a controlled pilot on your most critical SAP workloads and validate measurable results before scaling enterprise-wide.

Book a call with us or write to: aditya@sookti.ai | tanushree@sookti.ai

Background ASCII Illustration