CASE STUDY/GLOBAL STEEL MANUFACTURER

70% faster dispatch & billing workflows with AI

A critical SAP dispatch and billing workload was accelerated by 70% through autonomous, HANA-aligned optimization without changing business logic, touching production manually, or introducing risk.

Pattern
Execution Time
70%Faster (72mins → 22mins)
Manual ABAP Effort
Zerorequirement
Delivery Velocity
2 weeksvs 3 months previously
Billing Accuracy
100%output parity maintained
THE CHALLENGE

Key batch jobs routinely ran for over 72 minutes, delaying downstream operations.

A large steel manufacturer was struggling with extremely long-running SAP jobs tied to dispatch, billing, and logistics reconciliation.

These programs processed high-volume transactional data, including billing documents, gate entries, pricing conditions, delivery details, and audit trails, all tightly coupled to business-critical workflows.

The root cause was deeply embedded legacy ABAP logic:

  • Heavy nested loops over large internal tables
  • Repeated database reads inside loops
  • Inefficient handling of change document (CDPOS/CDHDR) data
  • Full table scans where indexed or sequential access was possible

Manual optimization was risky. Any functional change could impact billing accuracy, audit trails, or statutory compliance - making traditional refactoring slow, expensive, and high-risk.

THE APPROACH

Automated ABAP Optimization with Zero Functional Risk

Sookti AI deployed autonomous agents to analyze and optimize the steel manufacturer’s most performance-critical SAP programs, without altering business logic, to enable deterministic, predictable performance.

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.
Throughout this automated workflow, the Sookti AI agent handled the entire conversion without a human in the loop. No manual coding or debugging was needed. Sookti AI essentially became an expert ABAP developer and tester that worked at machine speed. Transformation of each program completed in minutes. Automated regression testing confirmed 100% functional parity before delivery.
THE RESULTS

Data-driven improvements measured on live production workloads.

PROGRAM / REPORT
ZZSDR_DESPATCH_DTL_NEW
BEFORE (LEGACY)
72minutes
AFTER (SOOKTI AI)
22minutes
PROGRAM / REPORT
Dispatch & Billing Core Logic
BEFORE (LEGACY)
Long-running batchwith downstream delays
AFTER (SOOKTI AI)
70%faster execution
PROGRAM / REPORT
Change Document Processing (CDPOS/CDHDR)
BEFORE (LEGACY)
RepeatedDB reads inside loops
AFTER (SOOKTI AI)
Bulk-prefetched& indexed access
PROGRAM / REPORT
Gate Entry & Weight Aggregation
BEFORE (LEGACY)
Nested loopswith full table scans
AFTER (SOOKTI AI)
Parallelcursor–based aggregation
PROGRAM / REPORT
Pricing & Delivery Lookups
BEFORE (LEGACY)
RepeatedSELECTs per record
AFTER (SOOKTI AI)
Preloadedhashed internal tables

Sookti AI eliminated severe SAP performance bottlenecks in dispatch and billing workflows, delivering a 70% runtime reduction while preserving 100% business accuracy without manual effort, production risk, or disruption to live operations.

Operation Continuity
100%
Operational Risk
100%eliminated
Code Refactored
48,000 +lines
Documentation
Automatic
WHAT CHANGED

O(1) Access with Hashed Tables

Agents identify when key access is unique and refactor logic to use hashed tables, providing instant data retrieval regardless of table size.

Before
Nested SELECTs
LOOP AT it_bill INTO wa_bill.
  " Extremely slow nested DB hits
  SELECT SINGLE * FROM cdpos INTO @DATA(wa_cdpos) 
    WHERE objectid = @wa_final - aubel 
      AND fname = 'LIFSK' AND value_new = '61'.
      
  SELECT SINGLE udate FROM cdhdr INTO @DATA(wa_cdhdr)
    WHERE changenr = @wa_cdpos - changenr.
        ENDLOOP.
After
Hashed Tables (O(1) Access)
" Optimization: Use Hashed Tables for O(1) instant lookups
DATA: lt_cdhdr TYPE HASHED TABLE OF ty_cdhdr 
      WITH UNIQUE KEY changenr.

" Preload Change Headers in bulk
IF lt_changenr IS NOT INITIAL.
  SELECT changenr, udate, utime FROM cdhdr
    INTO TABLE @lt_cdhdr
    FOR ALL ENTRIES IN @lt_changenr
    WHERE changenr = @lt_changenr - table_line.
        ENDIF.

LOOP AT it_bill INTO wa_bill.
  " O(1) lookup: No searching required, direct hash hit
  READ TABLE lt_cdhdr INTO wa_cdhdr 
    WITH KEY changenr = wa_cdpos - changenr.
    
  IF sy - subrc = 0.
    wa_final - udate = wa_cdhdr - udate.
        ENDIF.
        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

The optimized programs delivered exactly the same results-but in a fraction of the time. What would have been a high-risk manual exercise was completed safely without disrupting production workflows.

- SAP Technical Lead, Large Steel Manufacturer
ENGAGEMENT DETAILS

Engagement Details

Industry
Manufacturing (Steel)
Landscape
ECC 6.0 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