Error creating incoming payment. (ODBC -2035)

The error that I get while creating an incoming payment is:
This entry already exists in the following tables (ODBC -2035)
Here is the code:
public static bool CreatePayment()
       DateTime now = DateTime.Now;
       Payments pmt = (Payments) m_company.GetBusinessObject(BoObjectTypes.oIncomingPayments);
            pmt.ApplyVAT = BoYesNoEnum.tYES;
            pmt.CardCode = invoice.CardCode;
            pmt.CardName = invoice.CardName;
            pmt.CashSum = 0;
            pmt.ContactPersonCode = invoice.ContactPersonCode;
            pmt.DocCurrency = invoice.DocCurrency;
            pmt.DocDate = now;
            pmt.TaxDate = now;
            pmt.DocRate = 0;
            pmt.LocalCurrency = BoYesNoEnum.tYES;
            pmt.DocType = BoRcptTypes.rCustomer;
            pmt.HandWritten = BoYesNoEnum.tNO;
            pmt.JournalRemarks = "journal remarks";
            pmt.Remarks = "remarks";
            pmt.Reference1 = baseEntry.ToString();
            pmt.TransferSum = 0;
            // invoice
            pmt.Invoices.AppliedFC = 0;
            pmt.Invoices.DocEntry = baseEntry;
            pmt.Invoices.DocLine = 0;
            pmt.Invoices.InvoiceType = BoRcptInvTypes.it_Invoice;
            pmt.Invoices.SumApplied = amount;
            // credit card
            pmt.CreditCards.AdditionalPaymentSum = 0;
            pmt.CreditCards.CardValidUntil = Util.CCDateToDateTime(cardExpirationDate);        
            pmt.CreditCards.CreditCard = bp.CreditCardCode;
           pmt.CreditCards.CreditCardNumber = ccNumber;
            pmt.CreditCards.CreditSum = amount;
            pmt.CreditCards.CreditType = BoRcptCredTypes.cr_InternetTransaction;
            pmt.CreditCards.FirstPaymentDue = now;
            pmt.CreditCards.FirstPaymentSum = amount;
            pmt.CreditCards.NumOfCreditPayments = 1;
            pmt.CreditCards.NumOfPayments = 1;
            // there's a record in OCRP  (credit card payment methods)   
            pmt.CreditCards.PaymentMethodCode = 1;
            if (pmt.Add() != 0)
                int errCode;
                string errMsg;
                m_company.GetLastError(out errCode, out errMsg);
                // here errMsg is "This entry already exists in the following tables (ODBC -2035)"
                return false;
            return true;
I had 53 records in ORCT (incoming payments) but the next number in NNM1 and ONNM was 1. So I assumed that it was wrong and tried to set NNM1.NextNumber and ONNM.AutoKey to 54 for ObjectCode = 24 (Incoming payment).
The error remained the same. Then I removed all records from ORCT and its subordinate tables RCT1, RCT2, RCT3,.... and changed the next number back to 1.
The error is still: "This entry already exists in the following tables (ODBC -2035)".
Do you have any ideas what may cause the above error and how I can get more info which is the entry that already exists and in which table?
The code above works on another company (database).

Thanks Alexey,
Please note that I have manually modified SBO tables once the problem appeared not before. I do not know how receipt numbers got out of sync.
I also find the message "This entry already exist in the following
tables" without actually specifying any table, strange, the least.
The SDK is not particularly good and the samples in the help file are outdated and therefore wrong.

