Your action returns a success message, and a validation on the draft returns an error on a field. Explain how each message travels from REPORTED to the Fiori elements screen over OData V4.
Say your answer out loud first.
Practise another way
I separate state from transition messages. My validation sets %state_area, so its error is a state message bound to the instance. It travels in the entity's message property and stays until the data is fixed.
The action's success message has no state area, so it is a transition message. On success it travels in the sap-messages header; if the request fails, messages go in the OData error response.
Two decisions in the ABAP code
- State or transition. A row in
reportedwith%state_areafilled is a state message: it describes the instance and must be bound to it. With%state_areaempty it is a transition message, about this request only. - Bound or unbound. A row with
%tkyis bound to an instance. A row inreported-%otheris unbound. State messages can never go to%other.
%element-Field = if_abap_behv=>mk-on sets the target, so Fiori can link the message to the input field.
Three OData V4 channels. The SAPUI5 documentation for the OData V4 model names them:
| Channel | Carries | When |
|---|---|---|
| Error response body | Bound and unbound transition messages | Request failed (4xx/5xx) |
sap-messages response header |
Bound and unbound transition messages | Request succeeded |
| Message property of the entity | Bound state messages (and bound transitions) | Request succeeded |
So the action's success text arrives in the header. The draft validation's error arrives with the entity data when the UI reads the draft, for example after Prepare. An error that makes a request fail arrives in the error body.
What the user sees. Fiori elements shows state messages in the message popover of the object page in edit mode. They stay until the data changes and the check runs again.
That is why SAP's validations first append a row with only %tky and %state_area: it clears the old state message of that area. Transition messages are "fire and forget" and appear in a dialog or toast.
In EML the same split holds. A transition message comes back in reported of the same statement. A state message is pooled and returned by a later READ of the instance.
A rollback detail. If a rollback happens in an OData request, RAP converts the state messages raised in it into transition messages. The persisted state did not change, so they cannot describe it.
OData V2 uses one sap-message header with a transition flag. Fiori elements V4 apps on RAP use the channels above.
Explains %state_area as the state/transition switch, maps each kind to the error body, the sap-messages header or the entity message property, and knows why validations clear their state area first.
Says all messages simply come back in the HTTP response, or cannot explain why a draft error stays on screen while a success toast vanishes.
Leaving %state_area empty in draft validations. The messages then become transition messages, appear once in a dialog and cannot be cleared when the user fixes the field.
- Why should a validation in a draft app raise state messages rather than transition messages?
- A message shows in a dialog instead of next to the field. What is missing?
- How does an EML caller get a state message that a validation raised during Prepare?
6 official pages. Confidence: high. Checked 3 Dec 2026.
- Official page Backs the answer.
- Official page Backs the answer.
- Official page Backs the answer.
- Official page Backs the answer.
- Official page Backs the answer.
- Official page Backs the answer.