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: 

ME21N / ME22N - User exit name to make tax code (MWSKZ) field mandatory

Former Member
0 Kudos

Hi,

Transaction Codes: ME21N / ME22N

I want to make tax code MWSKZ field mandatory for specific purchase orders types and specific company codes.

Can anyone please tell me the name of user exit / BADI availiable for that.

Regards,

Ajitrao

4 REPLIES 4

Former Member
0 Kudos

Hello,

the tax code is in the tab inovice ,

see there are somany exit for this this tcode i am unble to say that just keep break-point in every exit and run the tcode when u enter any value in taxcode check wch exit is truggering then u can write the code there.

thank u

santhosh

0 Kudos

follow this sytax....

  • LOOP AT it_itab INTO wa_itab.

*

  • IF sy-uname = wa_itab-uname.

*

  • IF screen-name = 'VBAK-LIFSK'.

  • screen-input = 1.

  • MODIFY SCREEN.

  • ENDIF.

*

  • IF screen-name = 'VBAK-FAKSK'.

  • screen-input = 1.

  • MODIFY SCREEN.

  • ENDIF.

*

  • ENDIF.

  • ENDLOOP.

*

*

  • IF screen-name = 'KOMV-KBETR'.

  • screen-input = 0.

  • MODIFY SCREEN.

  • ENDIF.

Former Member
0 Kudos

Hi,

You can use BADI ME_PROCESS_PO_CUST Method PROCESS_ITEM.

Remember to include INCLUDE mm_messages_mac in your method to display errors in the gui.

The advantage of using this method over the screen modification is that BADI will not allow a save of the PO, and this check will also work if you use BAPIs (BAPI_PO_CREATE, BAPI_PO_CHANGE). The screen mods will not work in the BAPIs.

SAMPLE CODE

INCLUDE mm_messages_mac.

data: lv_current_item TYPE MEPOITEM.

lv_current_item = im_item->get_data( ).

if lv_current_item-MWSKZ is initial.

im_item->invalidate( ).

mmpur_message_forced 'E' 'ZZ' '999' '' '' '' ''.

endif.

You can get the header data and make checks on Company codes etc....

Edited by: Serge on Nov 12, 2008 9:55 AM

0 Kudos

Thanks for the help.

Ajitrao