Guides implementation of event-driven patterns using RAP business events and SAP Event Mesh in ABAP Cloud, including defining events in behavior definitions, raising them from handler methods, binding for consumption, and event consumption.
Ships in SAP ABAP. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Guide for implementing event-driven patterns using RAP business events and SAP Event Mesh in ABAP Cloud.
Determine the user's goal:
Identify the scenario:
Guide implementation following RAP eventing patterns
| Concept | Description |
|---|---|
| Business Event | Declared in BDEF; raised when something significant happens |
| Event Definition | Formal declaration with parameters in the behavior definition |
| Event Raising | Triggered in handler/saver methods via RAISE ENTITY EVENT |
| Event Binding | Maps RAP event to an enterprise event topic for external delivery |
| Event Consumption | External systems subscribe and react to published events |
managed implementation in class zbp_r_travel unique;
strict ( 2 );
define behavior for ZR_Travel alias Travel
persistent table ztravel_tab
lock master
authorization master ( instance )
etag master LocalLastChangedAt
{
create;
update;
delete;
"Define business events
event travel_created parameter ZD_TravelCreatedEvt;
event travel_accepted;
event travel_rejected;
}
Define a CDS abstract entity for the event payload:
@EndUserText.label: 'Travel Created Event'
define abstract entity ZD_TravelCreatedEvt
{
travel_id : /dmo/travel_id;
agency_id : /dmo/agency_id;
customer_id : /dmo/customer_id;
description : /dmo/description;
total_price : /dmo/total_price;
currency : /dmo/currency_code;
}
Events without the parameter addition have no payload.
METHOD on_travel_accept.
"Read travel data
READ ENTITIES OF zr_travel IN LOCAL MODE
ENTITY Travel
ALL FIELDS
WITH CORRESPONDING #( keys )
RESULT DATA(lt_travels).
"Update status
MODIFY ENTITIES OF zr_travel IN LOCAL MODE
ENTITY Travel
UPDATE FIELDS ( status )
WITH VALUE #( FOR travel IN lt_travels
( %tky = travel-%tky
status = 'A' ) )
REPORTED DATA(lt_reported).
"Raise event for each accepted travel
RAISE ENTITY EVENT zr_travel~travel_accepted
FROM VALUE #( FOR travel IN lt_travels
( %key = travel-%key ) ).
ENDMETHOD.
METHOD on_travel_create.
"After successful creation
RAISE ENTITY EVENT zr_travel~travel_created
FROM VALUE #( FOR travel IN lt_created_travels
( %key = travel-%key
%param = VALUE #(
travel_id = travel-travel_id
agency_id = travel-agency_id
customer_id = travel-customer_id
description = travel-description
total_price = travel-total_price
currency = travel-currency_code ) ) ).
ENDMETHOD.
METHOD save_modified.
"Raise events in the save phase for committed data
IF create-travel IS NOT INITIAL.
RAISE ENTITY EVENT zr_travel~travel_created
FROM VALUE #( FOR travel IN create-travel
( %key = travel-%key
%param = VALUE #(
travel_id = travel-travel_id ) ) ).
ENDIF.
ENDMETHOD.
1. User action triggers RAP operation
2. Handler method executes business logic
3. RAISE ENTITY EVENT queues the event
4. RAP framework commits the transaction
5. After successful COMMIT:
a. Local event handlers are called
b. Enterprise events are published to Event Mesh
To publish RAP events externally, create an event binding:
ADT: New → Other → Event Binding
Name: Z_EVT_BIND_TRAVEL
Event binding maps RAP events to enterprise event topics:
| Property | Value |
|---|---|
| Namespace | sap.s4.beh or custom namespace |
| Business Object | ZR_Travel |
| Event | travel_created |
| Topic | sap/s4/beh/travel/created/v1 |
<namespace>/<business-object>/<event-name>/<version>
Example: z.custom/travel/created/v1
SAP_COM_0092 (Enterprise Event Enablement)Register an event handler class:
CLASS zcl_travel_event_handler DEFINITION
PUBLIC FINAL CREATE PUBLIC.
PUBLIC SECTION.
"Event handler method
METHODS on_travel_created
FOR ENTITY EVENT
travel_created FOR Travel~travel_created.
ENDCLASS.
CLASS zcl_travel_event_handler IMPLEMENTATION.
METHOD on_travel_created.
"React to travel creation
LOOP AT travel_created INTO DATA(ls_event).
"Process event data
DATA(lv_travel_id) = ls_event-travel_id.
"e.g., send notification, update related records
ENDLOOP.
ENDMETHOD.
ENDCLASS.
External systems subscribe to topics via:
"Using the event consumption model
"1. Create event consumption model in ADT
" (imports AsyncAPI spec or defines events manually)
"2. Implement the event handler
CLASS zcl_ext_event_handler DEFINITION
PUBLIC FINAL CREATE PUBLIC.
PUBLIC SECTION.
INTERFACES if_event_handler.
ENDCLASS.
CLASS zcl_ext_event_handler IMPLEMENTATION.
METHOD if_event_handler~handle.
"Parse event payload
DATA(lv_payload) = io_event->get_text( ).
"Process the event
ENDMETHOD.
ENDCLASS.
Producer raises event → Event Mesh delivers → Consumer processes independently
Include full entity data in event payload so consumers don't need to call back:
RAISE ENTITY EVENT zr_travel~travel_created
FROM VALUE #( ( %key = ls_travel-%key
%param = CORRESPONDING #( ls_travel ) ) ).
Record every state change as an event for full audit trail.
/v1, /v2)When helping with eventing topics, structure responses as:
## RAP Business Event Guidance
### Scenario
- Type: [Local event / Enterprise event]
- Role: [Producer / Consumer]
### Implementation
[Event definition, raising, and consumption code]
### Configuration
[Event binding and communication arrangement setup]
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
rap, abap-cloud, event-mesh, event-driven-architecture, sap-btp
/sap-abap:rap-business-eventsfrom SAP ABAP
npx claudepluginhub likweitan/abap-skills --plugin sap-abap17 skills in this plugin
/abapComprehensive ABAP code quality checking using abaplint (automated static analysis) and Clean ABAP principles (manual code review). Use when users ask to check, lint, validate, review, or analyze ABAP code for syntax errors, clean code compliance, code quality, best practices, or adherence to Clean ABAP guidelines. Also use for abaplint setup, configuration, and execution. Triggers include "check this ABAP code", "lint my ABAP", "run abaplint", "configure abaplint", "is this clean ABAP", "review my ABAP", "analyze ABAP code quality", "code quality check", or "ABAP best practices"./abap-cloudHelp with ABAP Cloud development and the clean core level concept (Levels A, B, C, D) including ABAP Cloud vs. classic ABAP development models, ABAP Cloud language version restrictions, wrapper patterns for non-released APIs, released/classic/internal/not-recommended object classification, and clean core principles. Use when users ask about ABAP Cloud, ABAP for Cloud Development, clean core, clean core levels, Level A B C D, classic API, internal object, not recommended object, noAPI, wrapper pattern, released APIs, stability contract, language version, restricted ABAP, embedded Steampunk, developer extensibility, key user extensibility, changelog for SAP objects, or ABAP Cloud readiness. Triggers include "ABAP Cloud restrictions", "clean core", "clean core level", "which level is my extension", "Level A extension", "classic API", "wrapper class", "released API alternative", "ABAP language version", "Steampunk", or "extensibility model"./abap-cloud-migrationHelp with migrating classic ABAP custom code toward higher clean core levels (Level A/B/C/D) including custom code adaptation, identifying released and classic API replacements, generating wrapper classes for non-released objects, ATC clean core and Cloud Readiness checks, changelog for SAP objects, handling incompatible language constructs, and step-by-step remediation workflows. Use when users ask about migrating to ABAP Cloud, custom code migration, cloud readiness, clean core level remediation, eliminating Level D, reducing Level C, non-released API replacement, wrapper pattern, ATC clean core checks, code adaptation, classic to cloud migration, or clean core compliance. Triggers include "migrate to ABAP Cloud", "cloud readiness check", "clean core level", "eliminate Level D", "reduce Level C", "non-released API", "replace with released API", "custom code adaptation", "wrapper for non-released", "ATC clean core", "clean core migration", "changelog for SAP objects", or "ABAP Cloud compatibility"./abapgitHelp with abapGit workflows including repository setup, cloning, serialization, branching strategies, transport-vs-git workflows, CI/CD integration, and .abapgit.xml configuration. Use when users ask about abapGit, git for ABAP, ABAP version control, abapGit clone, abapGit pull, abapGit push, branching strategy for ABAP, abapGit configuration, serialization, deserialization, transport vs git, gCTS, abapGit CI/CD, or managing ABAP code in git repositories. Triggers include "set up abapGit", "clone a repo", "push ABAP to git", "abapGit branching", "abapGit configuration", ".abapgit.xml", "transport vs git", or "CI/CD for ABAP"./abap-sql-amdpHelp with modern ABAP SQL features and AMDP (ABAP Managed Database Procedures) including inline declarations, window functions, GROUP BY, HAVING, PRIVILEGED ACCESS, string functions, aggregate expressions, common table expressions (CTE), AMDP classes, AMDP procedures, AMDP table functions, CDS table functions, and AMDP scalar functions. Use when users ask about ABAP SQL, modern SQL, SELECT, window functions, CTE, common table expression, AMDP, SQLScript, AMDP table function, CDS table function, aggregate, GROUP BY, HAVING, UNION, INTERSECT, EXCEPT, PRIVILEGED ACCESS, ABAP SQL expressions, built-in SQL functions, or database procedures. Triggers include "ABAP SQL query", "window function", "CTE", "AMDP", "table function", "GROUP BY", "aggregate", "PRIVILEGED ACCESS", "inline SELECT", or "SQLScript"./abap-unit-testingHelp with ABAP Unit testing including test class setup, assertions, test doubles, mocking frameworks, dependency injection, CDS test environments, SQL test environments, RAP BO test doubles, and test fixtures. Use when users ask about ABAP unit tests, test classes, test methods, CL_ABAP_UNIT_ASSERT, test doubles, mocking, CDS test environment, SQL test environment, RAP testing, ABAP test injection, test seams, behavior-driven testing, TDD in ABAP, test isolation, or writing automated tests for ABAP code. Triggers include "write a unit test", "create test class", "mock a dependency", "test a CDS view", "test a RAP BO", "test double", "assertion", "test fixture", "test isolation", or "ABAP unit".Other plugins' skills for the same job