Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Invoice create from DeliveryNote

Good Day

Experts:

I have SalesOrders that were "Copied To" a DeliveryOrder using the Copy To button on the lower right portion of

the SalesOrder screen. I then use the DeliveryNote object via the DocEntry value to get information to build an

Invoice. My code works fine. However, I am a bit concerned that I am sending "enough" information for all the "behind the scenes" things that go on with the Invoice. This after I found the amount of fields available on oDeliveryNote. How can I know if I am sending all the information that is needed? Here is my code:

oDeliveryNote.GetByKey(sDocEntry)

'***********************************************

'Set DeliveryOrder header info to Invoice object

'***********************************************

oInvoice.CardCode = oDeliveryNote.CardCode

oInvoice.CardName = oDeliveryNote.CardName

oInvoice.Address = oDeliveryNote.Address

oInvoice.DocDate = oDeliveryNote.DocDate

oInvoice.DocDueDate = oDeliveryNote.DocDate

For i = 0 To oDeliveryNote.Lines.Count - 1

oDeliveryNote.Lines.SetCurrentLine(i)

If i > 0 Then

oInvoice.Lines.Add()

End If

'*********************************************

'Set DeliveryOrder line info to Invoice object

'*********************************************

oInvoice.Lines.BaseEntry = oDeliveryNote.DocEntry

oInvoice.Lines.BaseLine = oDeliveryNote.Lines.LineNum

oInvoice.Lines.BaseType = SAPbobsCOM.BoObjectTypes.oDeliveryNotes

oInvoice.Lines.ItemCode = oDeliveryNote.Lines.ItemCode

oInvoice.Lines.Quantity = oDeliveryNote.Lines.Quantity

oInvoice.Lines.Price = oDeliveryNote.Lines.Price

Next

retVal = oInvoice.Add()

Next

Thanks for helping,

Ed

Not what you were looking for? View more on this topic or Ask a question