Skip to Content
Former Member
Sep 21, 2005 at 12:21 AM

Adding a delivery document with serial numbers


Hi everyone,

A delivery document is created in code and the item delivered requires a serial number. In this example there is a quantity of two so two serial numbers will need to be added.

Dim oCompany As New SAPbobsCOM.Company, lRetCode As Long

Dim oSerialNumbers As SAPbobsCOM.SerialNumbers

Dim oDelivery As SAPbobsCOM.Documents

Dim RetVal As Long

Dim ErrCode As Long

Dim ErrMsg As String

oDelivery = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDeliveryNotes)

oDelivery.CardCode = "KellyD"

oDelivery.DocDate = "09/20/2005"

oDelivery.Lines.ItemCode = "MDASTPE"

oDelivery.Lines.Quantity = 1

oDelivery.Lines.TaxCode = 0

oDelivery.Lines.Price = 300

oSerialNumbers = oDelivery.Lines.SerialNumbers

??What code goes here to enter the serial numbers??

RetVal = oDelivery.Add

Any help would be appreciated.