Similar Messages

  • Create incoming payments, based on Sales Person code

    Hi all,
    is there any SAPB1 functionality to create incoming payments, for many Sales Invoices of different customers , based on a Sales Person code ?
    Thank you,
    Aris Pantelatos

    Hi Jitin and Gordon,
    Thank you both for your replies.
    Jitin, I need to create different incoming payments (one for every customer)  based on a list of invoices with a specified Sales Person on them.
    Do you know, if this is included on SAPB1 roadmap?
    Edited by: Aris Pantelatos on Feb 8, 2012 4:04 PM

  • Create Incoming payment from an A/R Invoice

    I am on SBO2005A SP01 PL39 and do not find the option to create Incoming payment from an existing Invoice. When I open an existing A/R Invoice and click on CopyTo it shows only A/R Credit Memo. I remember seeing the Incoming Payment option in the earlier patch. Does this mean I cannot create an Incoming Payment based on an A/R Invoice?
    Thanks and Regards,

    Just to clarify, the Incoming Payment has never been available as a Copy to option from Invoice.
    The Incoming Payment resides inside the Banking module. 
    From Main Menu > Banking > Incoming Payment ...Incoming Payment
    The only time the Payment Means window will automatically open when you Add the Invoice is when the Payment Terms of the Business Partner is setup to open Payment Means window.

  • Error on creating Incoming Payment that links to another Incoming Payment

    Hi Experts,
    I am trying to create an Incoming Payment to pay an Invoice, as well as to use another Incoming Payment with an open balance (with Payment On Account box checked) to offset part of this payment.
    Incoming Payment A (-$75)
       --- link to Invoice B   ($85)
       --- link to Incoming Payment C  (-$10)
    This can be done manually, but by using DI API, I am facing this error:
    "-10: Base document card and target document card do not match.  (RCT2.DocLine)(line: 2)"
    Here is the source code:
    Dim oPayments As Payments = DirectCast(oCompany.GetBusinessObject(BoObjectTypes.oIncomingPayments), Payments)
    ' [HEADER]
    oPayments.CardCode = "C0001"
    oPayments.DocDate = Today
    oPayments.DocType = BoRcptTypes.rCustomer
    oPayments.CashSum = 0
    oPayments.BankChargeAmount = 0
    oPayments.TransferAccount = "12180208"
    oPayments.TransferDate = Today
    oPayments.TransferSum = 75
    oPayments.LocalCurrency = BoYesNoEnum.tYES
    ' [LINE 1 - AR Invoice B.]
    oPayments.Invoices.InvoiceType = BoRcptInvTypes.it_Invoice
    oPayments.Invoices.DocEntry = 16949
    oPayments.Invoices.SumApplied = 85
    ' [LINE 2 - Incoming Payment C with Open Balance.]
    oPayments.Invoices.InvoiceType = BoRcptInvTypes.it_Receipt
    oPayments.Invoices.DocEntry = 20338           ' Journal Entry Number of the Incoming Payment
    oPayments.Invoices.SumApplied = -10
    If oPayments.Add() <> 0 Then
        oCompany.GetLastError(errCode, errMessage)
        BarError(String.Format("{0}: {1}", errCode, errMessage))
    End If
    Initially I tried to set
    with the Incoming Payment's DocEntry, but after trial and error, I realized I should be using the Incoming Payment's Journal Entry's Number instead. So this field should be correct. (If I were to use the Incoming Payment's DocEntry for this field, I get the "-2028: No matching records found (ODBC -2028)" error.)
    I have ensured that the Incoming Payment C's CardCode is the same as the one I set in
    , so I'm not sure why it gives an error saying the document cards do not match. I would appreciate any form of help on this! Thanks!

    I am not trying to Pay to Account (you are referring to the top left radio button of the Incoming Payment right?). I am trying to create an Incoming Payment that uses another over-paid Incoming Payment (i.e. Open Balance > 0) to offset its Amount Due.
    Anyway I have found the solution to my problem. It seems that I need to also set the
    value to the over-paid Incoming Payment's Journal Entry's document line which contains the same business partner as my Incoming Payments. This DocLine value is usually 1 (0-based), as SAP usually creates the Journal Entry with the BP row in the second row.

  • No matching record found when creating Incoming Payment...

    I'm starting a transaction, creating a invoice and then creating a incoming payment.
    The invoice is created successfuly in memory I can see the next DocEntry and DocNum and passing it to the incoming payment as usual but I'm getting the error : No matching records found
    Any idea ?

    I found why.
    The Series used was not there.  But it's not obvious to know that it's because you set a wrong Series code with an error like this.

  • Error on Incoming Payments Screen

    Hello Experts,
    We have recently upgraded one of our customers from 2007A to 8.81 PL06. When they try to create an Incoming Payment and click on payment means, they get this message. I have checked GL Account Determination setup screen. Please advise asap.
    No matching records found  'G/L Accounts' (OACT) (ODBC -2028)  [Message 131-183]

    Before raising a ticket in SAP
    You should check which all account which you have  mapped in G/L account detemination ,it is available in chat of account by clcik in orenge button.
    Because such type of message indicate that ,you have mapped accouint but not in char of account.
    some time upgradation take such type issue.
    Manvendra Singh Niranjan

  • Solution Packager- Error in the process  (ODBC -2035)

    Dear Expert,
    I got below as error
    Solution SBO Packager 8.81 PL08 - There was an error during the creation of society,
    This entry already exists in the following tables (ODBC -2035)

    Did you get ny solution, because am facing same error.
    Please reply me

  • Error Regarding Incoming Payment

    Dear All
    I am using SAP B1 with patch level 9, when i am selecting Incoming Payment in Banking Module System is showing error like ''Linking primary sales accounts has not been completed'' so wht could be the solution for this ?

    i got solution by myself

  • Error in Incoming payments

    Hi Gurus,
    When doing  Incoming payments T.C F-28 i found an error
    'Only input tax is allowed for account 889000 BR01, B1 is not allowed'.
    B1 is the tax code.
    Plz tel me how to rectify this...

    Goto account 889000 in FS00, In control data tab, give the tax category as "*".  Then this account allows all tax types.
    Hope you understand the concept.....

  • Error entering Incoming Payments

    I am having problems entering Incoming payments into SAP for the last period of the current year. My Posting Period for period 12 is as follows:
    Posting Date From: 30/08/10 - To: 26/09/10
    Due Date From: 30/08/10 - To: 25/09/10
    Document Date From: 27/10/00 - To: 26/09/10
    When trying to enter a posting date of 22/09/10 I get the following error: " Posting Date varies from system date [Message131-57]. The system date on the client is 27/09/10. In getting the above error I am unable to proceed with entering the incoming payment. If however I extend the Posting Date To: 30/09/10. The system will allow me to proceed. This however is not viable as it opens up to entries being posted with next year's posting date. I have also been into: Administration>System Initilization> Document settings-->Block Documents with earlier posting dates - this option is not ticked.
    Would anyone be able to assist?

    Thanks Jitin,
    This site is on PL: 46 so is more than likely the problem. Will look to get them upgrade.

  • Error importing Incoming Payments using the Data Transfer Workbench

    Every time I try to import Incoming Payments using the Data Transfer Workbench I get an error that the Update Failed - Can not find this object in B1Application-defined or object-defined error65171. I'm using the 3 templates for Payments, Payments_Checks and Payments_Invoices. I've filled them out as I've seen in other postings in this forum. Based on the error message, I really can't tell what I'm doing wrong. Could someone please take a look at my files and let me know what might be causing the error?
    I'm using SBO 2007A PL41. Here's what I have entered in my templates for my test file.
    Payments file
    RecordKey 1
    DocEntry (blank)
    CardCode 1033985
    DocDate 20081215
    DocTypte rCustomer
    TaxDate 20081215
    Payments_Checks file
    RecordKey 1
    LineNum 0
    AccounttNum 0
    CheckAccount _SYS00000002152
    BankCode CC
    Branch 12345
    CheckNumber 1
    CheckSum 78.7
    CountryCode CA
    DueDate 20081215
    Trnsfrable tNo
    Payments_Invoices file
    RecordKey 1
    LineNum 0
    DocEntry 31791
    InvoiceType 13
    SumApplied 78.7
    Thank you.

    Hi Suda,
    As far as I can tell from the threads you forwarded (and other searches I've done on here), my files are correct. I tried filling out the templates exactly as explained in the first link (see my data below) but it still isn't working. It just gives me the same generic error. 
    Record Key....CardCode.....DocDate
    1.................._SYS00000002152..1.....................  78.7
    Is it correct that the Payments file should not contain anything in the DocEntry column? (I know that the DocEntry in my Invoices file is the DocEntry of the Invoice). I have a feeling that I'm making a stupid mistake somewhere but I just can't figure it out. Any ideas?
    I really appreciate your help with this.

  • Error adding Incoming Payments

    hello all
    I have a third party application, and I need to migrate incoming payments generated by that application. I read the headlines fit to be migrated to and through a loop trying to insert as many as required.
    A payment can pay multiple invoices to a client. And this payment can be made partly in cash, another in check and another in credit card.
    I had several error codes, but I will go for parts, first I get an error code (-10) and says it is an invalid document number in RCT2.DocEntry, reviewing SAP B1, if exist the invoice.
    For i = 0 To dvMigrar.Count - 1
       Console.WriteLine(CType(dvMigrar(i)("Ingreso_Caja"), String) + " " + dvMigrar(i)("Recibo_de_Caja"))
       vPay.Series = oSeries.Series
       vPay.ApplyVAT = BoYesNoEnum.tNO
       vPay.CardCode = Trim(dvMigrar(i)("Cliente_No"))
       vPay.CashSum = 0
       vPay.DocCurrency = "USD"
       vPay.DocDate = dvMigrar(i)("Fecha")
       vPay.DocRate = 0
       vPay.DocTypte = 0
       vPay.HandWritten = 0
       vPay.JournalRemarks = "Ingreso desde POS - " & CStr(dvMigrar(i)("Recibo_de_Caja"))
       vPay.LocalCurrency = BoYesNoEnum.tYES
       vPay.TaxDate = Now
       'Migración de Detalle Facturas Pagadas
       SlctCmd = "SELECT * FROM DOC_ABONAR_POS WHERE Ingreso_Caja = " & dvMigrar(i)("Ingreso_Caja")
       Dim SqlAdapter2 As OleDbDataAdapter = New OleDbDataAdapter(SlctCmd, MyConnSQL)
       dsMigrar2 = New System.Data.DataSet
       Dim dvMigrar2 As DataView = New DataView(dsMigrar2.Tables(0))
       For j = 0 To dvMigrar2.Count - 1
          vPay.Invoices.DocEntry = dvMigrar2(j)("DocEntry")
          vPay.Invoices.InstallmentId = dvMigrar2(j)("No")
          vPay.Invoices.DocLine = j
          vPay.Invoices.InvoiceType = BoRcptInvTypes.it_Invoice
          vPay.Invoices.SumApplied = dvMigrar2(j)("Valor")
          vPay.Invoices.InvoiceType = BoRcptInvTypes.it_Invoice
       If (vPay.Add() <> 0) Then
          Console.WriteLine("No se pudo generar Pago")
          'Check Error
          Call vCompany.GetLastError(nErr, errMsg)
          If (0 <> nErr) Then
             Console.WriteLine("Error encontrado:" + Str(nErr) + "," + errMsg)
          End If
       End If
    I'm trying to pay several invoices at the same incoming payment
    Thanks in advance
    Edited by: Oscar Alberto Cornejo on Nov 14, 2011 11:20 AM

    hi trying for this sample code.
    Its working for me
         Dim blnNEWFirstRecord As Boolean = True                    
        For z As Integer = 0 To oSPRecSet.RecordCount - 1
                                oSalesPayments.Invoices.InvoiceType = SAPbobsCOM.BoRcptInvTypes.it_Invoice
                                oSalesPayments.Invoices.DocEntry = oSPRecSet.Fields.Item("DocEntry").Value
                                oSalesPayments.Invoices.SumApplied = oSPRecSet.Fields.Item("OpenAmount").Value
                                If Not blnNEWFirstRecord = True Then
                                End If
                                blnNEWFirstRecord = False
    oPaymentError = oSalesPayments.Add()

  • Error in Incoming Payment

    Hi all,
    I'm getting an error while posting Incoming Payment.  The error is 'A current account has not been defined'.  I've selected house bank account at the header level i.e. GL Account, for that I'm getting warning message 'Defining credit/checking accounts as a cash account can affect the results of the cash flow report'.  Please advise on the above mentioned issue and suggest ways to avoid this and to post Incoming Payments successfully.

    Dear Sir,
    Please make sure that you have selected a GL account for Checks Received in the Admin->Set up->Financials->GL Account Determination->Sales-General Tab.
    It should also appear in payment means window. When we coose or Change Bank GL account in payment means, we receive a system message that transaction will affect cash flow report. This is not an error message. You can continue to work.
    Preety Goel
    SAP Business One Forums Team

  • F-28 error customer  incoming payment

    Hi Experts
    I am getting error when i ma trying to post customer incoming payments...
    Bank account is petty cash account
    Error : Balancing field profit center in line item 001 is not filled
    Kindly reply , thanks in advance

    Please note that the error is expected when using Profit Center as a mandatory field ( in your splitting characteristics),
    but however no value can be derived when posting the incoming payment.
    If you want the field profit center to be a mandatory field, you need to make sure that this will be derived by your splitting rules.
    Please review the following two consulting notes in relation to the document splitting functionality:
    1085921 Document split
    891144  New GL/Document splitting: Risks w/ subsequent

  • Error posting incoming payments (f-28)

    Hello SAP Gurus,
    When trying to post a customer payment I keep getting the following error message " The trading partner entered in account xxxxx cocdxx is not valid.
    Any ideas?
    Many Thanks

    Hi Rup,
    Field trading partner (-> BSEG-VBUND) of the company code clearing line items is filled
    with the company (-> T001-RCOMP / Tr. OBY6) of the other company code, and if the account master data of the company code clearing account contain a trading partner which is different from this company,
    error message F5 583 ('Business transaction cannot be processed
    by consolidation') is raised as the trading partner customizing
    is inconsistent.
    Also for FI postings an error message is raised if the account
    master data of the company code clearing account contain a
    trading partner which is different from the company (-> T001-RCOMP)
    of the other company code, and the posting is not possible. This
    is the default system behavior. Such a FI posting is only possible
    if the corresponding error message F5 636 ('The trading partner
    entered in account & & is not valid') is switched off in transaction
    Please have a look at the long text of error message F5 636:
    You have entered a cross-company code transaction. The system
    should now automatically generate a clearing posting for account &
    in company code &. The system determines the trading partner for
    this line item from the company code to which the clearing posting
    is made. This trading partner must be the same as that in the
    account master record.
    Please also check OBYA if  any incosistency.

Maybe you are looking for