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
Zeroreliability on scarce expertise
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 agents:

Identified execution hotspots across dispatch, billing, pricing, and audit-history logic
Replaced nested loop patterns with parallel cursor techniques
Moved database access outside loops, preloading and reusing data safely
Introduced sorted and hashed internal tables with binary search
Optimized aggregation logic for gate entry and weight calculations
Preserved every functional condition, rule, and output structure

All changes were self-documented, regression-tested automatically, and validated to ensure identical results to the legacy programs.

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%with zero delay
Operational Risk
100%eliminated
Code Refactored
48,000 +lines
Documentation
Automatic
WHAT CHANGED

O(1) Access with Hashed Tables

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.

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

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

Aspect Details

Industry
Manufacturing (Steel)
Landscape
ECC 6.0 S/4HANA (Brownfield)
Timeline
2 Weeks vs 3 Months
Delivery Partner
SGN Software

Ready to See Similar Results?

Start with a pilot on your most challenging programs. See what autonomous AI can do in weeks.

Background ASCII Illustration