on 08-21-2009 5:54 PM
Hello:
I am trying to change the vendor partner function using the Doc Change Badi (SC Change). But at the time of ordering the cart, I get an error message: Partner Function may not be changed. How do I resolve this problem? I have read through several threads on this forum which mention that it is possible to switch vendor from Preferred to Fixed by changing the Partner Function, but I have run into this issue. Please reply with your suggestions. Thanks.
You will have to work with partner function 00000039 which is the prefered vendor to move into the partner function 00000019.
In the BBP_DOC_CHANGE_BADI we provide the business partner data
through the IT_PARTNER interface table. the prefered vendor or desired
vendor has partner type 39, the regular supplier will have partner
type 19. a switch from 39 to 19 .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What code did you use to change the partner function in the doc change badi?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Robin:
Following is the code. We're calling the AVL FM to check the Preferred Vendor against the AVL for a given material group. If preferred vendor exists on the AVL, switch preferred to Fixed. Thanks for replying. Here goes...
LOOP AT i_item INTO wa_item WHERE del_ind = ''
AND catalogid = ''
AND itm_type <> 'LIMI'.
CLEAR: i_catid, i_vendor, i_bapiret,
i_catid[], i_vendor[], i_bapiret[].
wa_catid-cm_category_id = wa_item-category_id.
APPEND wa_catid TO i_catid.
CALL FUNCTION 'BBP_CM_F4_VENDORS_VL'
TABLES
it_category_guid = i_catid
et_vendors = i_vendor
et_messages = i_bapiret.
*>> Get preferred vendor for the item
READ TABLE i_prevend INTO wa_prevend WITH KEY p_guid = wa_item-guid.
IF sy-subrc = 0.
*>> Check if the preferred vendor is in the approved vendor list
READ TABLE i_vendor INTO wa_vendor WITH KEY partner_guid = wa_prevend-partner_no.
IF sy-subrc = 0.
*>> Change the preferred vendor to approved vendor
CLEAR lv_index.
READ TABLE i_partner INTO wa_partner WITH KEY p_guid = wa_item-guid
partner_fct = '00000039'.
IF sy-subrc = 0.
lv_index = sy-tabix.
wa_partner-partner_fct = '00000019'.
MODIFY i_partner FROM wa_partner INDEX lv_index TRANSPORTING partner_fct.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.
et_partner[] = i_partner[].
Have you looked into the BAdI: BBP_CREATE_BE_PO_NEW
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.