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

How to pass error message from read method in behavior implementation class?

amit5ingh
Participant
0 Likes
1,195

Hi Experts,

We have a requirement where we need to pass error messages if the data extracted from the CDS view belongs to a certain Sales Organization.
The development is done using RAP framework, data is being extracted from standard tables in interface CDS views which are being used in final consumption view. The application is display only and the whole thing works fine.
But now we have a requirement where we need to show error message instead of data if certain result set is extracted. So can we use read method of behavior implementation class, where we can check the result set and pass the data or error message accordingly?

Accepted Solutions (1)

Accepted Solutions (1)

Andre_Fischer
Product and Topic Expert
Product and Topic Expert

The requirement sounds weird to show an error message rather than using DCL to filter out such entries based on authorizations.   

If you really want to implement something like this in a read only app so called custom entities might be an option.

Here you are implementing the query via ABAP code.

How to implement a custom entity in the ABAP RESTf... - SAP Community

Regards,

Andre

 

 

amit5ingh
Participant
0 Likes

Hi Andre,

Indeed, it is a wired ask from client that they want the error messages instead of using DCL to restrict the data.
Thanks for you response though.

Best regards,
Amit

Answers (0)