Convert preferred vendor to fixed vendor

Hi,
I'm trying to convert a preferred vendor to fixed vender using BAdI BBP_DOC_CHANGE_BADI.
I use the following coding:
  LS_HEADER           = ES_HEADER.
  LT_ITEM[]           = ET_ITEM[].
  LT_ACCOUNT[]        = ET_ACCOUNT[].
  LT_PARTNER[]        = ET_PARTNER[].
  LT_ORGDATA[]        = ET_ORGDATA[].
  LT_HCF[]            = ET_HCF[].
  LT_ICF[]            = ET_ICF[].
  if sy-tcode = 'BBPSC08'.          "Completion Workflow
item data
    loop at et_item into ls_item.
Jörg Sina, IP#DDDDDDDD, TA:
Section: Put your BBP_SC_CHANGE logic here
      READ TABLE lt_partner INTO ls_partner
  WITH KEY partner_fct = '00000039'                   "Partnerfkt. '39' = wunschlieferant
           p_guid = ls_item-guid.
      lv_idx = sy-tabix.
      if sy-subrc = 0.
        ls_partner-partner_fct = '00000019'.                 "Partnerfkt. '19' = fester lieferant
       append ls_partner to lt_partner.
        modify lt_partner index lv_idx from ls_partner.
     ls_msg-p_guid = ls_item-guid.
     ls_msg-msgty = 'I'.
     ls_msg-arbgb = 'ZEBP'.
     ls_msg-msgnr = '011'.
     append ls_msg to et_msg.
      endif.
    endloop.
  endif.
*Interface: Move Local Data to Export/Changing Interface
  ES_HEADER           = LS_HEADER.
  ET_ITEM[]           = LT_ITEM[].
  ET_ACCOUNT[]        = LT_ACCOUNT[].
  ET_PARTNER[]        = LT_PARTNER[].
  ET_ORGDATA[]        = LT_ORGDATA[].
  ET_HCF[]            = LT_HCF[].
  ET_ICF[]            = LT_ICF[].
When the partner is changed from 39 to 19 the following message appears:
BBP:PD(144): Partner function may not be changed
I've tried out the coding given as example in several postings in this forum..
Maybe anybody can help.
Regards
Joerg

Hi,
Here is a sample code i used and it works.
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

