11-04-2017 6:21 AM
I am facing a strange problem while putting a validation in the process_header method of the BADI ME_PROCESS_PO_CUST.
I am using the PROCESS_HEADER method of the BADI ME_PROCESS_PO_CUST. I have written a validation on the PO vendor in the method. It works fine and restricts from saving the PO, but I am facing a issue with the error message. Whenever I enter wrong vendor and hit the enter button the custom message is displayed.... But if I enter the wrong vendor and press the save button directly, it doesn't display the custom error message, instead it shows a generic error message: "Header is still faulty" MEPO(002). I find it necessary to mention here that I am using the MACRO mmpur_message_forced to throw my error and using im_header->invalidate(). Please let me know if I am doing something wrong..... Thanks in anticipation
11-20-2017 5:07 AM
I think the better place to do this is in the method IF_EX_ME_PROCESS_PO_CUST~CHECK, instead of PROCESS_HEADER.
Try if it helps.
11-20-2017 7:13 AM
When the generic error is raised, if user clicks on the display message icon, is your message displayed in the list, look like standard behavior, did you also check your personal settings, look at message block.
11-20-2017 8:16 AM
You can restrict the message by the following.
IF sy-ucomm EQ 'MECHECKDOC' OR sy-ucomm EQ 'MESAVE'.
lt_items = im_header->get_items( ).
Regards
Sharada