Skip to Content

Display error message in EXIT_SAPMM06E_016 and stay in same screen without clearing the data entered

Jan 19, 2017 at 02:28 PM


avatar image

Dear experts,

I need to add custom checking in for the line item entered for the scheduling agreement created/changed using ME31L/ME32L. I've add coding in exit_sapmm06e_016 as follows and it seems to work but it will clear the entire line item that is being checked if the error message is issued.

How can I display the error message while keeping the entered data unchanged in the same screen. Or if there is any other BAdI or user-exit that I can use for the purpose.



data: tmp_netpr type eine-netpr.

if i_ekko-bsart = 'LP'.    
  clear tmp_netpr.
  if i_ekpo-pstyp = '2'.   
    select single netpr into tmp_netpr
                        from eine
                       where infnr = i_ekpo-infnr
                         and esokz = '2'                 
                         and werks = i_ekpo-werks    
                         and loekz ne 'X'            
                         and prdat ge sy-datum.      
    if tmp_netpr le 0.
      message 'Price not found' type 'W' display like 'E'.
        leave screen.
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Nic Teunckens Jan 19, 2017 at 03:25 PM

This UserExit is a so-called "PBO"-Exit, used for passing Custom fields and the like. When you Raise Error-Msg here, this will result in loss of data (your current line). Try it's counterpart "PAI" "EXIT_SAPMM06E_017" to validate your data and raise a Message ...

Further, you might want to look into BAdI "ME_PO_PRICING_CUST" as an Alternative?

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Dear Nic,

Thanks for you suggestions.

I've tried the BAdI 'ME_PO_PRICING_CUST' by setting a break-point in the method PROCESS_KOMP but it seems ME31L is triggering the method, or it is not triggered after I've enter a line item in the overview screen and hit <Enter>. Anything I've missed?

As for the 'EXIT_SAPMM06E_017', it will also displayed message in the subsequent screen but not on the same overview screen that I've just entered the line item that is to be checked against.

Any idea how I can achieve to display the message in the same overview screen similar to the following.

Many Thanks,


me31l.jpg (103.2 kB)