Similar Messages

  • Convert prefered vendor to vendor

    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

    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

  • Changing preferred vendor to fixed vendor in SRM PO- no currency conversion

    Hi All,
    We are on SRM_SERVER 550, SP11, ECS scenario.
    Users create carts where they enter preferred vendor.
    After approval we found that the PO's were created only in "Held" Status.
    So we did a conversion of the preferred vendor (PF 39) to Fixed vendor (PF 19) during PO creation using BBP_DOC_CHANGE_BADI- BBP_PO_CHANGE.
    We also implemented BBP_GROUP_LOC_PO,GROUP_PO so that all items with same preferred vendor are grouped into a single PO.
    We observed that PO is now getting created in ordered status, where the preferred vendor is getting converted to fixed vendor as per our code change. But we also found a problem- that the line item price doesnt get converted to Vendor order currency after the Po is created. For ex: If line item price is 10 GBP and Vendor order currency is EUR, the line item price in the PO shows 10 EUR. The currency conversion fro GBP to EUR does not happen.
    This does not happen for catalog items/PO's where the cart comes with a fixed vendor (PF 19).
    So there surely seems to be something missing in our code for converting Preferred vendor to fixed vendor which is preventing/not converting the currency as well.
    Please find below the code we are using in DOC_CHANGE_BADI for PO, is there any step in this which is causing the currency conversion to be skipped?
    CONSTANTS:C_FIXED_VENDOR   TYPE BBP_PDS_PARTNER-PARTNER_FCT
                           VALUE '00000019',
               C_PREFERRED_VEND TYPE BBP_PDS_PARTNER-PARTNER_FCT
                           VALUE '00000039'.
       READ TABLE ET_PARTNER INTO LS_PARTNER WITH KEY
                             P_GUID      = IS_HEADER-GUID
                             PARTNER_FCT = C_FIXED_VENDOR.
       IF SY-SUBRC NE 0.
       READ TABLE ET_PARTNER INTO LS_PARTNER WITH KEY
                             P_GUID      = IS_HEADER-GUID
                             PARTNER_FCT = C_PREFERRED_VEND.
        IF SY-SUBRC EQ 0.
          CLEAR IDX.
          IDX = SY-TABIX.
          MOVE C_FIXED_VENDOR TO LS_PARTNER-PARTNER_FCT.
       MODIFY ET_PARTNER INDEX IDX FROM LS_PARTNER TRANSPORTING PARTNER_FCT.
       ENDIF.
       ENDIF.
    Regardas,
    Srivatsan

    there is nothing in your code which prevents the conversion between the two currencies,
    it can be the following reason
    1) system as standard is not performing the conversion.
    2) conversion factors are not maintained (or) conversion factors are maintained and the expiry date for the conversion factors has passed.

  • How to change Preferred Vendor to Fixed Vendor in SC - SRM-5.0

    SRM Experts,
    We are using SRM 5.0, ECC 6.0 and PI-7.0.
    We are using classic scenario in SRM. When user selects the vendor with Outline agreement in SOS tab then SC creates PO in backend system because it has Fixed Vendor otherwise SC creates PR in the backend system.
    We have a new requirement in SRM to create PO instead of PR in the backend system if Purchasing Org=5xxx and total value of SC is less than USD 5XXX and Vendor is a Preferred Vendor in the SC.
    Do I need to use the Check Document BADI to check the total value of the SC and to check whether it is a Preferred Vendor and then in the Change Document BADI, change the value from Preferred Vendor to the Fixed Vendor before SC is saved?
    OR someone has any other suggestions on this?
    Which BADI is called first Check Document or Change Document before saving the SC?
    Thanks in advance!
    MP

    Hi Atul/Disha,
    I sent you my code and problem in detail at your email address.
    Here is the requirement for Changing Preferred Vendor to Fixed Vendor. We are on SRM 5.0 and using classic scenario. I am new to SRM world. I also checked the note- 962474 in our system and it has been applied. We upgraded to SRM 5.0 in Oct-07.
    1.     My client has customization for sources of supply tab. It shows the vendor information in SOS tab based Product category, Plant and Purchasing group selected in the SC. If SC contains Vendor with Outline agreement then SC creates PO in the backend system. So in Change BADI logic for new enhancement of converting Preferred vendor into Fixed Vendor should not change anything in the SC using Outline agreement.
    2.     We have created Custom table-zsrm_fix_vend with fields, purchasing group, company code, currency and total value.
    3.     We need to convert the preferred vendor into fixed vendor
        if the SC’s 1st line item purchasing group = zsrm_fix_vend-ekorg and
                 SC’s 1st line item company code = zsrm_fix_vend-bukrs     and
               SC’s currency = zsrm_fix_vend-currency                   and
               SC’s Total value less than(<)zsrm_fix_vend-totalvalue.
    My testing results and problems…
    1.     When I create a new SC with less value than totalValue from the custom table, change document BADI is changing the preferred vendor into fixed vendor and it is creating PO in the backend system. So this is working as expected.
    2.     When I create a new SC with greater value than totalValue from the custom table, change document BADI is NOT changing the preferred vendor into fixed vendor and it is creating PR in the backend system. So this is working as expected.
    3.     When I use Outline agreement in the SC, it is creating PO in the backend so change BADI logic is not affecting this existing functionality which is good.
    4.     Problem - When I copy a new SC from existing SC with less value than totalValue from the custom table and then changing the amount with the greater value than the custom table, change document BADI is not changing the fixed vendor to the preferred vendor and when I click on sources of supply tab - it is giving me an error “Partner Function may not be Changed” and it exits me to main shopping cart screen.
    5.     Problem - When I copy a new SC from existing SC with greater value than totalValue from the custom table and then changing the amount with the lessser value than the custom table, change document BADI is not changing the preferred vendor to the fixed vendor and when I click on sources of supply tab - it is giving me an error “Partner Function may not be Changed” and it exits me to main shopping cart screen.
    6.     When I copy the SC with Outline Agreement and change the amount it works all the time it is not affected by the change document BADI which is good.
    Please help me to resolve this issue.
    Millions thanks to you!
    MP

  • 'Preferred Vendor' and 'Vendor' in Purchase Order Partner Overview screen

    Hello All,
    Please can you provide me with some assistance to the following issue we have on our SRM 5.0 system......here goes.....
    In 'Define Sourcing for Product Categories config' , we have set the value to 'Sourcing is never carried out'.  Now, when we manually assign a Supplier to the Cart and have it automatically converted to a Purchase Order, the Purchase Order is created but only in Held Status as only the 'Preferred Vendor' in the PO Partner Overview screen is populated with the other 'Vendor' field remaining blank and requiring manual intervention by our users
    Please can someone explain how we are able make the system to always have the 'Vendor' field populated, therefore not needing any manual intervention.
    Your help would be appreciated,
    Thanks
    Steve Walsh Jnr

    Hi
    Implement the following method , in which you will force prefer vendor
    to fixed vendor for all applicable sc.
    IF_EX_BBP_DOC_CHANGE_BADI~BBP_SC_change.
    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 should create a po instead of
    incomplete po.
    BR
    Muthu

  • Vendor list and preferred vendor

    Hi,
    We are using classic scenario and currently, all carts are intercepted by the purchasing department so purchase requisitions are manually converted into POs.
    We want to implement vendor lists but SRM assigns any vendor chosen from a vendor list as ‘fixed’, which means it will convert to a PO once the shopping cart is fully approved.
    Is there a BADI I can use to change the vendor from 'Fixed' to 'preferred'. Can ‘BBP_DOC_CHANGE_BADI’ be used to do so or does it only works when changing a 'preferred' vendor into a 'fixed' vendor?
    Thanks

    Hi
    Yes... we have done this long back successfully..
    The BADI - BBP_DOC_CHANGE_BADI can be easily used...
    Also, you can look for BBP_SOS_BADI...
    Do let me know, incase you face any problems.
    Regards
    - Atul

  • Automatic PO with preferred vendor

    Hi all.
    We Have SRM 5.0 ECS
    I need to generate an automatic PO from a SC, this contains like source of supply the Preferred Vendor and price, in this type of purchase I do not use contracts
    This is possible?

    Hi Raul,
    As it is clear from your statement that you are not using Contracts and you are talking about Free Form text Shopping Carts where you can enter Prefferred Vendor. You need to implement Doc Change BAdI to convert this preferred Vendor to fixed Vendor so that after approval Shopping Cart creates a PO.
    Here is the sample code we had implemented for the very same purpose
    BAdI BBP_DOC_CHANGE
    METHOD if_ex_bbp_doc_change_badi~bbp_sc_change.
    data: ls_partner type BBP_PDS_PARTNER.
    loop at et_partner into ls_partner.
        if ls_partner-partner_fct = '00000039'. "Preferred vendor
          ls_partner-partner_fct = '00000019'.  "Fixed vendor
          modify et_partner from ls_partner.
       endif.
      endloop.
    ENDMETHOD.
    Thanks
    Shrini
    Award full points if this helps.

  • Preferred Vendor Message

    We are using SRM 7.0.  I have a user that is getting the following error message when they are trying to order their cart:
    Enter no more than one partner of type Preferred Vendor
    I see the vendor on the line item.  But, when I look in the SRM GUI under BBP_PD, the preferred vendor is listed twice.  I have tried to replicate the issue but I'm not exactly sure what the user may be doing.  Does anyone have any suggestions as to why this message would be appearing and how to fix it?
    We have a program that enters the preferred vendor on the other lines if there are multiple lines so that the user does not have to enter it each time.  But, I have not heard of this issue from any other users.

    On the initial screen in BBP_PD, the partner section shows the following:
    0000000001 00000039       Preferred Vendor               47C3756071100CCEE100000080F91715    
    0000000001 00000039       Preferred Vendor               47C3756071100CCEE100000080F91715    
    I checked both entries and notice the following difference between them:
    MAINPARTNER                                                                                Main Partner (For Ambiguous Partner Functions)               (''=Incorrect)
    For the second entry, there is an X for MAINPARTNER, where X is = true.
    For the other lines on the cart, preferred vendor only shows up once on the initial screen, and the mainpartner has X in the field.
    Not sure if this helps or not.
    Monique

  • Preferred Vendor & Vendor Issue in SC

    Hi Friend's
    Currently i am working with Extended Classic Scenario's
    Shopping Cart was created with both the field (Preferred Vendor & Vendor) Here Vendor Filed normally creates from the catalog But
    Whenever user copied the same shopping carts and user can able to create shopping cart with Vendor & Preferred vendor filed getting updated
    Note:
    Either one filed should be updated
    Can any one tell me what would be the reason?
    Thanks
    Shrini

    Yes shrini. it comes due to OLD PURCHASE ORDER templates.
    if you  dont want this. end user must have delete the vendor before he order a shopping cart source of supply.
    indeed it confuses business too.
    step 1 :- create a sc with prefered sos
    step 2:- sc goes to cockpit
    step 3:- buyer hold a car in the cockpit now you get parter function 19 in bbp_pd 19 .and supplier comes int basic data
    step 4:- create a PO from cockpit
    sptep 5:- go to OLD Purchase order templates and now u see vendor picked as FIXED vendor .
    step 6:- PO created
    stpe 7:- check sc sos VENDOR XXX and preferred VENDOR XXXX.
    this manner you might confused
    Thanks
    Muthu
    Thanks
    Muthu

  • Preferred Vendor

    Hi All,
    I am trying to set some of the Vendors as preferred Vendor for a Product category. Could you please help me how to do this? Whats the t-code for this?
    Thanks in advance for your reply.
    Regards

    Hello,
    To be clear...
    As written by Muthuraman, vendor list gives fixed vendors for product categories.
    You want to have a preferred vendor for a list of product categories. So, there is no transaction to answer to your request.
    One alternative, is to use vendor list and then implement BAdI i mentioned.
    Regards.
    Laurent.

  • Preferred Vendor in SRM 5.0

    Hi Gurus,
    The set up is SRM 5.0 Classic scenario, the requirement is when user creates a SC , he should be able to select vendors in the preferred vendor field under source of supply and a PO should be created once this SC is approved.
    There is a restricted  list of vendors which should only be available in f4 help of Preferred vendors.
    Question is How to set up this? I have already replicated these vendors in SRM system
    Thanks,
    SAP PR

    Hi
    You can do it by BBP_doc_change_BADI for bus2121 by swaping partner function 39 to 19.
    39 - preferred vendor
    19 - fixed vendor
    Muthu

  • Multiple Preferred Vendors in Source of Supply -Shopping cart

    Hi SRM Gurus,
    While Creating Shopping Cart, the requestor need to assign multiple (more than one) preferred vendors as Sources of Supply.
    I could able to choose only one preferred vendor. How can we choose, more than one preferred vendor.
    Thanks in advance,
    Ramkumar

    Hi
    SRM does not allows this functionality to have multiple fixed vendors for a single line item.
    There can be multiple preffered vendors displayed in the search results. But at a time, only one vendor can be assigned to a line item as a fixed vendor.
    In SRM system, even if you programmatically using BADI - BBP_DOC_CHANGE_BADI, try to assign more than one vendors to aline item, you cannot order that shopping cart further.
    <b>So, not possible.</b>
    Hope this will help.
    Regards
    - Atul

  • Preferred vendor field

    Hello All,
    We are in SRM 5.0 with SRM server 550 on SP11, we are going for BR deployment.
    In the basic data when the vendor number is entered in Preferred vendor field, the system doesn't holds the vendor and it disappears and gives the error message ' Please enter vendor'
    Any pointers for resolving this issue.
    Rgds,
    Madhan

    Hi Madhan
    did you enter a vendor in source of supply field
    PREFERED VENDOR - DID YOU SEARCH A VENDOR ?
    IN BASIC DATA --not . IN THE BASIC DATA VENDOR WILL BE STICKED AFTER YOU ASSIGN A FIXED SOURCE OF SUPPLY.
    MUTHU

  • Preferred Vendor serch help does not retrieve values

    Hi,
    SRM 5.0, Classic scenario
    I have successfully replicated the Vendors. But I don't see the vendors in the "search help" when I create a SC.
    It seems to me that I have implement the OSS note 845883. Can someone please confirm it.
    With regards,
    Pranav

    Hi,
    Apply this note and it should fix your problem:
    Note 845883 - Preferred vendor search help does not retrieve values
    Some other useful OSS notes ->
    968251 BBPSC02:In source of supply preferred vendor not validated
    1017288 SRM@ERP : no vendor replication into follow-on documents
    831833 Search help for preferred vendor does not update data
    980450 Shopping cart: search help for preferred vendor
    860886 Incorrect search results for deleted 'Preferred Vendor'
    711197 Preferred vendor not copied from template
    739531 Preferred vendor/service agent must not be changeable
    733899 Complete shopping cart: Preferred vendor disappears
    634794 Preferred vendor: partner not found
    726102 Performance in vendor search help
    647760 Shopping cart: Preferred vendor / partner not
    BR,
    Disha.
    <b>Pls reward points for useful answers.</b>

  • Preferred Vendors for  Product Category

    Hi,
    We are using SRM 7.0, Classic Scenario.
    My client wants a list of preferred suppliers that need to be maintained for a product category. So that whenever the requester selects the product category, he should get the list of preferred vendors for that product category.
    Thanks
    Ron

    Hi,
    How about maintaining "Supplier List" ?
    http://help.sap.com/saphelp_srm70/helpdata/EN/46/48e3de2f155d5ee10000000a1553f7/frameset.htm
    Search help with "Supplier List" is available in Preferred Supplier selection.
    Regards,
    Masa

Maybe you are looking for

  • How can I make background objects in a template selectable

    I have a Pages template with my signature embedded. It should move with the text but I cannot select it to make it do so. Does anyone know how this can be done in the new Pages 5?

  • BAPI for F-54 (Clear Vendor Down Payment)

    Hi guys, somebody knows if there is some BAPI or Function Module for F-54 transaction ?

  • Exception Handling (in Mapping) with out using BPM

    Hello All, We are on SP17. I have a simple flow involving XI JMS -> XI (Message Mapping -> XSL Mapping)  -> Mail I would like to send an email if there is an exception in any of the mapping. But I <b>don't want to use a BPM</b> for this exception han

  • Which is better the 1st g or 2nd generation ipod touch

    I like to know which is better and last longer and wont have much issues A. 1st g ipod touch or B. 2nd genertion ipof touch I like to know I dont know which one I want, and I like to hear it from a person who know what there talking about and who kno

  • Posting cycle when a database error is raised

    hello I have process train application composed of three page, each page is based on an entity 1) i fill the first page 2) i fill the second page 3) i fill the third page and invoke COMMIT There is a database trigger Busniess rule on the table of the