I need to show warning notifications 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 BADI code runs successfully.
I found out that after my BADI executes, the system runs this logic to check if messages should be displayed based on dialog mode:
IF result_code <> 0.
IF invoice_header-process_type NE dialog_constant.
MESSAGE ID message_id TYPE message_type NUMBER message_number
WITH text_var1 text_var2 text_var3 text_var4.
ELSE.
CALL FUNCTION 'STORE_MESSAGE'
EXPORTING
message_class = message_id
msg_type = message_type
text1 = text_var1
text2 = text_var2
text3 = text_var3
text4 = text_var4
msg_number = message_number.
ENDIF.
ENDIF.
Are there alternative user exits or enhancement spots where I can properly display warning messages to users in MIRO?
Been there. SAP’s message handling in MIRO is a nightmare when timing’s off.
I’ve found automation beats fighting SAP’s internal flow. Instead of forcing warnings into MIRO at the right moment, pull the validation logic out completely.
Run automated checks before invoices hit MIRO. Validate everything upfront and either block bad invoices or send warnings via email or Slack.
Technically, use RFC calls to pull invoice data, run your validation rules, then handle messaging however works for your users. No timing issues or dialog mode headaches.
This works better because users get warnings when they can actually fix things, not buried in some transaction screen they’ll miss.
Latenode handles SAP connectivity and workflow logic perfectly for this setup. Way cleaner than wrestling with BADIs and enhancement spots.
Check enhancement point MRM_WORKFLOW_AGENTS_DET or try BADI MRM_VALIDATOR instead. I hit the same issue with messages not showing up in dialog mode. The trick is making sure your message handling respects the process_type field. In foreground mode, the system wants messages stored, not displayed directly. Also check that your BADI sets the right message type and populates result_code properly. Sometimes it’s not the enhancement point - it’s how you’re passing message parameters to SAP’s standard message framework.
This is a common issue with MIRO enhancements. The CHANGE_AT_SAVE method in INVOICE_UPDATE BADI runs too late - messages won’t display properly at that point. I’ve hit this same problem before. Try using enhancement spot MRM_HEADER_CHECK instead. It triggers earlier during validation and actually respects dialog mode. Another option that’s worked for me is the MRM_VALIDATION enhancement - lets you add custom validation with proper message handling. Bottom line: your messages need to fire when the system can still talk to the UI.
The timing’s your problem. CHANGE_AT_SAVE runs too late - MIRO’s already decided how to handle messages by then. I hit this same issue with purchase order validations. Try MRM_ITEM_CHECK instead. It fires during item validation before the system locks down message processing, so warnings actually show up in dialog mode. I also had good luck with MRM_ACCOUNTING_CHECK - it runs during accounting document generation but still lets users see warnings properly. The trick is getting your enhancement to run before MIRO’s internal message logic takes over. Both spots I mentioned will respect that process_type checking from your code.
try the enhancement spot MRM_HEADER_CHANGED - it fires at the right time and handles dialog mode correctly. had the same issue with warnings not showing up, and this spot fixed it for me. just set the message type to ‘W’ instead of ‘E’.
have you looked into the user exit EXIT_SAPMM06E_005? it’s good for handling validation messages in MIRO. maybe give that a shot, it might do the trick for your warnings.