I’m working on custom validation logic for MIRO transaction using BADI MRM_HEADER_CHECK. When I detect that a reference number is already in use, I need to show an error message but still allow users to edit certain fields.
The problem is that when I display an error message with type E, all fields become disabled and users cannot make corrections. I need to keep two specific fields active so users can fix their input.
Here’s what I tried:
- Using
MESSAGE <text> TYPE 'S' DISPLAY LIKE 'E'
but it doesn’t work properly - Adding
LOOP AT SCREEN
logic in my BADI but it doesn’t recognize the field names I want to control - The screen number shows as 6000 when I check
SY-DYNPRO
I cannot modify the standard SAP code outside my BADI implementation like PAI/PBO modules or field chains:
CHAIN.
FIELD: input1, input2, input3.
MODULE validation_check.
ENDCHAIN.
My current BADI implementation looks like this:
*Access the document header data
ASSIGN ('(SAPLMR1M)INVOICE_HEADER') TO <lv_header_data>.
IF <lv_header_data>-REFERENCE_NUM = lv_existing_ref.
MESSAGE lv_error_text TYPE 'E'.
ENDIF.
Is there a way to show the error message while keeping selected fields editable? Any suggestions would be helpful.