Posted: Thu Oct 11, 2007 11:47 pm Post subject: Partner check
The FM you are looking for is (most likely) ME_PROCESS_PO_CUST.
If you want to check data then the method of choice IF_EX_ME_PROCESS_PO_CUST~CHECK (closing check).
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 ME_PROCESS_PO_CUST. I have posted several answers to this topic.
Briefly, here is the way to go:
Code:
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.
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.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.