← SAP Clean Core Engineering Hub
GUIDE #77 Open Daemon Architect →
ARCHITECTURAL BLUEPRINT #77

SAP Clean Core ABAP Daemons, Long-Running Background Workers & PCP Messaging Guide

Eliminate dialog runtime timeouts and batch job scheduling lag in SAP S/4HANA. Architect persistent, real-time background workers using ABAP Daemons (cl_abap_daemon) and Push Channel Protocol (PCP).

📖 Production Clean Core Reference Manual

Complete blueprints for ABAP Daemons, Application Jobs, and RAP architecture in The SAP Clean Core & ABAP Cloud Handbook.

Get Enterprise Suite (-80% Off: €9.80) →

1. The Limitations of Classic Background Execution

In traditional SAP development, background workloads rely on batch jobs (SM36/SM37). While suitable for nocturnal mass processing, batch jobs have significant drawbacks for modern real-time architectures:

2. Anatomy of the ABAP Daemon Framework

ABAP Daemons (introduced in modern SAP NetWeaver and standard in ABAP Cloud) are event-driven, persistent processes executing in specialized non-dialog background sessions:

3. The Push Channel Protocol (PCP) Interface

To deliver instructions to a running daemon, callers use if_ac_message_type_pcp. Unlike plain strings, PCP messages provide structured key-value headers and typed payloads:

DATA(lo_msg) = cl_ac_message_type_pcp_factory=>create_message( ).
lo_msg->set_field( i_name = 'EVENT_TYPE' i_value = 'ORDER_CREATED' ).
lo_msg->set_text( '{"orderId": "1002931"}' ).

cl_abap_daemon_client_manager=>send(
  i_class_name = 'ZCL_EVENT_DAEMON'
  i_name       = 'INSTANCE_01'
  i_message    = lo_msg
).

4. Enterprise Use Cases in Clean Core

ABAP Daemons serve three primary architectural patterns in Clean Core landscapes:

  1. Continuous Transactional Outbox Dispatching: Periodically sweeps local outbox tables every few seconds to publish events to SAP Event Mesh without batch job latency.
  2. Shared Memory Cache Refresh: Reacts to cross-system invalidation events to pre-warm application server SHMA buffers.
  3. WebSocket Stream Aggregation: Consumes high-frequency IoT sensor telemetry and aggregates readings before persisting to SAP HANA.
Interactive Generator: Use Tool #90: SAP Clean Core ABAP Daemon Architect to generate production daemon classes, lifecycle managers, and PCP message senders.

Build Scalable Enterprise SAP Systems

Get complete blueprints for ABAP Daemons, background workers, and Clean Core architecture in The SAP Enterprise Architecture Suite.

Get Enterprise Suite (-80% Off) → View on Amazon ($19.99) →