‎2009 Jul 07 10:09 AM
Hi All ,
Whenever a New PO is created against a WBS . I have to check if the value of this PO exceeds the total budet available for WBS .
Is there any BADI / BAPI / user exit where I can write my code and display my messages accordingly .
Thanks in advance ,
Regards ,
Ambar .
‎2009 Jul 07 10:10 AM
‎2009 Jul 07 10:26 AM
Hey
Thanks a lot for such a quick response . However , i couldnt make out much .
Can you please elaborate a little bit .
‎2009 Jul 07 10:31 AM
You can try something like this .
METHOD if_ex_me_process_po_cust~process_item .
DATA:l_if_header TYPE REF TO if_purchase_order_mm,
ls_header TYPE mepoheader,
lt_accounts TYPE purchase_order_accountings,
st_account TYPE purchase_order_accounting,
l_accounting TYPE REF TO if_purchase_order_account_mm,
ls_mepoaccounting TYPE mepoaccounting,
v_stufe TYPE ps_stufe,
l_text(100) TYPE c,
doctype TYPE bsart,
Compcode type bukrs,
docdate type ekko-bedat.
INCLUDE mm_messages_mac.
l_if_header = im_item->get_header( ).
ls_header = l_if_header->get_data( ).
doctype = ls_header-bsart . "NB
Compcode = ls_header-bukrs.
DOCDATE = LS_HEADER-BEDAT.
CHECK doctype NE 'UB'. "stock transport purchase order no restriction
lt_accounts = im_item->get_accountings( ).
LOOP AT lt_accounts INTO st_account.
l_accounting = st_account-accounting.
ls_mepoaccounting = l_accounting->get_data( ).
CHECK ls_mepoaccounting-ps_psp_pnr NE space.
SELECT SINGLE stufe FROM prps INTO v_stufe
WHERE pspnr = ls_mepoaccounting-ps_psp_pnr.
IF sy-subrc EQ 0.
CHECK v_stufe LE 3.
CONCATENATE 'WBS Element of Level greater than 3:'
'IN Item:' ls_mepoaccounting-ebelp INTO l_text.
mmpur_message_forced 'E' 'ME' '083' l_text ' ' ' ' ' '.
CALL METHOD im_item->invalidate( ).
ENDIF.
ENDLOOP.
ENDMETHOD.
‎2009 Jul 07 1:30 PM
hi,
badi me_process_po_cust contains the method process_item and process_header where u can put the validations whichever u want...
n in method check,u can provide appropriate messages.
regards
kanishak