Warning notifications not showing in MIRO transaction using BADI implementation

I need help with displaying alert messages in the MIRO transaction when specific conditions are met. I’ve been using the INVOICE_UPDATE BADI with the CHANGE_AT_SAVE method, but the warnings don’t appear on screen even though my BADI code runs successfully.

After some debugging, I found that messages only show when the system runs in dialog mode. Here’s the code pattern I discovered:

IF return_code <> 0.
  IF invoice_type NE dialog_constant.
    MESSAGE ID message_id TYPE message_type NUMBER message_number
           WITH msg_var1 msg_var2 msg_var3 msg_var4.
  ELSE.
    CALL FUNCTION 'STORE_MESSAGE'
         EXPORTING
              message_class = message_id
              msg_type = message_type
              var1 = msg_var1
              var2 = msg_var2
              var3 = msg_var3
              var4 = msg_var4
              text_number = message_number.
  ENDIF.
ENDIF.

Can anyone suggest alternative user exits or enhancement points where I can properly show warning messages to users in MIRO?

Been there too. MIRO’s timing issues with warning messages are a nightmare, but there’s a better approach.

Skip the BADI timing headaches entirely. I built an automated validation system that catches problems before they reach MIRO.

Here’s what works: monitor invoice data as it flows in, run your validation checks, then send alerts or hold processing when you find issues. Users get clear notifications outside the transaction, and you avoid the ABAP message timing mess.

I used Latenode for the setup - created webhooks that connect to SAP. When invoices process, it grabs the data, runs validation logic, and either blocks the transaction or fires off alerts via email/Slack before users open MIRO.

This kills the dialog mode problems since you’re not fighting SAP’s transaction flow anymore. Better logging too, and you can tweak validation rules without touching ABAP.

had the same prob last year. use enhancement spot MRM_CHANGE_DOCUMENT at method CHECK_BEFORE_SAVE - it keeps dialog mode working better than the invoice_update badi. also make sure sy-calld is initial b4 you trigger messages. thatll fix the batch mode issues.

CHANGE_AT_SAVE runs too late for user interaction. Switch to CHECK_AT_SAVE instead - it runs during save validation and handles messages way better. I’ve had good luck with the MRM_WORKFLOW_AGENTS BADI using CHECK_INVOICE. It triggers earlier in posting and keeps the dialog context intact for warnings. You could also try MR_OUTPUT_CUST user exit - fires during document output prep when the system’s still in interactive mode, so messages work properly. Just remember to check SY-BATCH before throwing any messages or you’ll get dumps in background jobs.