Issue with RAP singleton instance handle validation and message propagation in RAP OData V4

Hi Experts,

We are working with a RAP Singleton OData V4 service that includes validations to restrict the SAVE operation using the FAILED structure under FOR VALIDATE ON SAVE.

 

 

APPEND VALUE #( %tky = ls_transactional_data-%tky ) TO failed-ProjectSBUAlloc.
APPEND VALUE #( %tky = ls_transactional_data-%tky
%state_area = ‘VALIDATE_PERCENT’
%path-ProjectSBUAllocAll = CORRESPONDING #( ls_transactional_data )
%element-distkey = if_abap_behv=>mk-on
%msg = new_message(

id = ‘ZTEST’
number = 000
severity = if_abap_behv_message=>severity-error “CONV #( ‘E’)
v1 = ‘Percentage value cannot be greater than 100’
)
) TO reported-ProjectSBUAlloc.

 

 

This works as expected in the Eclipse ADT preview, but we are facing an issue when accessing it via the Fiori app.

MKM_0-1739898785173.png

 

The custom validation message does not appear on the UI; instead, only the framework error (RAP_DSP_REQUEST/023) is returned. Despite properly updating the FAILED AND REPORTED structures, the validation failures are not being correctly tied to the singleton instance, unlike regular entities.

The RAP framework is overriding the message, preventing it from being properly surfaced in the response.

What would be the best approach to ensure that our custom validation messages are correctly displayed in the UI when using RAP?

Any suggestions would be greatly appreciated!

Scroll to Top