Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
Showing results for 
Search instead for 
Did you mean: 


In today's fast-paced business environment, companies need to be agile and responsive to rapidly changing market conditions. This requires seamless integration and communication between different business applications and systems. In the SAP BTP landscape, Remote Function Call (RFC) and Business Application Programming Interface (BAPI) are the traditional ways to integrate applications, but Event Driven Architecture (EDA) has emerged as a more effective approach. In this blog post, we will explore how RAP and CAP can be integrated using event-driven architecture with in SAP BTP.

What is RAP and CAP?

RAP (Restful ABAP Programming) is a framework that allows developers to create powerful and scalable business applications in SAP. CAP (Cloud Application Programming) is a development model that provides a consistent and uniform approach to building and deploying cloud-native applications. These two technologies can be integrated using an event-driven architecture approach to enable real-time communication between applications.

Event Driven Architecture (EDA)

EDA is a distributed computing architecture that enables different applications and systems to communicate with each other through events. Events can be defined as significant changes or occurrences in a system that trigger a specific action or response. In the context of SAP BTP, events can be generated by various applications and systems and can be consumed by other applications and systems.

Integrating RAP and CAP using EDA

To integrate RAP and CAP using EDA, we can use SAP Event Mesh service. This service provides a central platform to publish, consume and route events across different applications and systems.

Here is the quick demo for integrating RAP and CAP using EDA in SAP BTP:

As shown in the video, RAP and CAP are integrated using the following steps:

  1. Event Generation: When a order is made is made in RAP, Purchase Requisition is created in SAP S/4HANA an custom data event is generated and published to the SAP Events Mesh service.

  2. Event Routing: The SAP Events Mesh service routes the event to the relevant subscribers.

  3. Event Consumption: The CAP application subscribes to the relevant event and receives the event data.

  4. Data Processing: The CAP application processes the event data and create a Purchase Order in SAP S/4HANA.

  5. By Choosing "Inform RAP" action, CAP act as a publisher by sending custom data events to SAP Event mesh and RAP becomes a subscriber by consuming the messages.

Implementation Details

What is Inside RAP?

You can follow the tutorials to get your application ready and start sending events to SAP Event Mesh. To Consume events inside RAP , you have to create event consumption model. the guide is available here.

  • Create Event Binding to expose Events and then add outbound bindings in S/4HANA on-premise.

  • Raised the events which ultimately gets consumed in CAP.

  • Generate an async api metadata. Sample schema for this scenario is below.


  • Create an Event Consumption model in RAP and consume the events from CAP into RAP.

  • Create inbound bindings inside SAP S/4HANA on-premise and maintain queue subscription.

What is Inside CAP?

  • Consume data events coming from RAP and Create purchase Orders in SAP S/4HANA.

  • Once you choose "Inform RAP" actions , Emit custom data events from service handler in cloudevents format.

Benefits of EDA Integration

Integrating RAP and CAP using EDA provides the following benefits:

  1. Real-time Communication: EDA enables real-time communication between different applications and systems, which enhances the overall system performance and reduces response times.

  2. Scalability: EDA enables scalable systems by allowing applications and systems to communicate with each other in a loosely coupled manner.

  3. Reduced Complexity: EDA reduces the complexity of integrating different applications and systems, which improves the overall system architecture and reduces development time.


In conclusion, integrating RAP and CAP using event-driven architecture approach using SAP Event Mesh service provides a scalable, efficient and real-time communication between different business applications and systems. This approach reduces the complexity of integration and provides a consistent and uniform approach to building and deploying cloud-native applications. By embracing EDA, businesses can become more agile and responsive to changing market conditions and deliver better services to their customers.
1 Comment