Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ABAP RAP Unmanaged Scenario - how to properly fail a request?

aldimitrov14
Explorer
4,023

Hello, right now I am doing development for unmanaged scenario app which has to execute some business logic when saving. In my case that would be a function module which will return some error data using a bapiret table.

Using the error table I'm appending every error as a line of the reported-entity table.

After doing that, the OData request does not fail, but returns a positive return code - in my case I get 201 Created on a create request, and the response body is filled with the error messages that were produced from the function module. 

Is it possible to fail the request entirely ( so the request returns error code 500 ) ?

 

1 REPLY 1
Read only

Ramjee_korada
Active Contributor
0 Kudos
3,964

Hi ,

You will have to fill the response parameter - 'Failed' along with reported. 
Failed -> to identify failure and response code.

Reported -> to send the messages in all the scenarios of success, error , warnings etc. 
https://help.sap.com/docs/abap-cloud/abap-rap/general-rap-bo-implementation-contract?locale=en-US#lo...


Best wishes,

Ramjee Korada