cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Refresh Object Page after Action Execution with Custom Entity

liutiuriu
Explorer
0 Kudos
1,003

Hello everyone,

I am using the RAP Model with a Custom Entity and have implemented an Unmanaged Behavior Definition. I want to refresh the Object Page after executing an action.

However, since the Custom Entity does not have a projection, I cannot use the "use side effects" syntax in the projection. I have tried using "side effects affect ..." but the Object Page does not refresh.

Is there any way to refresh the Object Page when using a Custom Entity in RAP?

Thank a lot.

Accepted Solutions (0)

Answers (2)

Answers (2)

Chuma
Active Contributor
0 Kudos

Hello @liutiuriu 

You can refresh the Object Page using RAP (ABAP RESTful Application Programming Model) by exposing your Custom Entity through a behaviour projection and enabling side effects.

In the base behavior, declare side effects {action <YourAction> affects $self, messages, permissions; }

In projection behavior, add use side effects and expose the projection in your service.
Fiori elements (OData V4) will remind the page after the action. See RAP side effects and projection behavior docs. SAP Help Portal-ABAP Keywood Documentation-RAP - side effects

With kind regards

Chuma

ClearQueries
Explorer
0 Kudos

Hi @liutiuriu,

As you rightly mentioned, custom entities are not part of BO model and hence triggering side effect via RAP won't be possible.

In order for you to achieve this, you have to write your Side Effect annotation on Fiori side using local annotations.

Refer XML annotations specified in following documentation - https://sapui5.hana.ondemand.com/sdk/#/topic/18b17bdd49d1436fa9172cbb01e26544

You've to define this SideEffect to trigger after execution of action and target entity should be your custom entity.

If you don't want to use local annotation, then you can try invoking you action via UI Controller coding and after it's successful execution you can request for your object page refresh using controller code.

Either way - you've to implement the side effect/refresh trigger on frontend side to achieve the behaviour you are looking for.

Hope this answer your query.

Please accept this answer if it resolves your query.

Regards,

ClearQueries.com 

Follow on LinkedIn