cancel
Showing results for 
Search instead for 
Did you mean: 

convert prefered vendor to vendor

Former Member
0 Kudos

Hi all,

Our client want to convert the preferred vendor assigned by the requester into vendor the constraint is the total value of the shopping cart should be less or equal to $5000. right now i have managed to check at item level and convert prefered vendor to vendor. I tried many ways to do the check at the end of shopping cart (after adding all line items) and system is not allowing me to change the partner, has any one faced this scenario help me getting this done

Thanks in advance

suresh

Accepted Solutions (0)

Answers (1)

Answers (1)

yann_bouillut
Active Contributor
0 Kudos

Hi Suresh,

Here is the code to converts prefered to fixed vendor.

method IF_EX_BBP_DOC_CHANGE_BADI~BBP_SC_CHANGE .

Constants : c_vendor type BBP_PDS_PARTNER-PARTNER_FCT

value '00000019',

c_preferred_vend type BBP_PDS_PARTNER-PARTNER_FCT

value '00000039'.

Data : ls_partner type BBP_PDS_PARTNER.

*Read Table it_partner into ls_partner With key PARTNER_FCT = c_vendor.

*

*If sy-subrc NE 0.

Loop at it_partner into ls_partner

where PARTNER_FCT Eq c_preferred_vend.

Move c_vendor To Ls_partner-PARTNER_FCT.

Modify it_partner from ls_partner index sy-tabix.

Endloop.

*Endif.

et_partner[] = it_partner[].

ET_ORGDATA[] = IT_ORGDATA[].

ET_ITEM[] = IT_ITEM[].

ES_HEADER = IS_HEADER.

ET_ACCOUNT[] = IT_ACCOUNT[].

*break ybo

*IT_PARTNER

*ET_PARTNER[]

endmethod.

Kind regards,

Yann

Former Member
0 Kudos

yann,

Thank you for your reply,

I am able to change the prefered vendor to vendor when adding line items to shopping cart thru the same BADI and coding as u mentioned the problem is we need to check the total value of the cart at the end of adding all line items ( either at the time of check or order at the end ) i used the sy-ucomm but at that point system is not allowing to change the partner and tried DOC_SAVE_BADI also there also system is not allowing to change the partner.

thanks & regards

suresh