Hi Experts,
Im having a problem with the Manual Checks, if i insert the record to Manual Check i encounter error "No matching records found (ODBC - 2028)". Please help us identify the problem thanks.
Dim _OUTGOING_PAYMENT As New OutgoingPaymentUnit()
Dim oPayment As SAPbobsCOM.Payments = Nothing
oPayment = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oVendorPayments)
Dim oPayCheck As SAPbobsCOM.Payments_Checks = oPayment.Checks
'1. DocDate
oPayment.DocDate = _OUTGOING_PAYMENT.DocDate
oPayment.DueDate = _OUTGOING_PAYMENT.DocDate
oPayment.TaxDate = _OUTGOING_PAYMENT.DocDate
'2. DocCurrency
oPayment.DocCurrency = _OUTGOING_PAYMENT.DocCurrency
'3. Bank Account
If (_OUTGOING_PAYMENT.TransferType = "H") Then
'I inserted the code here to set the manual check
oPayCheck.CheckAccount = _OUTGOING_PAYMENT.BankAccount
oPayCheck.ManualCheck = SAPbobsCOM.BoYesNoEnum.tYES
ElseIf (_OUTGOING_PAYMENT.TransferType = "C") Then
oPayment.CashAccount = _OUTGOING_PAYMENT.BankAccount
ElseIf (_OUTGOING_PAYMENT.TransferType = "B") Or (_OUTGOING_PAYMENT.TransferType = "R") Then
oPayment.TransferAccount = _OUTGOING_PAYMENT.BankAccount
End If
'4. DocRate
oPayment.DocRate = _OUTGOING_PAYMENT.DocRate
'5. Name
oPayment.CardCode = _OUTGOING_PAYMENT.CardCode
'6. Balance
'7. C + P Balance
'8. Trans Type
'9. Ref No
If (_OUTGOING_PAYMENT.TransferType = "B") Then
oPayment.TransferReference = _OUTGOING_PAYMENT.RefNo.ToString()
ElseIf (_OUTGOING_PAYMENT.TransferType = "H") Then
oPayCheck.CheckNumber = CInt(_OUTGOING_PAYMENT.RefNo)
End If
'10. Amount
If _OUTGOING_PAYMENT.DocCurrency = "SGD" Then
If _OUTGOING_PAYMENT.TransferType = "C" Then
oPayment.CashSum = _OUTGOING_PAYMENT.Amount
'oPayment.CashSumSys = _OUTGOING_PAYMENT.Amount
ElseIf _OUTGOING_PAYMENT.TransferType = "H" Then
oPayment.Checks.CheckSum = _OUTGOING_PAYMENT.Amount
ElseIf _OUTGOING_PAYMENT.TransferType = "B" Then
oPayment.TransferSum = _OUTGOING_PAYMENT.Amount
ElseIf _OUTGOING_PAYMENT.TransferType = "R" Then
oPayment.CreditCards.CreditSum = _OUTGOING_PAYMENT.Amount
End If
Else
If _OUTGOING_PAYMENT.TransferType = "C" Then
oPayment.CashSum = _OUTGOING_PAYMENT.Amount
ElseIf _OUTGOING_PAYMENT.TransferType = "H" Then
oPayment.Checks.CheckSum = _OUTGOING_PAYMENT.Amount
ElseIf _OUTGOING_PAYMENT.TransferType = "B" Then
oPayment.TransferSum = _OUTGOING_PAYMENT.Amount
ElseIf _OUTGOING_PAYMENT.TransferType = "R" Then
oPayment.CreditCards.CreditSum = _OUTGOING_PAYMENT.Amount
End If
End If
oPayment.JournalRemarks = _OUTGOING_PAYMENT.Description
oPayment.Remarks = _OUTGOING_PAYMENT.Remarks
iRetVal = oPayment.Add()
Return iRetVal
Your help is much appreciated. I am using SAP 8.8 PL15