cancel
Showing results for 
Search instead for 
Did you mean: 

Business Partner Update

Former Member
0 Kudos

We are not able to <b>add any new BP</b> in our existing BP Master after transferring data via DTW

It says Entry already exists OCRD ODBC 2035 (131-183)

What could be the problem

Cheers

Accepted Solutions (1)

Accepted Solutions (1)

former_member186095
Active Contributor
0 Kudos

Hello,

try to use this work around :

1. GetByKey

2. Change BP code

3. Add object

4. Remove old BP.

As demonstrated in the code below:

Private Sub UpdateBP()

Dim RetVal As Long

Dim ErrCode As Long

Dim ErrMsg As String

Dim oBP1 As SAPbobsCOM.BusinessPartners

Set oBP1 = oComp.GetBusinessObject(oBusinessPartners)

Dim oBP2 As SAPbobsCOM.BusinessPartners

Set oBP2 = oComp.GetBusinessObject(oBusinessPartners)

'1) Add BP

oBP1.CardCode = "Amik"

oBP1.CardName = "Amik"

RetVal = oBP1.Add

If RetVal <> 0 Then

oComp.GetLastError ErrCode, ErrMsg

MsgBox ErrCode & " " & ErrMsg

End If

'2) Update BP Cardcode

RetVal = oBP2.GetByKey("Amik")

If RetVal <> -1 Then

oComp.GetLastError ErrCode, ErrMsg

MsgBox ErrCode & " " & ErrMsg

End If

oBP2.CardCode = "Amik18"

RetVal = oBP2.Add

If RetVal <> 0 Then

oComp.GetLastError ErrCode, ErrMsg

MsgBox ErrCode & " " & ErrMsg

End If

RetVal = oBP1.Remove

If RetVal <> 0 Then

oComp.GetLastError ErrCode, ErrMsg

MsgBox ErrCode & " " & ErrMsg

End If

End Sub

let me know if problem still persists.

Rgds,

Answers (0)