cancel
Showing results for 
Search instead for 
Did you mean: 

Can't add a goods-issue with more than one item and one is serial managed.

Former Member
0 Kudos

Hi,

We are trying to issue more than one item to a production order using the DI API. If none of the items is serial managed, they all are accepted and the goods-issue Add is successful. If one the items is batch-managed, the goods-issue Add is also successful. I am able to add the goods-receipt if I it contains only one item and it is serial-number managed. However, if I’m issuing more than one item and one or more of the items is serial number managed, then the DI API will not add the goods-issue. The error message that appears refers to an item that is not among the items being issued. The message is:

-10: (IGE1.WhsCode)(line: 3), ‘Item ‘A00006 ‘ with system serial 1 is not in stock.’

Again item A00006 is not even in the group of items being issued.

The code I am using for the serial number part is:

With oGoodsIssue.Lines.SerialNumbers

.SystemSerialNumber = rs.Fields.Item("SysSerial").Value

.ManufacturerSerialNumber = rs.Fields.Item("MfrSN").Value

.InternalSerialNumber = rs.Fields.Item("IntrSerial").Value

.SetCurrentLine(n)

.Add()

rs.MoveNext()

n += 1

End With

The rs is a recordset that the code is looping through as the serial numbers are being added.

The error message does not occur during this code. It occurs when it tries to add the full goods-receipt. Does anyone have any idea how I can fix this?

Thanks,

Mike

Edited by: Mike Angelastro on Mar 31, 2008 8:43 AM

Accepted Solutions (1)

Accepted Solutions (1)

former_member687054
Participant
0 Kudos

Hi Mike,

Try to do the ".Add" only if you need it. Doing a ".add" without assignation may cause the error you have.

I guess your n variable start at 1 or 0, so you could put code like this :

With oGoodsIssue.Lines.SerialNumbers

if n = 0 then (or 1, also I don't the correct syntax of your programming language)

.Add()

end if

.SystemSerialNumber = rs.Fields.Item("SysSerial").Value

.ManufacturerSerialNumber = rs.Fields.Item("MfrSN").Value

.InternalSerialNumber = rs.Fields.Item("IntrSerial").Value

.SetCurrentLine(n)

rs.MoveNext()

n += 1

End With

HTH

Jodérick

Answers (0)