This is a test message to test the length of the message box.
Login
|

Write a comment

Writing comments is only allowed to registered users, registration is free and does not require an email address and can be done quickly here.

DATA FROM QUERY CLASS TO READ

Vmanhas0308 - 11/16/2025 - 14:59

Thank you for this interesting blog, I have a scenario where we are submitting a standard program in query class and then displaying data in UI, as you mentioned in your blog we need to implement read method, you are using dummy data from query class, is there a correct way to access the query class data in read method, do we need to store data in local database tables and then access in read method or transfer through memory is possible in such scenario, What must be the correct approach according to you ?


Xexer - 11/17/2025 - 06:47

Hi Vmanhas,

in this case the method is a placeholder, where you can implement your logic to get your data. You can implement your logic there and call it from both methods. A direct call of the query method is not possible and also saving the data, because a query method shouldn't do write actions.

Greetings Björn


Custom Entity with Action

dparashar - 09/27/2025 - 14:22

For a custom RAP entity, the query class method is executed each time data is read. In our case, the query class fetches data from a remote API.

We also have a custom action with $self that updates the same data through the remote API. However, we want to update a UI field (for example, an success_message) based on the action’s result. This error_message field does not exist in the remote system.

If we don’t persist this value in a local database table, the query class will continue to return only the original data from the remote API.

Is persisting the error_message (or similar transient field) in a database the only way to ensure the UI reflects this updated value after the action?


Xexer - 09/29/2025 - 11:22

Hi dparashar,

that is correct. We are in a stateless Environment, so when you want to show some message or data, that is not refelcted in the API, you have to save it and show it.

Greetings Björn


Call BAPI

datskam@gmail.com - 08/01/2025 - 15:06

How to call a BAPI, for example I need to create a sales order using BAPI. How can we develop RAP application for this case. I tried to create sale order using BAPI but in my case I need to return Sales order number and some addition data. How can we send additional information in post call in response


Xexer - 08/01/2025 - 15:43

Hi datskam,

the BAPI is called the same way, like the save of the table. You should provide the informations to the save sequence and call the BAPI. The SO number can't return via this way, you have to save it (like in the example) and you can load it with the query call to display it.

Greetings Björn


datskam@gmail.com - 08/01/2025 - 15:50

But In SEGW we can add addition information in response after post call, so in RAP there is no such option available ? If we need to send the addition information then we have to do query again right?


Xexer - 08/01/2025 - 15:58

So you are talking about a function/action in OData and not a regular entity. You can freely design what you want to return from a function/action. Check this article for dynamic input, the result for the action can also be defined freely.