Skip to Content
0
Jan 04, 2017 at 09:16 PM

Inventory Gen Entry Error

401 Views

Hello,

I have been trying to create an Inventory Gen Entry but keep getting the same error:

"Internal Error (-5002) occurred."

I would really appreciate if someone could help me!

Thanks!

Here's my code:

Dim oInvoiceDoc As SAPbobsCOM.Documents             
oInvoiceDoc = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInventoryGenExit)
oInvoiceDoc.Series = 22
oInvoiceDoc.DocCurrency = USD
oInvoiceDoc.Reference2 = "Ref2"
oInvoiceDoc.GroupNumber = -1
oInvoiceDoc.Lines.ItemCode = "LIC-AXWAY-0039"                     
oInvoiceDoc.Lines.Quantity = 1
oInvoiceDoc.Lines.UnitPrice = 100.0
oInvoiceDoc.Lines.AccountCode = "_SYS00000000239" 
oInvoiceDoc.Lines.WarehouseCode = 1                     
oInvoiceDoc.Lines.CostingCode = "VG" 
oInvoiceDoc.Lines.Add() 
Dim nAddResult As Long
nAddResult = oInvoiceDoc.Add