Skip to Content
author's profile photo Former Member
Former Member

Problem Creating CreditMemo Through SDK

Hi All,

In SAP 9.0 PL 5 I have created an order and based on that order I have created delivery, Payment and Invoice. Now when I am trying to add Credit Memo for created invoice Via SDK it is giving the below error:

Quantity cannot exceed the quantity in the base document.

I am linking the document and line correctly and the BaseLine, BaseEntry, and BaseType match the ones on the source document. Also, the quantity is not more then on the source document.

Please Help me give suggestion.

Thanks

Here's my code:

ReturnMat = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oCreditNotes)

ReturnMat.Series = SAPSerie

ReturnMat.CardCode = DTShipper.Rows(0).Item("Customer")

ReturnMat.Comments = Shipper.ToString() & " " & Note.ToString()

For x As Int32 = 0 To DTShipper.Rows.Count - 1

If x > 0 Then ReturnMat.Lines.Add()

ReturnMat.Lines.BaseEntry = DTShipper.Rows(x).Item("InvoiceDocEntry")

ReturnMat.Lines.BaseType = SAPbobsCOM.BoObjectTypes.oInvoices

ReturnMat.Lines.BaseLine = DTShipper.Rows(x).Item("LineNum")

''Lines

ReturnMat.Lines.Quantity = DTShipper.Rows(x).Item("SAPQuantity")

''BatchNumbers

ReturnMat.Lines.BatchNumbers.Add()

ReturnMat.Lines.BatchNumbers.BatchNumber = DTShipper.Rows(x).Item("Serial")

ReturnMat.Lines.BatchNumbers.Quantity = DTShipper.Rows(x).Item("SAPQuantity")

Next

ReturnMat.Add()

oCompany.GetLastError(ErrCode, ErrMsg)

If ErrCode <> 0 Then

MessageBox.Show(ErrMsg)

End If

Add a comment
10|10000 characters needed characters exceeded

  • Hello

    Were you able to solve the problem, I have the same issue when create a CreditNote based on an invoice, without delivery it works fine but when a Delivery exist y receive the error: Quantity cannot exceed the quantity in the base document and the quantity is the same as the base document.

    Any help will be greatly appreciated!

Related questions

2 Answers

  • Posted on Apr 04, 2016 at 08:56 AM

    Hi Brian,

    based on that order I have created delivery, Payment and Invoice

    Invoice that has been targeted for payment, can not be credit noted anymore.

    Regards

    Edy

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 28, 2020 at 04:45 AM

    Hi,

    Refer to the thread https://answers.sap.com/questions/13081357/sdk-cant-create-credit-note-based-on-invoice-if-de.html for a solution.

    Use ActualBaseEntry and ActualBaseLine properties of Document_Lines Object while creating the A/R Credit Memo via DI API.

    These properties are used to create Credit Memos for delivered items on Reserve Invoices.

    Refer to the SDK Help File for the same.

    Kind regards,

    ANKIT CHAUHAN

    SAP Business One Support

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.