cancel
Showing results for 
Search instead for 
Did you mean: 

Adding Item managed by serial no.s to Delivery Document

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Nussi
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hi David,

Thanks a lot for your explanation.

Have a nice day!

Regards,

Geetha

Answers (0)