on 11-22-2007 9:54 AM
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
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,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
100 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.