How to keep specific fields editable after displaying error message in MIRO transaction?

I’m working on custom validation logic for transaction MIRO using the BADI MRM_HEADER_CHECK. When I detect that a reference number has been used before, I need to show an error message but still allow the user to edit certain fields to correct the issue.

The problem is that when I display an error message with type E, all fields on the screen become disabled and users cannot make corrections. I need to keep two specific fields active while blocking all others.

What I’ve tried so far:

  • Using MESSAGE <text> TYPE 'S' DISPLAY LIKE 'E' but this doesn’t provide the blocking behavior I need
  • Checking SY-DYNPR value which shows 6000 at breakpoint
  • Using LOOP AT SCREEN in my BADI code but it doesn’t show the field names I want to control

Constraints:

  • Must use error type E to block most fields
  • Cannot modify standard PAI/PBO modules or CHAIN statements
  • Solution must work within BADI implementation only

Current BADI implementation:

*Get input field values
ASSIGN ('(SAPLMR1M)INVOICE_DATA') TO <lfs_invoice>.
IF <lfs_invoice>-REF_DOC = lv_existing_ref.
  MESSAGE lv_error_text TYPE 'E'.
ENDIF.

Is there a way to selectively enable specific fields after showing an E-type message within the BADI scope?

i totally get it! those E-messages can be a pain. maybe instead of going for the error type, try a warning mesg. that way you can keep editing the fields you need. it’s not the cleanest fix, but sometimes ya gotta work with what you got. good luck!

This topic was automatically closed 4 days after the last reply. New replies are no longer allowed.