I was working on project which had requirement of raising messages from another system in Fiori application which uses BOPF. In short I was getting texts messages from one system which needs to be shown up in Fiori UI.
Generally messages are added in BOPF Validations,Determinations or Actions via common message structure SYMSG(method ADD_MESSAGE of interface /BOBF/IF_FRW_MESSAGE).Structures has fields like Message No, Message ID, Message Variables.
Now what if in our current scenario we don’t Message No and Message ID or Message Class in Current system, i.e messages should be raised via Message Text.
Add below code in any of the BOPF action:
DATA lo_cm TYPE REF TO /bobf/cm_frw.
CREATE OBJECT lo_cm TYPE /bobf/cm_frw_symsg
severity = ‘E’ “Specify Severity here
message_text = ‘Error message Text’ “Message Text .
io_message = lo_cm
You will see message ‘Error message Text’ after execution of Action.
Hope this helps