Rap Business Events logo

Rap Business Events

Community
likweitan
rap-business-events

Help with RAP business events and enterprise eventing including event definitions in behavior definitions, raising events from RAP handler methods, event bindings, SAP Event Mesh integration, event consumption, and event-driven architecture patterns in ABAP Cloud. Use when users ask about RAP business events, enterprise events, event mesh, eventing, raising events, event binding, event definition, event consumption, event-driven, asynchronous processing, event topics, or publish-subscribe in ABAP. Triggers include "RAP event", "business event", "raise event", "event mesh", "event binding", "enterprise eventing", "event-driven", "publish event", "consume event", or "asynchronous event".

Overview

Publisherlikweitan
Repositoryabap-skills
Skill namerap-business-events
Stars
64
Forks
15
Bundled files
1
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by likweitan on GitHub. Read the source before you install it.

Installation

Install the Rap Business Events AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/likweitan/abap-skills.git /tmp/abap-skills
mkdir -p .claude/skills
cp -r /tmp/abap-skills/skills/rap-business-events .claude/skills/rap-business-events
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Rap Business Events in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Rap Business Events on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Rap Business Events is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

RAP Business Events & Enterprise Eventing

Guide for implementing event-driven patterns using RAP business events and SAP Event Mesh in ABAP Cloud.

Workflow

  1. Determine the user's goal:

    • Defining business events in a RAP BO
    • Raising events from RAP handler methods
    • Binding events for consumption
    • Consuming events from external systems
    • Integrating with SAP Event Mesh
    • Understanding event-driven architecture in ABAP
  2. Identify the scenario:

    • Local event (within the same ABAP system)
    • Enterprise event (cross-system via Event Mesh)
    • Event producer vs. event consumer
  3. Guide implementation following RAP eventing patterns

Business Events Overview

ConceptDescription
Business EventDeclared in BDEF; raised when something significant happens
Event DefinitionFormal declaration with parameters in the behavior definition
Event RaisingTriggered in handler/saver methods via RAISE ENTITY EVENT
Event BindingMaps RAP event to an enterprise event topic for external delivery
Event ConsumptionExternal systems subscribe and react to published events

Defining Business Events

In the Behavior Definition (BDL)

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;
}

Event Parameter Structure

Define a CDS abstract entity for the event payload:

cds
@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.

Raising Business Events

In Handler Methods

abap
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.

With Event Parameters

abap
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.

In Saver Methods (Additional Save)

abap
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.

Event Processing Flow

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

Enterprise Event Enablement

Event Binding

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:

PropertyValue
Namespacesap.s4.beh or custom namespace
Business ObjectZR_Travel
Eventtravel_created
Topicsap/s4/beh/travel/created/v1

Event Topic Structure

<namespace>/<business-object>/<event-name>/<version>
Example: z.custom/travel/created/v1

Channel Binding for SAP Event Mesh

  1. Create a Communication Arrangement for scenario SAP_COM_0092 (Enterprise Event Enablement)
  2. Configure the Event Mesh service instance in BTP
  3. Maintain the channel in the Enterprise Event Enablement Fiori app
  4. Activate the event topic

Consuming Events

Local Event Consumption (Same System)

Register an event handler class:

abap
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 Event Consumption (via Event Mesh)

External systems subscribe to topics via:

  • SAP Event Mesh webhooks
  • SAP Integration Suite
  • Custom applications using AMQP or REST APIs

Consuming Events from External Systems in ABAP

abap
"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.

Event Patterns

Fire and Forget

Producer raises event → Event Mesh delivers → Consumer processes independently
  • No response expected
  • Loose coupling between systems
  • Best for notifications, audit logging, data replication triggers

Event-Carried State Transfer

Include full entity data in event payload so consumers don't need to call back:

abap
RAISE ENTITY EVENT zr_travel~travel_created
  FROM VALUE #( ( %key = ls_travel-%key
                  %param = CORRESPONDING #( ls_travel ) ) ).

Event Sourcing

Record every state change as an event for full audit trail.

Best Practices

  1. Define events for business-meaningful state changes, not technical operations
  2. Include sufficient data in event parameters to avoid consumer callbacks
  3. Use CDS abstract entities for event parameter types (clear contract)
  4. Raise events after validation — only raise when the operation will succeed
  5. Handle event processing failures — consumers should be idempotent
  6. Use meaningful topic naming following SAP conventions
  7. Version event topics for backward compatibility (/v1, /v2)

Output Format

When helping with eventing topics, structure responses as:

markdown
## 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]

References

Related Skills

  • rap: Use for building RAP business objects that can raise events
  • btp-abap-environment: Use for setting up Event Mesh integration via communication arrangements
  • authorization-iam: Use for securing event handling and access control

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Rap Business Events AI skill do?

Help with RAP business events and enterprise eventing including event definitions in behavior definitions, raising events from RAP handler methods, event bindings, SAP Event Mesh integration, event consumption, and event-driven architecture patterns in ABAP Cloud. Use when users ask about RAP business events, enterprise events, event mesh, eventing, raising events, event binding, event definition, event consumption, event-driven, asynchronous processing, event topics, or publish-subscribe in ABAP. Triggers include "RAP event", "business event", "raise event", "event mesh", "event binding",...

Why use Rap Business Events on TypingMind?

Because you install it once and use it with any model. Rap Business Events is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Rap Business Events in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/likweitan/abap-skills/tree/main/skills/rap-business-events. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Rap Business Events?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Rap Business Events?

As many as you like. As long as a model supports skills, you can use Rap Business Events with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Rap Business Events AI skill free?

Yes. It is published on GitHub by likweitan under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