This is a test message to test the length of the message box.
Login
|
ABAP RAP Side Effects
Created by Software-Heroes

RAP - Side Effects

6054

How can you update parts of the Fiori UI without doing a complete refresh? With Side Effects, this is easily possible in ABAP and RAP.

Advertising


In this article we look at the different types of side effects and how you can use them effectively in your everyday life.

 

Introduction

To do this, we will expand our application from the Report Pattern series to include additional functionality. If you have already worked with the application, you will certainly have noticed that certain components of the application are only loaded when updating, such as after processing the Excel file or when adding a new country.

Side effects can be created for this purpose. These define a trigger, which in turn triggers an effect on an object. Only the affected objects are reloaded. For example, if it is a field, then only this field will be reloaded. In principle, this function was already possible in Fiori, but you can now control this from the RAP behavior.

 

Options

Currently, certain actions can trigger a side effect, including:

  • Fields - A specific field is changed in the UI.
  • Actions - An action is triggered, usually linked to a button in the UI.
  • Determination - An determination is initiated that automatically changes the contents of fields.
  • SELF - Refers to the own entity.

 

The following objects can then be influenced:

  • Fields - Updating individual fields in the UI, but also individual fields of associations.
  • Permissions - This can be used to deactivate buttons, such as custom actions and standard actions.
  • Entity - This can be used to reload complete associations if data in entire nodes has changed.
  • Messages - Forces the reloading of messages generated via REPORTED.
  • SELF - Refers to the own entity.

 

In principle, you can use side effects in the RAP business objects (managed and unmanaged), as well as in the projection layer of the objects. You can also find further details in the technical documentation that we have linked below. However, you need an S/4HANA 2023 system on-premise for this.

 

Example

In this example, we want to equip the upload button with an action. To do this, after executing the action, the country entity should be updated and the Excel file field, as this will be deleted after the upload. Let's take a look at what it looks like before the action.

 

To do this, we extend the projection of the behavior definition and insert the new statement under the "LoadExcelContent" action. With SIDE EFFECTS you open the area where you can define all side effects. To do this, we define an effect for our actions that affects the Country entity and the ExcelAttachment field. Since the object can only be listed once, we separate the effects with a comma at the end.

side effects {
  action LoadExcelContent affects entity _Country, field ExcelAttachement;
}

 

After this small change, let's look at the impact on the UI. It is noticeable that the interface has already been reloaded after the action has been carried out.

 

Full example

All changes made in this article can be found in the GitHub repository under the corresponding commit. This will help you better understand all changes.

 

Conclusion

Side Effects can be integrated into the UI with very little effort and make the user's work much easier, as they can immediately see the updated information without having to reload the application.

 

Source:
SAP Help - Side Effects


Included topics:
RAPBTPSide EffectREX5
Comments (0)



And further ...

Are you satisfied with the content of the article? We post new content in the ABAP area every Tuesday and Friday and irregularly in all other areas. Take a look at our tools and apps, we provide them free of charge.


RAP - Implement Change Documents (native)

Category - ABAP

If you have the appropriate release, you can now implement change documents natively in RAP without much manual implementation. Let's look at the different steps.

04/24/2026

RAP - Auxiliary Class

Category - ABAP

As the implementation grows in the behavior implementation of a RAP object, what options do you still have for clean encapsulation? Let's look at this in detail.

04/17/2026

RAP - Implement change documents (Manual)

Category - ABAP

This article delves into the manual implementation of change documents in our RAP object and examines the various integration steps. The goal is to generate change documents automatically.

04/14/2026

RAP - Draft Query

Category - ABAP

In this article, we'll look at the Draft Query in RAP and how you can use it to control entries and their visibility. We'll also look at a practical example.

04/03/2026

RAP - Importance

Category - ABAP

Let's look at the importance of information within an SAP Fiori application and how we can use it to control visibility in the RAP application.

03/24/2026