Hello,
I'm using the DIServer to update business partners using the BusinessPartnersService.
My first attempt to do this involved me using the GetByParams command to call in a business partner, make changes that I need to certain fields, and then using the Update command to send them back into SAP.
The problem I ran into when performing one update was that a contact was used on a purchase order, and therefore it wasn't allowed to be changed. I wasn't really trying to change that contact or any of it's fields. I was trying to change the CardName field in the BusinessPartner section. Because I only made changes to the xml that I received from GetByParams and then used that same XML in the update command, the service sees the fields for the contact and assumes an update is being attempted on that contact (though they really match the system data), and gives me the error.
I'm trying to figure out how I can change the xml to only update the main BusinessPartner fields. If I just exclude the ContactEmployees section, it tries to delete the employees which not only isn't what I want, but it returns the same error.
Previously, I thought I had tested doing something like this
<ContactEmployees>
<ContactEmployee/>
<ContactEmployee/>
</ContactEmployees>
and I thought it had worked the way I want it to work, but now when I try that, I get an error back that says
"Invalid XML. Expected item name 'ContactEmployee' but got 'BPAccountReceivablePaybleCollection'" (BPAccountReceivablePayableCollection is the next element after ContactEmployees are closed)
Does anyone have any experience doing what I'm describing? Do you know how I can accomplish this?
If you need the xml that I use in my DIServer commands, this is what I do.
<Service>BusinessPartnersService</Service>
<BusinessPartnerParams>
<CardCode>C2001</CardCode>
</BusinessPartnerParams>
</dis:GetByParams>
Then I use the following to update
<Service>BusinessPartnersService</Service>
<BusinessPartner>
....xml returned from the above GetByParams
</BusinessPartner>
</dis:Update>