Update Business Partner via SAP Business One Webservices

Dear all,
We use the SAP Business One Webservices to add/update businesspartners and items.
We can add/update items without any problem.
We can also add businesspartners without any problem.
But when we try to update a businesspartner.
We always get the error message : "Entry already exists in following tables:"
This is the code we use to update BusinessPartner:
Dim bpsService As BP.BusinessPartnersService = New BP.BusinessPartnersService()
Dim msgheader As BP.MsgHeader = New BP.MsgHeader()
msgheader.SessionID = sSessionID
    msgheader.ServiceName = Global.BP.MsgHeaderServiceName.BusinessPartnersService
    msgheader.ServiceNameSpecified = True
    bpsService.MsgHeaderValue = msgheader
            ' fill business partner class
            Dim oBp As BP.BusinessPartner = Nothing
            Dim myBPParams As BP.BusinessPartnerParams = New BP.BusinessPartnerParams()
            myBPParams.CardCode = sCardCode
            ' Call GetByParams command
            oBp = bpsService.GetByParams(myBPParams)
oBp.CardName = "Test update BP"
Can someone tell me what is going wrong when I call this function :
  bpsService.Update(oBp)
Kind regards
Bart

Hi Bart,
I think the problem is because you are using the BPService twice without initializing it one more time in the middle.
You call first GetByParams and then Update.
The following code works for me:
        myBPService = New BusinessPartnersService()
        Dim myBP As BusinessPartner = New BusinessPartner()
        Dim myBPParams As BusinessPartnerParams = New BusinessPartnerParams()
        ' Create Header
        Dim msgHeader As MsgHeader = New MsgHeader()
        msgHeader.SessionID = B1WS_WindowsSample.GlbData.sessionID
        msgHeader.ServiceName = MsgHeaderServiceName.BusinessPartnersService
        msgHeader.ServiceNameSpecified = True
        myBPService.MsgHeaderValue = msgHeader
        myBPParams.CardCode = MainForm.CardCodeTextBox.Text
        myBP = myBPService.GetByParams(myBPParams)
        myBPService = New BusinessPartnersService()
        ' Create Header
        msgHeader = New MsgHeader()
        msgHeader.SessionID = B1WS_WindowsSample.GlbData.sessionID
        msgHeader.ServiceName = MsgHeaderServiceName.BusinessPartnersService
        msgHeader.ServiceNameSpecified = True
        myBPService.MsgHeaderValue = msgHeader
        System.Console.Out.WriteLine("Update a BP")
        myBP.CardName = "CardName MOD"
        '/ call Asyncronous Add
        myBPService.Update(myBP)
Hope it works also for you
Regards
Trinidad.

