Warning notifications not appearing in MIRO transaction using BADI implementation

I need to show warning alerts in MIRO transaction when specific conditions are met. I’ve used the INVOICE_UPDATE BADI with the CHANGE_AT_SAVE method but my warning messages don’t appear on screen even though the BADI gets triggered successfully.

After checking the system behavior, I found that messages only show when the transaction runs in dialog mode. Here’s the relevant code structure:

IF return_code <> 0.
  IF invoice_header-process_type NE dialog_constant.
    MESSAGE ID message_id TYPE message_type NUMBER message_number
               WITH message_var1 message_var2 message_var3 message_var4.
  ELSE.
    CALL FUNCTION 'STORE_MESSAGE'
         EXPORTING
              message_class = message_id
              message_type = message_type
              variable1 = message_var1
              variable2 = message_var2
              variable3 = message_var3
              variable4 = message_var4
              text_number = message_number.
  ENDIF.
ENDIF.

Is there another user exit or enhancement point where I can properly display warning messages to users in MIRO?

This happens frequently with MIRO transaction warnings. I would recommend avoiding the INVOICE_UPDATE BADI, as it can be unreliable. Instead, consider using the MRM_WORKFLOW_AGENTS BADI; this approach provides better control over the timing of message visibility and allows you to intercept the document before it undergoes final processing. I’ve found success with the MV45AFZZ user exit as well, but it’s crucial to manage the MESSAGES table correctly. Ensure your messages are populated accurately and that they process during PAI rather than at save time. Also, check that your message type is set to ‘W’ for warnings, and confirm that they aren’t suppressed in the OMRQ customization settings. The issue you mentioned regarding dialog mode may indicate a timing problem, which seems to be a central issue here.

Been there! Switch to the MR_DOCUMENT_CHECK user exit instead of the badi - it’ll catch validation at the right moment and your warnings will actually appear. Don’t use STORE_MESSAGE in dialog mode, just go with regular MESSAGE statements.

CHANGE_AT_SAVE runs too late for messages to display properly. Use the CHECK method in the same BADI instead - it fires during validation when users can actually see your messages. I’ve done similar MIRO customizations and CHECK gives you way better control over when and how messages appear. Double-check your message class setup in SE91 and make sure the message type’s correct. With CHECK, your warnings will show up consistently whether you’re using standard MESSAGE statements or STORE_MESSAGE.

Your timing issue happens because CHANGE_AT_SAVE runs after the screen already processed the user input. I hit the exact same problem when building custom validations in MIRO transactions. Switch to using the FILL method in your INVOICE_UPDATE BADI instead of CHANGE_AT_SAVE. FILL triggers during document prep when the system can still show messages to users properly. Your code looks right, but you’re just executing it at the wrong point for message display. FILL gives you access to invoice data early enough for validation while keeping the screen responsive for warnings. Also check your message class config in SM30 - make sure it allows warning messages in foreground processing.

you might wanna try the MRM_WORKFLOW_AGENTS_DETERMINE badi instead. I had the same issue and it works way better for showing msgs in MIRO. Also, check if your message type is ‘W’ and not ‘E’ - that could mess up the display too.