📚 Architectural Blueprint

SAP Clean Core High-Performance Parallel Processing Guide

A definitive guide to replacing obsolete asynchronous RFCs (aRFC) with cl_abap_parallel, cursor chunking, and worker pool throttling in SAP S/4HANA.

1. The Death of Asynchronous RFC (CALL FUNCTION STARTING NEW TASK)

For over two decades, SAP ABAP developers relied on CALL FUNCTION ... STARTING NEW TASK to achieve concurrency in high-volume processing (such as billing runs, mass payment runs, and EDI dispatching).

In ABAP Cloud (Language Version: ABAP for Cloud Development):

2. Modern Concurrency: `cl_abap_parallel`

SAP introduced the Parallel Processing Framework (`cl_abap_parallel`) to provide safe, object-oriented concurrency compliant with Clean Core standards.

Capability Legacy aRFC ABAP Cloud (`cl_abap_parallel`)
Clean Core Status Deprecated / Prohibited Released (Contract C1)
Payload Serialization Flat table parameters via RFC buffers Type-safe deep object serialization
Worker Quota Throttling Manual SPBT_* function calls Built-in iv_max_threads parameter
Timeout Handling Custom polling loop with RECEIVE RESULTS Built-in iv_timeout_sec with graceful abort
Cloud Safety Bypasses tenant resource governance Monitored and throttled by SAP Cloud Kernel

3. The Architecture of a Clean Core Worker Pool

A resilient concurrent architecture consists of three distinct layers:

  1. Chunking Layer: Reads database records in small packages using OPEN CURSOR ... PACKAGE SIZE to keep memory below 50 MB on the orchestrator node.
  2. Worker Pool Dispatcher: Instantiates task classes implementing if_abap_parallel and executes them across background worker processes up to a defined ceiling (typically 4–8 threads).
  3. Result Aggregator: Collects serialized payloads from completed workers, aggregates execution metrics, and logs any chunk failures into the Application Log (cl_bali_log).

4. Golden Rules for Parallel Worker Design

🚨 Avoid Database Lock Contention

Ensure that keys partitioned across workers never touch the same database records or parent numbers. If two workers attempt to modify line items of the same Purchase Order or Sales Document concurrently, SAP enqueue locks will fail, causing transaction rollbacks.

Interactive Parallel Processing Code Generator

Generate compliant ABAP Cloud worker classes, cursor chunking loops, and Application Job runners with our free interactive architect.

⚡ Launch Parallel Processing Architect