Similar Messages

  • Business Partner Role  and Business Partner Grouping

    Hello Everybody!
    Business Partner Role  and Business Partner Grouping.
    Which correlation ist between this attributes existing.
    In which table are this infos stored, In order create I can use
    e.g. BUPA_CREATE_FROM_DATA
    but how is the way inversely. Suppose I want to abtain the information
    about a existing business partner which group he has etc.
    Regards
    sas

    Dear Sas,
    Business Partner Grouping is used to determine the number ranges to be used by the business partner at the time of creation.
    Business Partner Role determines the subset of all the data available to be shown and edited.
    I will give you a very simple (but imaginary) example for understanding the role concept: the business partner in a role of employee might allow you to enter a department id. So this field should be available to you for input when you edit the business partner in the role of employee. But suppose the same business partner is also a person who is your customer. And your customer will require a default payment term. So this field should be available for input when you edit the business partner in the role of a customer. Also, some applications use these roles to determine if the business partner is suitable for particular transaction. In the above example, Payroll application will only allow those Business Partner to be used if they are maintained as an employee. Similarly the sales application can mandate that you can only sell a product to a business partner if he is maintain in a 'customer' role.
    Please understand the example above is not real but given for the understanding of the concept of role.
    You can use the function module 'BUPA_CENTRAL_GET_DETAIL' to find the business partner group. And you can use the function 'BUPA_ROLES_GET' to find the role assigned to a Business Partner.
    Regards, Rakesh

  • SAP Business Objects and SAP Business Objects PCM

    Hi all
    We want to know if is recommendable to have Business Objects and SAP Business Objects PCM installed in the same server, and if is necessary to have a special configuration of the services for both applications?
    Thanks in advance

    Hi,
    You can refer the below link for PCM Install guide:
    http://service.sap.com/~sapidb/011000358700000225772009E/FPM75_PCM_InstallGuide_en.pdf
    If you are looking for more info related to specific requirements then from the below link select BusinessObjects tab and select PCM category for more guides.
    http://help.sap.com
    -Noor.

  • Problem with creating business partner via BAPI

    Hello! I have a simple File-RFC-File scenario:
    XML-file with Firstname, Lastname and PartnerCategory. I use BAPI_BUPA_CREATE_FROM_DATA to create a partner with this data.
    It works, in target file I have a number of new business partner, but I can't find new partner in the system. Like I only tested BAPI_BUPA_CREATE_FROM_DATA in "bapi" transaction without real effect.

    Hi,
    probably you didn't comit the BAPI
    RFC adapter allows to specify comit for BAPI
    add this to your RFC channel configuration and you will see the partner
    for more info read section:
    Commit Control for Single BAPI Calls
    from
    http://help.sap.com/saphelp_nw04/helpdata/en/c8/e80440a832e369e10000000a155106/content.htm
    Regards,
    Michal Krawczyk

  • How to set limit on sum of totals of all sales orders of a business partner in SAP B1

    Hi,
    I would like to set a limit on a business partner so that the sum of totals of all orders placed for that business partner do not exceed a certain amount. How can I do that?
    Regards,
    Victor

    Hi,
    Yes can set limit for Business partners. Follow the steps to achieve:
    1. Choose "Credit limit" check box under Administration--->System Initialization--->General settings--->BP sub tab and choose  sales order check box
    2. Set credit limit for BP under Business partner master data--->Payments terms.
    For complete information, you can  refer SAP help file.
    Thanks & Regards,
    Nagarajan

  • How To upload business partner into sap crm using xif Adapter by XML File

    HI Guru's,
                 I got Requirement to upload the business partner information into sap crm system using xif adapters from xml file , please give  imformation how can achive this .
    Regards,
    Naveen Kumar MS

    Dear Naveen,
    please see the information given in note 448742 General notes on CRM external interfaces!
    Hope you can find the information!
    Regards, Gerhard

  • Business Partner in SAP EHS

    Dear Friends
    How to create Business Partner (Health Centre, Physician, Authority, Laboratory etc) in SAP EHS. Is it created in SAP EHS or is it created in MM as a vendor/service provider. Please let me know the process of creating business partner for OH-EHS.
    Regards
    Vikram Sethi

    hi vikram
    plz seee below path for ur query
    Occupatioanl health -- > basic data --> addresses
    here u can create all business partners in Occupatioanl health (which u hav mentioned health center, physian etc)
    i hope, i resolved ur query
    thanks and regards
    mandar sathe
    00919764007574

  • Business partner in SAP HR

    Dear Friends,
    May I request you to provide information on my below queries please:
    1. What is the significance of a Bussiness Partner in SAP, why do we have to implement this when we use Talent management.
    2. In what way is it related with CP.
    3. what kind of configuration steps to be followed to create a Business parner.
    Regards
    Sanjay

    Hi,
    BP is an object used in talent management module.
    We use this in E Rec as an external object for uploading resumes ( from vendors)...
    We use this in LSO  as an external object who attends or provides training.
    we have different relationships for this object ( purely depends on situation).
    Hope this gives you some knowledge.
    thanks
    rafi

  • How to stop the replication of a particular business partner from sap crm to sap ecc - BDOC

    Hi experts,
    I need to know the procedure to stop replicating a particular BP #1234(example) from CRM to ECC. I don't want this BP to be replicated in ECC as in ECC this BP will not be maintained.
    BDOC failure:
    In my current scenario BDOCs are failing with error like "No BP exist". Since this BP #1234 itself is not present in ECC, the error is obvious.
    This BP #1234 is defined in CRM as an Org. Unit. We don't maintain Org. Unit in ECC. All other BP are saved under this BP(#1234).
    Issue:
    So whenever a new BP(example #ABC) is created, the BUPA_REL type BDOC fails with error "BP with number #1234 doesnot exist.
    I don't want this to happen. So what i found if we can stop the replication of this particular BP #1234, then if we make any change to the relation BP, this error should not come.
    Please help me to resolve this BDOC error.
    regards,
    Vicky

    Hi Ganesh,
    1st we create a Organization structure through tcode-PPOSA_CRM.
    A business Partner is created which represent the Organization Structure partner ID.
    2nd we create a BP through and do a Org. assignment in tcode - PPOSA_CRM.
    A business Partner is created which represent the any customer partner ID.
    As soon as you do an assignment,assigning the customer BP to the org BP, a BUPA_REL BDoc flow but it fails.
    Error we get in the BDoc: "BP XXXX doesnot exist"
    Reason: Since this Org BP is not present in ECC, the BDoc fails in CRM.
    Possible Resolution 1:
    1. I created this Org. BP in ECC through CRMM_BUPA_MAP
    2. The BP got created.
    3.Then i tried to assign a new customer BP to Org BP to check if the issue is resolved, but we get another type of error 'BP is not defined as internal Org. Unit".
    I don't know how to define BP as an internal Org. Unit in ECC?
    Can you please help me in this.
    Possible Resolution 2:
    If i can stop this particular BUPA_REL BDoc which contains this Org.unit BP, from getting replicated, means when i assign the customer BP to Org.Unit BP, BUPA_REL should not be triggered.
    I don't know if this is possible or not, but if this is possible, i would consider this a last option to resolve this issue.
    Please let me know if this helps you to understand the issue i am facing?
    regards,
    Vicky

  • Function module to change the address on the business partner in SAP-ISU.

    Can some one send me the function module to change the address of businees partner in SAP ISU.

    Hi,
    The FM you are looking for is BAPI_BUSINESS_PARTNER_CHANGE
    You can use the table PARTNERADDR to fill the Address of the Partner.
    Hope this helps.

  • SAP Business Partner in SAP Interactive Forms

    Hello,
    when I use the addresses from the BAS in the interactive forms, I have noticed that in the properties window on the buttom I can enter values for SAP Business Partners.
    What are these Business Partners? (just out of curiousity as I don't normally work with them)
    Thanx!

    hi vikram
    plz seee below path for ur query
    Occupatioanl health -- > basic data --> addresses
    here u can create all business partners in Occupatioanl health (which u hav mentioned health center, physian etc)
    i hope, i resolved ur query
    thanks and regards
    mandar sathe
    00919764007574

  • Issue for production via SAP Business Objects

    Hi all,
    I would like to create Issue for production from SAP Business Object. I am using C#.net. I did not find it in DIAPI
    Is there any way ????
    Issue is urgent
    Thanks in advance

    Hello Manish,
    IT worked for me, you can try it.
    SAPbobsCOM.Documents ldoc_RecHdr = (SAPbobsCOM.Documents)oCompany.GetBusinessObject(BoObjectTypes.oInventoryGenExit);
                   ldoc_RecHdr.DocDate = Convert.ToDateTime(DTPPostingDate.Value);
                    ldoc_RecHdr.Reference2 = txtRefNo.Text;
                    ldoc_RecHdr.Comments = richtxtRemark.Text;
                    ldoc_RecHdr.DocType = SAPbobsCOM.BoDocumentTypes.dDocument_Items;
                    for (int i = 0; i < DataGrid.RowCount; i++)
                        ldoc_RecHdr.Lines.BaseEntry = Convert.ToInt32(DataGrid.Rows[i].Cells[0].Value);
                        ldoc_RecHdr.Lines.BaseType = Convert.ToInt32("202");
                        ldoc_RecHdr.Lines.BaseLine = i;
                        ldoc_RecHdr.Lines.Quantity = Convert.ToDouble(DataGrid.Rows[i].Cells[3].Value);
                        ldoc_RecHdr.Lines.WarehouseCode = DataGrid.Rows[i].Cells[5].Value.ToString();
                        ldoc_RecHdr.Lines.Add();
                    if (ldoc_RecHdr.Add() != 0)
                        string error = oCompany.GetLastErrorDescription();
                        MessageBox.Show(error.ToString());
                    else
                        MessageBox.Show("Record Inserted Successfully!");

  • Updating Business Partner via B1WS web services

    Hi,
    I get an error when I try to update (through the 'update' function of the BusinessPartnersService object) a BP that has already a bank account; even if I populate the BPBankAccounts property with the existing info of bank account, I get:
    Bank account is in use and therefore cannot be removed or changed   [(----) 705-20]
    My code is:
                BusinessPartnersService px = NewBPService(LoginDefault());
                BusinessPartner bp = new BusinessPartner();
                bp.CardCode = "CADRIAT0000";
                bp.Phone1 = "041666666";
                BusinessPartnerBPBankAccount[] bpba = new BusinessPartnerBPBankAccount[1];
                bpba[0] = new BusinessPartnerBPBankAccount();
                bpba[0].BPCode = "CADRIAT0000";
                bpba[0].IBAN = "IT42L0350012500000000021179";
                bpba[0].Branch = "12500";
                bpba[0].BankCode = "03500";
                bpba[0].AccountNo = "000000021179";
                bp.BPBankAccounts = bpba;
                px.Update(bp);
    Does anyone know ho to update correctly a BP with an existing bank account?
    Thanks,
    Alessio

    Hi,
    First Use the getbykey to get the Business partnet then update.
    sample code is available with B1WS package
    Regards.

  • Store Business Document via SAP GUI for HTML

    We are trying to use SAP GUI for HTML via UWL in Portal to deliver Workflow. When we try to attach files for the "Store Business Document" step, it gives an informational message "Store business document Access via 'NULL' object reference not possible"  but the documents themselves never get attached. We are on ECC 6.0 and Portal 7.0. Any help is greatly appreciated.
    Thanks!
    - Rao

    I've found a working solution a minute ago: See SAP Note: 510007
    Best regards
    Danny

  • Can Inbound IDOC create a BP(Business partner) In SAP CRM system

    Hi
    Req:
    Contractor data is transfered from ERP system to CRM using Message type HRMD_ABA with ALE Distribution Model in place.
    Inbound IDOC is Successfully Posted  when checked in WE05  in SAP CRM System.
    Question :
    1. Can  an INBOUND Idoc create  BP automatically  or is there  need of Configuration or Any custom program .
    Appreciate Your Response
    Bhanu Polsani
    Edited by: Bhanu Polsani on Oct 4, 2011 6:10 PM
    Edited by: Bhanu Polsani on Oct 4, 2011 6:16 PM

    You can maintain two different address for the business agreements (can be treated as mailing address for the printed invoice)but you can not maintain more than one standard address for BP as any given time.
    Regards,
    Sanjoy

Maybe you are looking for

  • Open items (installments) list??

    Hello, I need to know if there are any reports/list output for getting the open items (installments). If there are tables where you can get some kind of flag mentioning that certain items are open or cleared? We have Accounts Display (FPL9), we need

  • Payment block issue

    Hello a particular miro invoice is blocked for payment 'R' we can see the document no. which is showing blocked for payment. but payment is proceeded through FB05, and payment document is generated. What could be the reason?? Subodh

  • How to rectify the  payable account not definderror in down payment request

    how to rectify the  payable account not definderror in down payment request

  • Linux x86 AS 10G 10.1.2.0.2 forms and reports services download fails

    I have tried this down load from a number of PCs and it always claims to have completed after anything from 30 to 130 MB (the actual file is over 500MB). This is the URL http://download.oracle.com/otn/linux/ias/101202/as_linux_x86_fr_101202_disk1.cpi

  • N8 Huge Camera Problem Found, Please Advice!!

    Hello all Nokia guys, I am a new member in this forum as well as to Nokia. I bought Nokia N8 on Sunday 5 th Dec 2010 ( Mumbai, India ). That day i did not test camerra in the night time. I clicked many photos during Day time and it looked just Gr8. N