on 04-01-2016 11:26 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Brian,
Can you tell us more :
What is the quantity and Amount of SO
What is the quantity and amount of SO copied over to DO
What is the quantity and amount of DO copied over to AR Invoice
What is the amount of AR Invoice has been created as Payment.
And finally, what is the quantity you are trying to create as CN ?
Regards
Edy
Hi Brian,
I followed this exact steps and added the CN without problem in SBO 9.0 PL16
Create SO Qty = 50, UnitPrice = $18
Create DO Qty = 50, UnitPrice = $18
Create Inv Qty = 50, UnitPrice = $18
Create Payment, Amount= 720$
Create CN Qty = 10, UnitPrice = $18.
Your codes looks ok.
I wonder why you create AR Invoice first then DO after that.
May I know what is your SBO version ?
Regards
Edy
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
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.