Skip to Content
0

Inventory Gen Entry Error

Jan 04, 2017 at 09:16 PM

100

avatar image

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
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Edy Simon Jan 05, 2017 at 01:55 AM
0
,

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

Show 5 Share
10 |10000 characters needed characters left characters exceeded

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!

0

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

0

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!

0

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

0

Thank you very much that fixed my problem!

0