Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with BADI ME_PROCESS_PO_CUST~PROCESS_HEADER

0 Kudos

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

3 REPLIES 3

Mithun_Kumar
Active Participant

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.

raymond_giuseppi
Active Contributor
0 Kudos

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.

sharprabs
Participant
0 Kudos

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