I need to show alert messages in MIRO transaction when specific conditions are met. I tried using the INVOICE_UPDATE BADI with the CHANGE_AT_SAVE method but the warnings don’t appear even though my code runs.
I found out that after my BADI executes, the system checks if the transaction runs in dialog mode before showing messages. Are there alternative user exits or BADIs I can use to display warnings to users?
Here’s the code pattern I discovered:
IF result <> 0.
IF invoice_header-process_type NE dialog_constant.
MESSAGE ID system-message_id TYPE system-message_type NUMBER system-message_number
WITH system-var1 system-var2 system-var3 system-var4.
ELSE.
CALL FUNCTION 'STORE_MESSAGE'
EXPORTING
message_class = system-message_id
message_type = system-message_type
variable1 = system-var1
variable2 = system-var2
variable3 = system-var3
variable4 = system-var4
text_number = system-message_number.
ENDIF.
ENDIF.