Problem canceling an incoming Payment

Hello Everybody
I'm trying to cancel an Incoming Payment using DI API.
When i do
oDocIP.GetByKey(iDocIPnumber)
I have the document (checked that by saving it as an XML File)
But wen i call the cancel method i have a -2028 Error "No Entry Found"
The incoming payment's payment mean is a bill of exchange.
Thanks in advance for your help
Best Regards

Hello,
For me working Fine my code, which i publish here.
I really do now know what object you are using... oDI.oCompany, but not a problem....
Maybe please cleanup you SM_OBS_DLL, this somethimes solves the the problem...
So my code is....
Private Sub CancelPayment(ByVal sIvoiceID As String)
        Try
            Dim oPay As SAPbobsCOM.Payments = oCompany.GetBusinessObject(BoObjectTypes.oIncomingPayments)
            Dim oRs As SAPbobsCOM.Recordset = oCompany.GetBusinessObject(BoObjectTypes.BoRecordset)
            Dim s As String = String.Format("SELECT T0.DocNum FROM ORCT T0 INNER JOIN RCT2 T1 ON T0.DocNum  = T1.DocNum Where T1.DocEntry = '{0}' and T1.InvType=13", sIvoiceID)
            oRs.DoQuery(s)
            Do While Not oRs.EoF
                oPay = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oIncomingPayments)
                If oPay.GetByKey(oRs.Fields.Item(0).Value.ToString()) Then
                    If oPay.Cancel <> 0 Then
                        MsgBox(String.Format("{0}-{1}", oCompany.GetLastErrorCode, oCompany.GetLastErrorDescription))
                    End If
                Else
                    MsgBox("Payment not found")
                End If
                oRs.MoveNext()
            Loop
        Catch ex As Exception
            MsgBox(ex.Message)
        Finally
            GC.Collect()
        End Try
    End Sub
Take care:
When you pay an invoice partially, example using 2 payments, each payments should be cancelled -> Put the payment object inside the loop, otherwise
you will have some problems with the garbage of DI API. Maybe this causes the problem....
Tested on B1 2007 PL49 and SP1PL05
Regards
J.

