Lesson 5 of 6
Connecting S/4HANA events
10 min
Listen to this lesson
Brokers and contracts are worthless until S/4HANA actually publishes. In SAP S/4HANA Private Edition and on premise, that is the job of enterprise event enablement: a channel connects the system to a broker, and outbound bindings choose which events go out on that channel. The business events course introduced both; this lesson walks through them as the integration team configures and tests them for each stage.
The pieces
| Piece | Where | What it does |
|---|---|---|
| Broker instance and service key | SAP BTP (Event Mesh capability) or advanced event mesh | Provides the endpoint and credentials the channel uses |
| Channel | Transaction /IWXBE/CONFIG in S/4HANA | Connects this client to one broker instance, with a namespace or topic prefix |
| Outbound binding | Transaction /IWXBE/OUTBOUND_CFG | Assigns event topics (for example SalesOrder Created and Changed) to the channel |
| Custom RAP event and event binding | ABAP development (ADT) | Makes Contoso's own events, such as agreementClosed, publishable |
| Event monitoring | Enterprise event enablement monitor in S/4HANA; broker monitoring | Shows what was sent, what failed, and queue depth |
The configuration chain from S/4HANA to the broker. Transaction names follow SAP's tutorials and practitioner guides; check screens and channel types for your release.
Walkthrough: wiring CMQ to the test broker
- Theo creates a service key for the test broker instance and hands it to Sam through the secure channel the Basis team uses for credentials.
- Sam creates the channel in CMQ client 100 with
/IWXBE/CONFIGfrom the service key, checks the technical user, and activates the channel. The channel name says which stage it serves. - Theo adds the outbound binding in
/IWXBE/OUTBOUND_CFGfor the topics Contoso uses: SalesOrder Created and Changed, BusinessPartner Created, and the custom agreementClosed event. - Priya creates a sales order for Great Lakes Fleet Services (17100001) in sales area 1710 / 10 / 00 and checks the event monitor in CMQ, then the test broker's queue for the fleet notifier.
- Sam repeats the setup in CMD (development broker) and, through the change process, in CMP (production broker), never copying a service key between stages.
Monitoring the S/4HANA side
Enterprise event enablement keeps its own record of what it tried to publish, and that monitor is the first place to look when consumers see nothing. Theo's team checks it daily during hypercare and then relies on alerts: a failed publish (for example after a technical user expired) and silence (no events where events are expected). Sam adds the channel's technical user and the service key credentials to the Basis calendar of expiring credentials, because an expired password is the most common cause of a sudden stop in event flow.
Stage pairing
| S/4HANA | Broker instance | BTP consumers |
|---|---|---|
| CMD client 300 | Development | cmc-ext-dev |
| CMQ client 100 | Test | cmc-ext-test |
| CMP | Production | cmc-ext-prod |
| CMR client 100 (after go-live) | Pre-production (if events are needed there) | cmc-ext-preprod |
Contoso's stage pairing for events, matching its BTP subaccount pairing. A system copy must never carry a production channel into a test client.
The most dangerous moment is a system copy. CMR is a masked copy of CMP, refreshed quarterly. If the channel configuration came across in the copy, CMR would publish to the production broker, and production consumers would act on test changes. Sam's post-copy checklist deactivates or repoints every enterprise event enablement channel before the client is opened, and Priya's first test after each refresh is the wrong-stage test: create an order in CMR and confirm nothing reaches production.
| Aspect | Standard business event | Custom RAP event |
|---|---|---|
| Defined by | SAP, documented in the Business Accelerator Hub | Kenji's team, in the behavior definition |
| Contract | SAP's AsyncAPI specification and payload | Contoso's AsyncAPI document and schema |
| Versioning | SAP releases new event versions | Contoso's rules from lesson 4 |
| Publishing | Outbound binding for its topic | Event binding plus outbound binding |
| First test | Change the business object in CMQ; see the event | Close an agreement in CMQ; see agreementClosed |
Custom events from RAP
For agreementClosed, Kenji's team declares the event in the behavior definition of ZR_CMC_CoreAgreement, raises it with RAISE ENTITY EVENT in the save sequence, and creates an event binding that maps it to a type and topic. From the broker's point of view, it is then just another event on the channel, and it needs an outbound binding like any standard event. A frequent first-test failure is exactly that: the RAP event is raised correctly, but nobody added it to the outbound binding in CMQ.
What goes wrong in testing
- Missing outbound binding. Orders change, no events arrive, and no error appears anywhere a user would see it.
- Wrong-stage channel. A copied client publishes to production.
- Expired credentials. The service key or technical user expires; events queue up or fail in the S/4HANA monitor.
- Assuming rich payloads. Standard events are mostly notifications; consumers read details by API.
What would you do?
After the quarterly CMR refresh, Wei creates test orders in CMR. The next morning, the fleet portal shows test delivery dates to Great Lakes Fleet Services. What should have prevented this?
- Enterprise event enablement: a channel connects a client to a broker; outbound bindings choose the events.
- No outbound binding, no event, and no visible error for users.
- Pair stages strictly; after every system copy, repoint channels and run a wrong-stage test.
- Custom RAP events need an event binding and an outbound binding like standard events.
Check your understanding · not graded
Lesson check
1. Which transaction creates the channel to the broker in S/4HANA?
2. Orders change in CMQ but no events arrive. What is a common cause?
3. What must happen after CMR is refreshed from CMP?
4. Which broker instance does CMQ client 100 publish to?
5. What does a custom RAP event need before external consumers receive it?