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/user exit for me22n - disable/grey out field quantity (MEPO1211-MENGE)

Former Member
0 Kudos

Dear all SAP gurus,

When changing PO (ME22N), I need to disable (grey out) the quantity field on item (MEPO1211-MENGE), when all scheduled quantity is already received (EKET-MENGE = EKET-WEMNG).

Have tried using LMEIGICJI and Handle_event method in CL_SCREEN_VIEW_MM. But still doesn't go to the screen that wants to be disabled.

Tried using BADI ME_PROCESS_PO_CUST, but couldn't find how to disable the quantity field.

(IF_EX_ME_PROCESS_PO_CUST~FIELDSELECTION_ITEM only works for custom field).

Please kindly advise

thanks in advance

4 REPLIES 4

Former Member
0 Kudos

Hi Ahmad,

No need of ABAP, follow this IMG Path.

Material Management -> Purchasing - Purchase Order -> Define Screen Layout at Document Level

After Executing it . Choose ME22 from list and then choose display icon.

than double click Quantity and Price here uncheck opt. Entry and check display.

save your work.

Hope this works.

Regards

Ahsan

0 Kudos

thank you for the answer Ahsan,

But I don't want to disable the field all the time.

I only want to disable the field if the GR quantity is already equal to scheduled quantity. Is it possible to include some ABAP code in that IMG path?

thank you

0 Kudos

Hi Ahmad,

It will be lot difficult to disable a quantity field in given scenario.

However you can do it easily by displaying error message. Consider this solution

Write a code in BADI ME_PROCESS_PO_CUST you are already using; that check if PO QTY >= GR Qty and TCODE = ME22N throw error message "GR Quantity Already Exceeds Schedule Quantity" on save PO event.

Regards

Ahsan

0 Kudos

Exactly, Ahsan.

That's what I am doing now.

I also use set_data to refer back to old value, and just give warning message.

Thanks Ahsan