on 07-23-2005 2:00 AM
hi i have tried to add a serial and batch item using the oInvGenEntry object with the codes below. somehow i keep getting the "item has no serial number management" error. the item has been set to be managed by serial and batch respectively. the strange thing is that with the same code i can add either serial or batch item. but not both. for my oInvGenExit codes it is the same but it can accept serial and batch items together. sorry for my bad english 😛
oInvGenEntry = SBOUtility.oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInventoryGenEntry)
currentLine = 0
batchrow = 0
serialrow = 0
oInvGenEntry.Lines.SerialNumbers.SystemSerialNumber = 1
oInvGenEntry.Lines.SerialNumbers.InternalSerialNumber = ""
oInvGenEntry.Lines.SerialNumbers.ManufacturerSerialNumber = ""
oInvGenEntry.Lines.SerialNumbers.SetCurrentLine(0)
oInvGenEntry.Lines.SerialNumbers.Add()
oInvGenEntry.Lines.ItemCode = "1005"
oInvGenEntry.Lines.ItemDescription = ""
oInvGenEntry.Lines.Quantity = 1
oInvGenEntry.Lines.Price = 12
oInvGenEntry.Lines.WarehouseCode = "01"
oInvGenEntry.Lines.SetCurrentLine(0)
currentLine += 1
oInvGenEntry.Lines.Add()
oInvGenEntry.Lines.BatchNumbers.BatchNumber = "wer"
oInvGenEntry.Lines.BatchNumbers.Quantity = 1
oInvGenEntry.Lines.BatchNumbers.SetCurrentLine(0)
oInvGenEntry.Lines.BatchNumbers.Add()
oInvGenEntry.Lines.ItemCode = "1006"
oInvGenEntry.Lines.ItemDescription = ""
oInvGenEntry.Lines.Quantity = 1
oInvGenEntry.Lines.Price = 12
oInvGenEntry.Lines.WarehouseCode = "01"
oInvGenEntry.Lines.SetCurrentLine(1)
currentLine += 1
oInvGenEntry.Lines.Add()
Dim ErrCode As Integer
Dim temp, ErrMsg As String
ErrCode = SBOUtility.oCompany.GetLastErrorCode()
If ErrCode <> 0 Then
SBOUtility.oCompany.GetLastError(ErrCode, ErrMsg)
End If
oInvGenEntry.PaymentGroupCode = -1
oInvGenEntry.DocTotal = 2
oInvGenEntry.Series = "17"
oInvGenEntry.DocCurrency = "USD"
Dim ret As Integer = oInvGenEntry.Add()
SBOUtility.oCompany.GetNewObjectCode(temp)
ErrCode = SBOUtility.oCompany.GetLastErrorCode()
If ErrCode <> 0 Then
SBOUtility.oCompany.GetLastError(ErrCode, ErrMsg)
End If
Adding serial or batch managed items through the SBO client implies 2 different transactions (1 transaction for serial managed items, 1 for batch managed items). Thus it using the DI API (SBO's logic remains the same) does not allow a transaction which has both serial and batch managed items.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
9 | |
8 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.