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.
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.
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:
Data-driven improvements measured on live production workloads.
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.
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.
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." 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.“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.”
Engagement Details
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

