on 04-09-2008 1:52 PM
Hello Experts,
Can you please help me in the following?
I'll appreciate your help.
I want to add items managed by Serial Number to delivery document (using DI API).
We have a set of internal serial numbers to be used for those items.
For E.g, we have to add an item with code A0001, quantity of 2, with internal serial numbers to be used 00080,00090
to the delivery document.
(We allow the user to specify the internal serial numbers to be used).
I'm not sure how to get the system serial number for this item.
I believe OSRI has the Serial No/Internal serial no. for each item, w.r.t the marketing documents. (Is each item has its own set of system serial nos & internal serial no.s? From where we need to take it?)
Can you please post if you have any sample code?
(If possible, can you please explain me the relationship between OSRI and marketing documents, and oitem)
Thanks a lot.
Regards,
Geetha
Code that I'm using:
Private Function UpdateSerialNumbers(ByRef objSerialNumbers As SAPbobsCOM.SerialNumbers, ByVal strShpReqNm As String, ByVal strShpReqRw As String) As Boolean
'Get the values of Internal Serial numbers from our table, into this RS.
....
If objRS.RecordCount > 0 Then
objRS.MoveFirst()
Dim i As Integer
If objSerialNumbers.Count <= 0 Then SerialNumbers.Add()
For i = 0 To objRS.RecordCount - 1
Dim strTmp As String
strTmp = objRS.Fields.Item(0).Value() & ""
objSerialNumbers.SetCurrentLine(i)
objSerialNumbers.InternalSerialNumber = strTmp 'e.g 00080
'Need your help in this step
objSerialNumbers.SystemSerialNumber = objCommon.GetNextKeyValue("OSRI", "SysSerial")
objRS.MoveNext()
If Not objRS.EoF Then
SerialNumbers.Add()
End If
Next
End If
End If
return true
End Function
Function CallingFn() as boolean
.....
UpdateSerialNumbers(objDLDoc.Lines.SerialNumbers, objHeaderInfo.ShipReqNum, strTmp)
objDLDoc.Add
End Function
Geetha,
let me explain you shortly how the serial data is stored in the database
OSRI - Serial Numer for Items
SRI1 - Serial No. Trans. for Item
OSRI and SRI1 are "connected" by SysSerial
SRI1 is connected to the Document Tables Lines (INV1, DLN1, ...)
with BaseType, BaseNum and BaseLinNum to the Document
a Serial Number is Unique - 1 SerialNr = 1 Quantity (thats the difference to Batches)
regards
David
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
102 | |
12 | |
11 | |
6 | |
6 | |
4 | |
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.