cancel
Showing results for 
Search instead for 
Did you mean: 

Inventory Gen Entry Error

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

edy_simon
Active Contributor
0 Kudos
,

Hi,

Can you try removing the oInvoiceDoc.Lines.Add()?
Other than that, can you create the GenEntry for this item manually from SAP ?

Regards

Edy

Former Member
0 Kudos

Hi,

Tried removing oInvoiceDoc.Lines.Add() but still get the same error.

Already created the GenEntry for this item manually with no problem at all.

Could there be something missing in the configuration of the inventory?

Thanks!

edy_simon
Active Contributor
0 Kudos

It does not look like your code, most probably is data problem.

Can you try removing GroupNumber, or other fields just to see what causes the problem.


Regards

Edy

Former Member
0 Kudos

I was able to create an exit when I deleted the line that assigned the warehouse code.

Checked the item code configuration and it doesn't have a default warehouse assigned.

If I have stock in two different warehouses, it assignes warehouse 01.

It is really important for me to indicate a specific warehouse.

Thanks for your help!

edy_simon
Active Contributor
0 Kudos

Hi Ines,

I see, The warehouse code is of type string.
In your code, you assigned it as integer 1.
Do you have a warehouse code "1" ? or should it be "01" ?

Regards
Edy

Former Member
0 Kudos

Thank you very much that fixed my problem!