How can I allow some fields to remain editable after an error message in MIRO?

I’m implementing validation in the MIRO transaction through BADI MRM_HEADER_CHECK. When I trigger an error indicating that the ‘reference’ field has been reused, it results in an error message of type E. This action locks all fields on the screen, preventing the user from correcting the input.

I intend to display this error type to restrict user input on all fields, except for two specific ones highlighted in red. Here’s what I’ve attempted so far:

  • Using MESSAGE <msg> TYPE 'S' DISPLAY LIKE 'E' has not worked.
  • I’ve checked that the SY-DINNR variable equals 6000 at a breakpoint.
  • In my BADI code, the LOOP AT SCREEN does not show the fields I want to manipulate.
  • I cannot alter any code outside of my BADI, specifically within the PAI and PBO modules.

Here’s how my BADI is currently structured:

*Assigning the field values to process input.
ASSIGN ('(SAPLMR1M)RBKPV') TO <fs_rbkpv>.
IF <fs_rbkpv>-XBLNR = lwa_bkpf-xblnr.
  MESSAGE lc_message TYPE 'E'.
ENDIF.

I’m looking for any advice on how to keep certain fields editable after displaying the error message while working within the limitations of BADI. Thank you for your help!

TYPE ‘E’ messages fundamentally change how SAP screens behave, which is your problem here. Try a different validation approach in your BADI instead. Don’t raise the error right away - set a flag and use MESSAGE TYPE ‘S’ with red display style, then control field properties programmatically in a later screen modification. I’ve also seen people use the BADI’s export parameters to tell the calling program which fields should stay editable, but you’ll need to coordinate this with the transaction flow. Another option: use MESSAGE with DISPLAY LIKE ‘E’ but make sure you’re not setting sy-subrc values that trigger the field locking mechanism.

totally get u, those E messages can be a pain! maybe after showing the error, u can set specific fields to editable? just make sure ur logic isn’t locking them by mistake. good luck with it!