Similar Messages

  • Error when trying to cancel an incoming payment using a Credit Card

    I have searched and tried several things but I cannot seem to cancel an incoming payment when the credit card tab was used. I have tried to cancel before deposits, after the deposit (cancelling the deposit and then trying to cancel the inc. payment) but I still get the error. I have yet to see any post that will give a good process on how to fix this error.
    I did change the general settings for the credit voucher from automatic to manual in hopes that this will help future postings but I need the prior ones corrected that were made with the credit voucher option set to automatic. 

    Hi Joanne
    I was searching in fórums and I found:
    Cannot cancel Incoming Payment. One of the credit vouchers were cashed.
    Re: How to avoid "Unable to cancel payment. Credit voucher already cashed" err
    Cancel Incoming Payment (if Pay by credit card)
    Problem Reversing a Credit Card Payment
    Perhaps the easiest solution is changing the server date and making the operations to cancel the incoming payment.
    Kind regards
    Agustín Marcos Cividanes

  • Cancellation of Incoming Payments

    Hi,
    Need help on how to capture System Message Event (Yes or No)  when cancelling an Incoming Payment because I need to create Journal Entries after the cancellation.
    Thanks

    Hi Christian,
    is the cancelation initiated by user ? and after they click yes, you want to create the journal entry ?
    if so, you can check this link : Re: after system message?
    Basically, the formtype for system message is 0, but you only need to set some flag so that you catch the correct system message.
    Best Regards
    Edy

  • How to cancel an incoming payment on prevoius date

    Hi All,
                 There is an incoming payment posted on 01/06/2009 Posting date. Now I wanted to cancel this incoming payment as on 30/09/2009 posting date.
    Please give your solution in detail steps.
    Thankyou,
    Sree.

    There are only two options for cancelling a document.
    Original document date / current date
    Since 30/09 is neither of these, it would not be possible.  Unless you want to change your computer's date to 30/9 then restart B1 client.

  • Error During Cancelling an incoming payment

    Hi All! kindly find below the error we got during cancelling an in coming payment.
    "Reconciliation date must be on or after the last posting date for transactions error 3821"
    Kindly help with it to help us cancelling the doc.
    Thks
    R@j..

    Hi
    According to SAP reverse date must be later than posting date. Try reversing your incoming payment with later date.
    For eg if ur posting date is 30/12/2009 put your reverse date as 31/12/2009.
    Symptom
    When you have a payment created in a previous period, you are not able to cancel it in current period.
    If you cancel the payment in current period directly, you will get an error message as Date out of permissible range and the cancel opreration will fail.
    If you switch back to the period in which the payment is created, and cancel the payment, you will be prompted with two options which are posting date (current system date) and create date (the date the payment was created). What ever option you choose, the journal entry of the cancel operation will be posted at the create date of the payment.
    By no means can you create the journal entry in current system date.
    Other terms
    Payment, Cancel, Posting period, Posting date, Create date
    Reason and Prerequisites
    Applicaiton error
    Solution
    This issue will be fixed in a patch. See the info.txt file on SAP Service Marketplace to verify when the fix was included.
    Currently you can apply the following walkaround:
    1) Set system default posting period to previous period in which the payment is created.
    2) Cancel outgoing payment in previous period and JE created in previous period.
    3) Mannually Cancel the JE created in 2) in previous period
    4) Set system default posting period to current period
    5) Mannually create same JE in current period.
    Hope this solves your problem

  • Problem while making incoming  payment entries

    I am making check incoming payment entries in SAP-B1. As we receive check payment entries, it is crediting clearing check account & debiting account receivables.
    Please let us know how do  bank account will be credited & clearing check account will be debited.

    Hi........
    The entries are goming perfect. Actully in Incoming Payment there are two stage of entries.
    1. Incoming Payment from Customer where cheque receive
    2. Deposit in which check wil be deposited.
    So in first option Cheque will be debited and customer Account will be settled.
    in second step you have to deposit this cheque where Cheque account will be credited and deposit Bank will be  debited.
    This way your accounting happens and accounts for cheque will be settled.
    Hope this will clear the concept.
    Regards,
    Rahul

  • Cancelling Incoming Payment Failed

    Hi Experts,
    I know this has been asked before but based on what I have searched, none can solve my problem. If there is already an existing thread, kindly link me to it.
    Anyway, my problem is that, I am trying to cancel an incoming payment. I am on SAP Business One 2005A. It's August now and I am trying to cancel the payment which was done on 30.07.2009. Now, the period is set as such:
    Period Indicator: Default
    Posting Date: From 01.07.2009 To 31.07.2009
    Due Date: From 01.07.2009 To 30.06.2010
    Doc Date: From  01.07.2009 To 30.06.2010
    Active: Yes
    Locked: No
    Now, when I cancel the incoming payment, Business One automatically asks if I want the reverse journal to be created based on Posting Date or Creation Date. I need it to be based on Posting Date.
    The Incoming Payment has the following dates:
    Posting Date: 30.07.2009
    Doc Date: 30.07.2009
    Due Date: 30.07.2009
    I need the reverse journal to be created on the same date (30.07.2009). I have set as current period the above mentioned period but when i tried cancelling the incoming payment, I get the following error message Date deviates from permissible range [Journal Entry - Posting Date] [Message 173-11]
    Am I missing something here? What am I doing wrong? Your help is very much appreciated.
    Edited by: Alvin Chong on Aug 18, 2009 3:58 AM

    Suraj,
    I have checked and thank you very much. I have discovered why I cannot add the reverse journal. It was a silly mistake on my behalf. I was supposed to use the "Creation Date" which i mistook for "posting date". I got confused.
    Creation Date = Date payment was created (which is what i needed)
    Posting date = system current date (what I thought was creation date)
    I have been choosing "Posting Date" all these while and setting the creation date as current period. Silly me.
    Anyway, thanks a lot you guys! problem solved.

  • Cannot cancel Incoming Payment. One of the credit vouchers were cashed.

    Dear Experts,
    While canceling an incoming payment, I hit the below error message:
    "Cannot cancel. One of the credit vouchers were cashed."
    Please note that the deposits for this payment is cancelled.
    Please help advice!
    Warmest Regards,
    Chinho

    Hi!
    This problem is because of, the Due Date Mentioned in your payment is less than your System Date.
    To cancel this payment, do the following. (Do all this in SAP Server)
    1. As we need to change System Date ask all users to logg out from SAP.
    2. Ensure no user is booking any documents.
    3. Close SAP Appliaction and Change the system date previous or same date in the Due Date of that Document
    4. Select appropriate posting period, unlock posting period
    5. Open the Payment screen and select your document.
    6. Cancel the Document, choose document date as the cancel date.
    7. Close SAP again and change the system date to current date

  • Incoming Payment cannot be Canceled.

    My client is running SAP B1 version 8.8 PL 2. My client created an incoming Payment that was less than the balance due on the invoice and forgot to change the Total Payment field to reflect the actual amount paid.  I canceled the Deposit, but when I tried to cancel the Incoming Payment, I got the error message " Transaction associated with System Reconciliations which cannot be automatically canceled [Message 3821-14].  No External Reconciliations have been performed.  Since this appears to be an Internal Reconciliation issue, how can I fix this problem?

    Hi,
    The most possible reason for such error message when trying to cancel the Payment is that the same is associated to another payment.
    Try to cancel the other associated payment in the Copy of the database in the Test Enviorment and see if it works.
    Kind Regards,
    Jitin
    SAP Business One Forum Team

  • Cancel incoming payment

    please i entered the incoming payment through the transaction code F-28 after saving i guess that i made a mistake regarding the bank account ,it is for another company, i want to cancel the incoming payment
    many thanks in advance

    Dear,
    Go to tcode FBRA and give the clearing number generated at the time of payment receipt.
    and select reset and reverse option

  • Cancel or Delete a Bank Transfer Incoming Payment.

    Please advise how I can cancel a ( bank transfer)  incoming payment. Our client has entered two  incoming payments which are both bank transfers. One needs to be canceled. Thank you for your help in advance.

    Darpal,
    Bring up the Incoming Payment
    Right Click
    Choose "Cancel"
    This will cancel the incoming payment.

  • Cancel part of Incoming Payment

    Hi,
    An Incoming Payment was processed for postdated cheques received (ex. 6 cheques). Two of the cheques were deposited. The customer now cancels the rest of their order and the remaining cheques are returned.
    Q:  How can the 4 remaining cheques be reversed in SAP?
    I can't cancel the Incoming Payment because some of the cheques have been deposited. Don't want to cancel the Deposits for those cheques as there are about 120 other cheques included in the deposit...
    Using SBO 2007A PL35.
    Thank you,
    Heather

    Heather,
    There are a couple of things.  Since you have added the posted dated checks through the Incoming Payments,  the total amount of all the checks would have credited to the Customer account.
    You would also need to adjust the excess credit on the customer account for the balance of the checks which have been returned.
    If you have posted your checks to a Clearning Account then you could process a deposit using a date past the last check date and instead of the Bank Account chose the Clearing Account.  Now the Clearing Account gets a debit and a credit.
    Using a JE Debit the Customer to the amount of the Returned checks and for the Credit select the Clearning account
    Now do an internal reconciliation of the Clearing account
    Suda

  • Exporting Incoming Payments to Excel - Missing last line

    Forum,
    On 8.8 PL15 has anyone come across the following problem:
    When in Incoming Payments for customers, I click on the Excel icon within SAP and save the file as a .TXT file.
    I then open this up in excel and notice the last line is missing from the excel spreadsheet. This is irrespective of how many lines are on the Incoming Payments screen within SAP.
    Regards,
    Juan

    Hi Juan,
    It seems like bug in PL-15
    check Cant export the last data in datagrid to excel
    Thanks,
    Neetu

  • Cannot update one incoming payment

    Hello. I have a problem modifying an incoming payment. I have a payment created and i want to increase the BillOfExchangeAmount and i have an error when update the payment. The code is this:  ( is a debug code. Payment has number 39 )
    Set payment = SAP.g_Company.GetBusinessObjectoIncomingPayments)
    payment.GetByKey(39)
    payment.BillOfExchangeAmount = 120
    payment.Update
    error = SAP.g_Company.GetLastErrorCode
    descr = SAP.g_Company.GetLastErrorDescription
    It return error -10
    The error description is =  Bill Of Exchange does not exists
    But the BOE exists!. Is a mistery...
    Thanks. See you.

    Hi Hector,
    I tried to do something similar with the BillOfExchange object. My conclusion is that you can't update the payment means data of an inserted payment (try that in B1). I even looked at the profiler.
    And about the error, try this (there's no error)
    payment.BillOfExchange.BillOfExchangeNo = payment.BillOfExchange.BillOfExchangeNo
    and add your code then. It should work. But no update.
    Hope this helps,
    Ian

  • Cancel Incoming Payment (if Pay by credit card)

    Hi..
    I want to ask,
    how to Cancel Incoming Payment (if pay by credit card), and incoming payment created one month ago..
    If i create new incoming payment, and i cancel, it works..
    But if i find old incoming payment, i cant cancel it
    the error sounds: "one of the credits voucher was cashed".
    any idea to solve this problem?
    Thankyou for your help
    regards

    Hi Dony,
    Issue is described in SAP Note 542274. I assume that mentioned credit voucher is overdue, and the settings in Administrations - System Initialization - General Settings - Sales tab, Submit Credit Vouchers is  "Automatically". It means, that credit voucher is already deposited, you can check it in Banking - Deposits - Deposit - Cheques/Credit Card/Cash tab(It depends on the payment means of incoming payment).         
    It is not possible to cancel deposited credit vouchers, you must to     
    create a similar Incoming Payment with negative amounts and deposit it. 
    Regards,
    Paul

Maybe you are looking for