cancel
Showing results for 
Search instead for 
Did you mean: 

SAP RAP Custom Entity Query Method pass BAPI errors in header

BODHISATTWA__20
Participant
0 Kudos

I have created a custom entity .In the custom Entity Query Provider class I will call the BAPI .In the BAPI whatever errors show up , we want to send errors in the response Header .

I debugged the code . I realized that there is a variable SAP__MESSAGE .As per my understanding after reading the sap help link , If I am able to populate this that will reflect in the header .(Pease correct me if I am wrong )

https://help.sap.com/viewer/e5522a8a7b174979913c99268bc03f1a/2108.501/en-US/794cd7428b82493d98863b41...

**In Behavior implementation I am aware we can use the %msg and failed parameter and reported to achieve this functionality

But how can I implement the functionality in RAP Query method .

I created a structure type , with a table inside it .(of type SAP_MESSAGES) .Populated with "MSGID" , "MSGNO" ,

"MSGV1" . I get a 200 response .But I don't get the header fields in response Header

Can somebody help me how to populate it that particular variable .

Aplogies ,Please excuse the Dummy Values .This is just a DEMO experiment, so the values and teh naming might not make sense

---------------------------------------------------------

----------------------------------------

A screenshot of my dummy message class .

0 Kudos

Hi Bodhisattwa

Are you able to resolve this issue ?

In my case I want to do some validations after the user input in the UI and I'm also using the custom cds Entity so I need to do the validations in the query provider class.

Are you able to display the error messages? Can you please let me know your findings so that it will be helpful for me.

Thanks.

Accepted Solutions (0)

Answers (0)