SAP

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
⤢ Open full site

How to Create RAP Business Events in an On-Premise system

Create and exposure of business events in an On-Premise system

Overview

🎓 beginner 45 min. ABAP DevelopmentBeginner

You will learn

  • How to create Business Events with RAP in an On-Premise system
  • How to set up a channel to connect to SAP Event Mesh
Niloofar Flothkoetter N Niloofar Flothkoetter August 21, 2026
Created on March 21, 2023
Contributors

More from Niloofar Flothkoetter

See all 12 tutorials by Niloofar Flothkoetter →

Prerequisites

Prerequisites

Steps

Intro

Always replace #### with your initials or group number.

The ABAP RESTful Application Programming Model (RAP) now supports the native consumption and exposure of business events from release 2022. For exposure, an event can be defined and raised in a RAP business object or in the behavior extension and then published via Event Bindings.

Step 1 Create database table

To produce and raise an event you need first to define your RAP Business Object which produce the event. For this, you will create a booking application. The event will be sent whenever a booking flight is cancelled.

  1. Open ADT and open your system.

  2. If you do not have an ABAP Package create a new one. Please be sure if your package name is started with Z like

  • Name: ZEVENT_BOOKING_####
  • Description: define a RAP event

new
new

  1. Right-click on your package and create a new database table
  • Name: ZBOOKING_####
  • Description: DB for booking

database
database

database
database

  1. Replace the default code with the code snippet provided below and replace all placeholder #### with your group ID using the Replace All function Ctrl+F.
ZBOOKING_####
@EndUserText.label : 'DB for booking'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #RESTRICTED
define table zbooking_#### {
key client            : abap.clnt not null;
key travel_id         : /dmo/travel_id not null;
agency_id             : /dmo/agency_id;
customer_id           : /dmo/customer_id;
begin_date            : /dmo/begin_date;
end_date              : /dmo/end_date;
@Semantics.amount.currencyCode : 'zbooking_####.currency_code'
booking_fee           : /dmo/booking_fee;
@Semantics.amount.currencyCode : 'zbooking_####.currency_code'
total_price           : /dmo/total_price;
currency_code         : /dmo/currency_code;
description           : /dmo/description;
overall_status        : /dmo/overall_status;
attachment            : /dmo/attachment;
mime_type             : /dmo/mime_type;
file_name             : /dmo/filename;
created_by            : abp_creation_user;
created_at            : abp_creation_tstmpl;
last_changed_by       : abp_locinst_lastchange_user;
last_changed_at       : abp_locinst_lastchange_tstmpl;
local_last_changed_at : abp_lastchange_tstmpl;
}  
  1. Save and activate your table.

database
database

Step 2 Create data generator class
+
Step 3 Generate the transactional UI services
+
Step 4 Publish the Service and Preview the Booking App
+
Step 5 Create an Event in Behaviour Definition
+
Step 6 Creation of an Event Binding for the Business Event
+
Step 7 Edit behavior implementation class
+
Step 8 Creating a channel using a service key
+
Step 9 Configure outbound bindings
+
Step 10 Create queue
+
Step 11 Create a Message in Application
+
Step 12 Test yourself
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 12
1. Create database table 2. Create data generator class 3. Generate the transactional UI services 4. Publish the Service and Preview the Booking App 5. Create an Event in Behaviour Definition 6. Creation of an Event Binding for the Business Event 7. Edit behavior implementation class 8. Creating a channel using a service key 9. Configure outbound bindings 10. Create queue 11. Create a Message in Application 12. Test yourself