09-25-2007 2:23 PM
Hi all,
I'm looking for a badi for partner function in trx ME21N, ME22N.
In the tab Partners of the header of PO there is a table with partner function.
Any ideas?
thanks
enzo
09-25-2007 6:43 PM
Hello Enzo
The BAdI you are looking for is (most likely) <b>ME_PROCESS_PO_CUST</b>.
If you want to check data then the method of choice <b>IF_EX_ME_PROCESS_PO_CUST~CHECK</b> (<i>closing check</i>).
The CHECK method provides you with IM_HEADER (IF_PURCHASE_ORDER_MM). If you look at the implementing class CL_PO_HEADER_HANDLE_MM you have a method IF_PURCHASING_DOCUMENT~GET_PARTNERS available.
Please search the SDN forums for postings related to <b>ME_PROCESS_PO_CUST</b>. I have posted several answers to this topic.
Briefly, here is the way to go:
method IF_EX_ME_PROCESS_PO_CUST~CHECK.
DATA:
ls_header TYPE MEPOHEADER,
lt_partners TYPE MMPUR_PARTNER_ALL_TAB,
ls_partner LIKE LINE OF lt_partners,
lo_po_doc TYPE REF TO IF_PURCHASING_DOCUMENT.
ls_header = im_header->get_data( ). " header details
lo_po_doc ?= im_header. " casting to purchase document
lt_partners = lo_po_doc->get_partners( ).
LOOP AT lt_partners INTO ls_partner
WHERE ( parvw = '..'
AND parno = ls_header-lifnr. " vendor
EXIT.
ENDLOOP.
IF ( syst-subrc = 0 ).
" partner = vendor -> do something, e.g.
ch_failed = 'X'.
ENDIF.
endmethod.
Regards
Uwe
09-25-2007 3:50 PM
Hi
what for you need a BADI
you can straight away fetch the Partners data from <b>EKPA</b> table using the PO number
Regards
Anji
09-25-2007 4:18 PM
The require is to make unable the user to put as partner the vendor of the PO.
So I need to check the partner and validate it.
I work on ECC 6.0 and I found some enhancement point that, may be, can help me.
thanks
enzo
09-25-2007 6:43 PM
Hello Enzo
The BAdI you are looking for is (most likely) <b>ME_PROCESS_PO_CUST</b>.
If you want to check data then the method of choice <b>IF_EX_ME_PROCESS_PO_CUST~CHECK</b> (<i>closing check</i>).
The CHECK method provides you with IM_HEADER (IF_PURCHASE_ORDER_MM). If you look at the implementing class CL_PO_HEADER_HANDLE_MM you have a method IF_PURCHASING_DOCUMENT~GET_PARTNERS available.
Please search the SDN forums for postings related to <b>ME_PROCESS_PO_CUST</b>. I have posted several answers to this topic.
Briefly, here is the way to go:
method IF_EX_ME_PROCESS_PO_CUST~CHECK.
DATA:
ls_header TYPE MEPOHEADER,
lt_partners TYPE MMPUR_PARTNER_ALL_TAB,
ls_partner LIKE LINE OF lt_partners,
lo_po_doc TYPE REF TO IF_PURCHASING_DOCUMENT.
ls_header = im_header->get_data( ). " header details
lo_po_doc ?= im_header. " casting to purchase document
lt_partners = lo_po_doc->get_partners( ).
LOOP AT lt_partners INTO ls_partner
WHERE ( parvw = '..'
AND parno = ls_header-lifnr. " vendor
EXIT.
ENDLOOP.
IF ( syst-subrc = 0 ).
" partner = vendor -> do something, e.g.
ch_failed = 'X'.
ENDIF.
endmethod.
Regards
Uwe
09-26-2007 4:00 AM
BAPI-step by step procedure
http://www.sapgenie.com/abap/bapi/example.htm
list of all BAPI's
http://www.planetsap.com/LIST_ALL_BAPIs.htm
Rewards if useful......
Minal