01-16-2014 6:45 AM
HI Experts,
In ME21N and ME51N,when user select Distribution account assignment (Distrib. on quantity basis/ Distribution by percentage), GR non-valuated (In Delivery tab) become checked automatically.
When select back Single account assignment, GR non-valuated will not be un-checked automatically. Do anyone know what user exit can be use to uncheck the GR non-valuated check-box automatically when select single account assignment?
I saw the same question in forum but there is not correct answer. Please help.
01-22-2014 8:32 AM
I've solved the problem myself by using following user exits.
ME51N:
User Exit : MEREQ001
Function Exit : EXIT_SAPLMEREQ_005
ME21N:
User Exit :MM06E005
Function Exit : EXIT_SAPMM06E_012
Add in following coding to prompt error message instead of uncheck the GR non-valuated checkbox automatic.
Coding for ME21N:
DATA: ls_itm(6) TYPE C.
LOOP AT tekpo WHERE knttp eq 'K' AND
vrtkz IS INITIAL AND
twrkz IS INITIAL AND
NOT weunb IS INITIAL.
MOVE tekpo-ebelp TO ls_itm.
SHIFT ls_itm LEFT DELETING LEADING '0'.
MESSAGE ID 'SU' TYPE 'E' NUMBER '000' WITH 'Item ' ls_itm 'GR non-valuated should not check.'.
ENDIF.
ENDLOOP.
Coding for ME51N:
DATA: itb_pr TYPE mereq_item,
wa_bapiret2 TYPE bapiret2.
IF im_req_item IS NOT INITIAL.
itb_pr = im_req_item->get_data( ).
IF itb_pr-knttp eq 'K' AND
itb_pr-vrtkz IS INITIAL AND
itb_pr-twrkz IS INITIAL AND
NOT itb_pr-weunb IS INITIAL.
wa_bapiret2-type = 'E'.
wa_bapiret2-id = 'SU'.
wa_bapiret2-number = '000'.
wa_bapiret2-message_v1 = 'GR non-valuated should not check.'.
APPEND wa_bapiret2 TO ex_messages.
ENDIF.
ENDIF.
01-16-2014 7:06 AM
Hi,
I think you can try with the BADI ME_PROCESS_PO_CUST
Method : PROCESS_ITEM
IF_PURCHASE_ORDER_ITEM_MM
GET_PREVIOUS_DATA
SET_DATA
01-16-2014 9:38 AM
Could you explain in more detail and provide some sample program. I'm not good in creating user exit. Thanks.
01-22-2014 8:32 AM
I've solved the problem myself by using following user exits.
ME51N:
User Exit : MEREQ001
Function Exit : EXIT_SAPLMEREQ_005
ME21N:
User Exit :MM06E005
Function Exit : EXIT_SAPMM06E_012
Add in following coding to prompt error message instead of uncheck the GR non-valuated checkbox automatic.
Coding for ME21N:
DATA: ls_itm(6) TYPE C.
LOOP AT tekpo WHERE knttp eq 'K' AND
vrtkz IS INITIAL AND
twrkz IS INITIAL AND
NOT weunb IS INITIAL.
MOVE tekpo-ebelp TO ls_itm.
SHIFT ls_itm LEFT DELETING LEADING '0'.
MESSAGE ID 'SU' TYPE 'E' NUMBER '000' WITH 'Item ' ls_itm 'GR non-valuated should not check.'.
ENDIF.
ENDLOOP.
Coding for ME51N:
DATA: itb_pr TYPE mereq_item,
wa_bapiret2 TYPE bapiret2.
IF im_req_item IS NOT INITIAL.
itb_pr = im_req_item->get_data( ).
IF itb_pr-knttp eq 'K' AND
itb_pr-vrtkz IS INITIAL AND
itb_pr-twrkz IS INITIAL AND
NOT itb_pr-weunb IS INITIAL.
wa_bapiret2-type = 'E'.
wa_bapiret2-id = 'SU'.
wa_bapiret2-number = '000'.
wa_bapiret2-message_v1 = 'GR non-valuated should not check.'.
APPEND wa_bapiret2 TO ex_messages.
ENDIF.
ENDIF.