cancel
Showing results for 
Search instead for 
Did you mean: 

Change Vendor Partner Function

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member183819
Active Contributor
0 Kudos

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 .

Former Member
0 Kudos

What code did you use to change the partner function in the doc change badi?

Former Member
0 Kudos

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[].

Former Member
0 Kudos

Have you looked into the BAdI: BBP_CREATE_BE_PO_NEW

Former Member
0 Kudos

No, I haven't. But I was hoping to achieve this via SC Change. Guess I'll have to try the option you've recommended.