10-07-2009 3:14 AM
hi all,
My requirement is to give error message in ME22n when values entered manually in item overview, ie., EKES-ebtyp = 'LA' and EKES-vbeln = space as ' NO MANUAL LA ENTRY IS ALLOWED' and PO should not be posted.
i found the badi for this 'ME_PRUCHDOC_POSTED' and it shows the error message also. but it is getting posted though it has error message.
method if_ex_me_purchdoc_posted~posted .
types: im_ekes type standard table of mmpr_uekes.
data: wa_ekes like line of im_ekes.
INCLUDE mm_messages_mac.
loop at im_ekes into wa_ekes.
if wa_ekes-ebtyp = 'LA' and
wa_ekes-vbeln = space.
mmpur_message_forced 'E' 'ZXX' '002' text-002 '' '' ''.
endif.
endloop.
endmethod.
i searched in sdn and found another badi like 'ME_PROCESS_PO_CUST' and 'CHECK' method. but i dont know what to write in that to stop the posting. i have liitle knowledge in oops. so please help me.
Does anybody faced this kind of issue - could help me???
Regards,
Sakthi Sri.
10-09-2009 11:22 AM
I think your BAdI is simply executed too late. Here's one way that should work, but please note that this might not be optimal (didn't quite check out other possibilities): Use EXIT_SAPMM06E_012, which can be utilized to implement customer data checks. You'd still need to figure out though, how to distinguish between "legal" additions of confirmation and those that you don't want. Also, since the exit doesn't contain the confirmation table information from EKES, you could call function module ME_CONFIRMATION_TABLES, which will return any new EKES entries in table parameter XEKES (KZ='I').
Hope this helps, harald
10-09-2009 11:22 AM
I think your BAdI is simply executed too late. Here's one way that should work, but please note that this might not be optimal (didn't quite check out other possibilities): Use EXIT_SAPMM06E_012, which can be utilized to implement customer data checks. You'd still need to figure out though, how to distinguish between "legal" additions of confirmation and those that you don't want. Also, since the exit doesn't contain the confirmation table information from EKES, you could call function module ME_CONFIRMATION_TABLES, which will return any new EKES entries in table parameter XEKES (KZ='I').
Hope this helps, harald