Trouble displaying warning in SAP MIRO

I’m trying to show a warning in SAP MIRO when certain info is entered. I set up the INVOICE_UPDATE BADI with the CHANGE_AT_SAVE method. But the warning isn’t showing up even though my BADI is called.

I found some code that checks if it’s in dialog mode before showing messages. Is there another way to make warning messages pop up for users? Here’s a similar code snippet I made:

IF result_code <> 0.
  IF invoice_type NE 'DIALOG'.
    CALL FUNCTION 'DISPLAY_MESSAGE'
      EXPORTING
        message_id   = msg_id
        message_type = msg_type
        message_text = msg_text.
  ELSE.
    CALL FUNCTION 'STORE_MESSAGE'
      EXPORTING
        message_id   = msg_id
        message_type = msg_type
        message_text = msg_text.
  ENDIF.
ENDIF.

Any ideas on how to fix this? Thanks!

hey lucasg, i had similar issue before. try using MESSAGE command instead of CALL FUNCTION. it works better for warnings in MIRO. also, make sure ur BADI implementation is active. sometimes that’s the culprit. good luck!