Skip to Content
author's profile photo Former Member
Former Member

How to update serial number from DI API

Halo,

example I want to update serial number like this

update OSRI set IntrSerial = 'BBB' where IntrSerial = 'AAA'

here sample of my code using DI API

Public oItems As SAPbobsCOM.Items
Set oItems = oCompanyDI.GetBusinessObject(oItems)
????
oItems.SerialNum = 'BBB'
oItems.Update

but how do I know I'm in IntrSerial AAA ?

what code should I put in ???? to know I'm now in IntrSerial AAA ?

Thanks

Regards,

Arthur Siwan

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 31, 2007 at 07:43 PM

    Hi Arthur,

    I'm coding an addon right now that does a lot of work with items that are managed by serial number. I'm no expert on it whatsoever, but maybe we can help each other out.

    I'm surprised to learn that there is a serial number property on the OITM table. Serial numbers allow us to individually track each unit of the specific item, right? So if there are 15 "widgets" in the warehouse, we should have 15 serial numbers for that item in the OSRI table, so what good does having a serial number on the OITM table do?

    With that said, there is a serialnumbers object in the DI that gives you some access to table OSRI, but I don't believe that this object was meant to be accessed directly. It does not have a getbykey method, nor does it have an update method. I believe that we are meant to access this object via certain document objects like goods receipts, goods issues and documents. For instances the document_lines object has a serialnumbers object. (It also has a serial number field property, like OITM, but I don't get this, either.). So theoretically, anyway, you should be able to access the rows in OSRI through the document lines. For instance on a delivery note if I have one line item that sells 3 'wdigets', I would think that the lines object would give me a serialnumbers object that would let me get at the three serial numbers that the user assigned to that sale. The problem is, that at least via the goods receipt lines object, that doesn't work (the object seems to be returned, but none of the properties are loaded.

    Why do you want to change an existing serial number anyway?

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.