Skip to Content

Handling messages sapui5

Hi all,

I have and trying to handle messages that I' sending from the backend with sapui5. I was successful to send my messages to the frontend. I can see them messages traveling in the responde when execute:

oModel.submitChanges({ success: function(oData)

Odata has the messages that I'm sending in the property "sap-message". Everything is working fine until this point, the only thing is that inside sap message I cannot see the "message-type" property. Instead there is a "severity" property.

Here is the content of the sap message property:

"{"code":"SABAPDOCU/888","message":"test message ","severity":"warning","target":"","details":[]}"

This severity property, has 3 possible values: info, warning, error.

Here is link the with the message structure: https://help.sap.com/doc/saphelp_gateway20sp12/2.0/en-US/25/21aecce9db435daaea433071ff7d94/content.htm?no_cache=true

If at the backend when add the message

DATA lo_message_container TYPE REF TO /iwbep/if_message_container.

lo_message_container->add_message( ......)

I use "iv_msg_type = 'I'" or "iv_msg_type = 'S' => severity = 'Info'.

"iv_msg_type = 'W' => severity = 'Warning'

"iv_msg_type = 'E' => severity = 'Error'

As you can see above the message type 'S' or 'I' are giving me the same value in the severity property so I can't tell if it is a success message or a info message.

Is there anyway too add the "type message" as a new property inside the sap-message?.

Again here is the link where you can see how /IWBEP/IF_MESSAGE_CONTAINER

is sending the message to the frontend:

https://help.sap.com/doc/saphelp_gateway20sp12/2.0/en-US/25/21aecce9db435daaea433071ff7d94/content.htm?no_cache=true

Please let me know if something is not clear.

Regards.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

0 Answers