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-DYNPRvalue which shows 6000 at breakpoint - Using
LOOP AT SCREENin 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?