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: 

BAdI ME51N

Sm1tje
Active Contributor
0 Kudos

Hi all,

I have a requirement to check the purchase order group for all items in transaction ME51N. All items should have the same purchase order group (EKGRP). If this is not the case an error message should be issued. I perform a check on the items via method PROCESS_HEADER of interface IF_EX_ME_PROCESS_REQ_CUST (BAdI definition ME_PROCESS_REQ_CUST). This method is called when pressing <ENTER> after adding a new item and it works just fine. Also, after adjusting the purchase order group, the message (header level) is deleted again. So far so good.

However, the problem I have is when saving a Purchase Requisition and not all purchase order groups for all items are the same. When saving method CHECK is called and an error message is issued. The requisition cannot be saved and exporting parameter CH_FAILED is set. The message is displayed on header level. So, now after adjusting the purchase order groups, I would like for the message to be deleted so the user knows everthing is OK. I can't get this to work properly. After changing the order item purchase groups so they all match, the message is still there (red light / button on screen header level).

Is there a way to achieve that the message is deleted after changing the purchase order groups?

I issue the messages via: CL_MESSAGES_MM=>CREATE.

Kind regards,

Micky.

1 REPLY 1

Sm1tje
Active Contributor
0 Kudos

Cleaning up my (unresolved) questions.