Skip to Content
0
Former Member
Feb 19, 2008 at 09:33 AM

Goods Receipt PO - addition thru DI API

1601 Views

Dear All,

I am using DIAPI for developing an addOn. In that I am adding record into Goods Reciept PO using oPurchaseDeliveryNotes business object.

I am attaching my coding for your reference.,

=========================================================================

Dim oInvGenEntry As SAPbobsCOM.Documents

oInvGenEntry = vcmp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseDeliveryNotes)

oInvGenEntry.CardCode = "V002"

oInvGenEntry.HandWritten = tNO

oInvGenEntry.DocDate = "19/02/2008"

oInvGenEntry.Lines.SerialNumbers.SystemSerialNumber = 111 oInvGenEntry.Lines.SerialNumbers.ManufacturerSerialNumber = 222 oInvGenEntry.Lines.SerialNumbers.InternalSerialNumber = 333

oInvGenEntry.Lines.SerialNumbers.BaseLineNumber = 0

oInvGenEntry.Lines.SerialNumbers.SetCurrentLine(i)

oInvGenEntry.Lines.SerialNumbers.Add()

oInvGenEntry.Lines.ItemCode = oItems.ItemCode

oInvGenEntry.Lines.ItemDescription = oItems.ItemName

oInvGenEntry.Lines.WarehouseCode = "01"

oInvGenEntry.Lines.Currency = CurrencyComboBox.SelectedItem

oInvGenEntry.Lines.Price = CDbl(PriceText.Text)

oInvGenEntry.Lines.Rate = 2

oInvGenEntry.Lines.ShipDate = Now

oInvGenEntry.Lines.Quantity = CDbl(QuantityText.Text)

oInvGenEntry.Lines.DiscountPercent = CDbl(DiscountText.Text)

oInvGenEntry.PaymentGroupCode = -1

oInvGenEntry.DocTotal = 1

RetVal = oInvGenEntry.Add()

If RetVal <> 0 Then

MsgBoxLabel.Text = ErrCode & " " & ErrMsg

end if

=========================================================================

When i am executing the above code i am getting error as below

[PDN1.WhsCode][line: 1] , 'P001 cannot be released from stock without a full selection of serial/batch no.'

I am able to add items without serial no. But I want a solution to add items with serial no.

Please help me to resolve this issue.

thanks

regards,

Benjamin Rosary.B