11-12-2008 7:39 AM
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
11-12-2008 7:48 AM
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
11-12-2008 8:30 AM
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.
11-12-2008 8:49 AM
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
11-12-2008 10:36 AM