OInvGenEntry adding serial/batch error

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 :P
  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.

Similar Messages

  • Adding new Batch Number to AP Invoice

    i am working on adding new batch number to an existing AP IN by SDK function. I try the following codes, no errors prompt but also nothing updated. Can anyone advise me how to add new batch number to AP Invoice? Many Thanks!
    Dim ErrMsg As String
    Dim ErrCode As Integer
    Dim opch As SAPbobsCOM.Documents
    opch = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseInvoices)
    opch.GetByKey(5)
    opch.Lines.BatchNumbers.Add()
    opch.Lines.BatchNumbers.BatchNumber = "3"
    opch.Lines.BatchNumbers.Quantity = 3
    ret = opch.Update
    If ret <> 0 Then
          oCompany.GetLastError(ErrCode, ErrMsg)
          MsgBox(ErrCode & " " & ErrMsg)
    End If

    Hi ,
    Steps to do:
    1.Create an User Defined Field on Document Row Level:
    Name: Serial / Batch Details
    Type: Alphanumeric
    Structure: Text
    - Create a Formatted Search which will populate the data from Delivery note.
    - Put the UDF into the Print Layout of Delivery Order.
    Displaying Batch Details
    2.   Decide with information is needed from Batch details to be printed out on A/R Invoice
    On Bacth Details form (Inventory\Item Management\Batches\Batch Details) we can see all the possible details.
    - Batch Number
    - Delivered Quantity
    - Expiration Date
    3.    Build the formatted search SQL command.
    By a SQL cursor driven result set we can build a text which contains the list of the delivered batch details separated by new lines. The relations between A/R Invoice and Delivery note is defined on A/R Invoice Form. in columns 45, 46, and 43 
    declare @batch as nvarchar(100)
    declare @txt nvarchar(max)
    set @txt = ''
    declare P cursor for SELECT T0.[BatchNum] + space(1)
      + cast(cast(T1.[Quantity] as decimal(19,2)) as nvarchar)
      + space(1) + case when T0.[ExpDate] is null then '' else convert(nvarchar,T0.[ExpDate],102) end
      FROM OIBT T0 INNER JOIN IBT1 T1 ON T0.ItemCode = T1.ItemCode and T0.WhsCode = T1.WhsCode
      and T0.BatchNUm = T1.BatchNum
      WHERE T1.[BaseEntry] =$[$38.45.0] and T1.[BaseLinNum] =$[$38.46.0]
    open P
    fetch next from P into @batch
    while @@fetch_status = 0
    begin
    set @txt = @txt '\n'@batch +','
    fetch next from P into @batch
    end
    close P
    deallocate P
    select @txt
    4. Defined the formatted search on the A/R Invoice.

  • Serial/batch numbers  Problem

    Hi  All,
    I am trying to Genetate  a goods receipt  through Code .
    when i m trying to generate it gives me error like
    You should use existing serial/batch numbers for this document type
    But i have to create new serial/batch
    so what can i do over here.
    Hari

    Hi Hari,
    In 2007 version, there is a change in SystemSerialNumber Property
    When you set this property (SystemSerial Number)it means that you want
    to use an existing serial number
    If the system serial number does not exist, any action will fail.
    When you do not set this properyt (empty) it means that you want to
    create a new serial number
    You cannot provide a system number of your choice to create a new
    serial number
    Regards,
    Vijay Kumar
    SAP Business One Forums Team

  • ODeliveryNotes serial nbr error when using sales BoM with DI server

    Hi all,
    we're trying to create a delivery note with DI server for items managed by serial number and sales bom.
    This is a sample xml:
    <?xml version="1.0" encoding="utf-16"?>
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
    <env:Header>
    <SessionID>F6166595-C4E0-4B5E-B44C-85CB04FAA0C9</SessionID>
    </env:Header>
    <env:Body>
    <dis:AddObject xmlns:dis="http://www.sap.com/SBO/DIS" CommandID="ConsegnaOpen">
    <BOM>
    <BO>
    <AdmInfo>
    <Object>oDeliveryNotes</Object>
    </AdmInfo>
    <Documents>
    <row>
    <CardCode>C9999</CardCode>
    </row>
    </Documents>
    <Document_Lines>
    <row>
    <ItemCode>S610STW-220</ItemCode>
    <Quantity>220</Quantity>
    </row>
    </Document_Lines>
    <SerialNumbers>
    <row>
    <InternalSerialNumber>AD00003</InternalSerialNumber>
    <SystemSerialNumber>3</SystemSerialNumber>
    <BaseLineNumber>1</BaseLineNumber>
    </row>
    </SerialNumbers>
    </BO>
    </BOM>
    </dis:AddObject>
    </env:Body>
    </env:Envelope>
    And this is the returned error: "You should use existing serial/batch numbers for this document type [(----) 29-51]"
    Any idea why?
    Thanks
    Fabio

    Hello Fabio,
    I have tested your problem with DI API, and I got the same error you have.
    This is an uncovered system functionality or system limitation
    Report this issue to SAP Support.
    My DI API COde
    Dim oDN As SAPbobsCOM.Documents = oCompany.GetBusinessObject(BoObjectTypes.oDeliveryNotes)
            oDN.CardCode = "1013"
            oDN.DocDate = Date.Today()
            oDN.DocDueDate = Date.Today()
            oDN.VatDate = Date.Today()
            oDN.TaxDate = Date.Today()
            oDN.Lines.SetCurrentLine(0)
            oDN.Lines.ItemCode = "TBOM"
            oDN.Lines.WarehouseCode = "2"
            'oDN.Lines.SetCurrentLine(2)
            oDN.Lines.SerialNumbers.SetCurrentLine(0)
            oDN.Lines.SerialNumbers.ManufacturerSerialNumber = "1"
            oDN.Lines.SerialNumbers.InternalSerialNumber = "1"
            oDN.Lines.SerialNumbers.SystemSerialNumber = "1"
            oDN.SaveXML("c:TEMPDNWITHBOOM.xml")
            If oDN.Add <> 0 Then
                sbo_application.MessageBox(oCompany.GetLastErrorDescription)
            End If
    Where TBOM is a sales kit, for 12 peices, components TNM item no serial number 12 peice, TSN item using serial number 1 piece.
    Sales Factor 1 for TBOM is 12 piece
    This sample code results the same issue you hev reported.
    Edited by: János Nagy on Apr 14, 2010 4:49 PM

  • I have the appropriate Adobe Acrobat 9 Standard software and a valid SN for that software; however, am getting an "Invalid Serial Number" error on installation...please help

    I have the appropriate Adobe Acrobat 9 Standard software and a valid SN for that software; however, am getting an "Invalid Serial Number" error on installation...please help

    Hi James ,
    Make sure you are entering the correct serial number.Try it once again and check.
    If it fails please get in touch with Adobe Support.Here is the link for the same.
    https://helpx.adobe.com/adobe-connect/kb/connect-chat-support.html
    Regards
    Sukrit Dhingra

  • Invalid,serial,number,error,when,attempting,installation,of,photoshop,CS,how,can,i,fix,ple ase?

    I cannot install creative suite cs2 the message invalid,serial,number,error appears; does anyone know how I can fix,please? The download is from the Adobe site using the serial number they provide prior to downloading

    To locate the serial number:
    http://helpx.adobe.com/x-productkb/global/find-serial-number.html
    Serial number and activation chat support (non-CC)
    http://helpx.adobe.com/x-productkb/global/service1.html ( http://adobe.ly/1aYjbSC )

  • I am getting an invalid serial number error for Adobe Acrobat XI

    Hi -
    My principal has ordered a copy of Adobe Acrobat XI for a school computer. The disc came with a serial number for a Mac installation, which he is hoping to install on his macbook air. I am using Remote Disc to install it.
    However, the serial number that comes both on the invoice and on the back of the CD sleeve is only 23 digits long and when entered gives an Invalid Serial Number error. I would love it if somebody from Adobe could contact me and get a replacement serial number that would be valid for the installation.
    I'm not going to post the serial number here because of reasons.

    You need to contact Adobe Support directly.  For the link below click the Still Need Help? option at the bottom and choose the chat option...
    http://helpx.adobe.com/x-productkb/global/service1.html
    Phone support | Orders, returns exchanges
    http://helpx.adobe.com/x-productkb/global/phone-support-orders.html

  • Have lightroom 5 hard copy and just got a mac.  downloaded the trial version of LR5 from the web, but it will not take my serial number.  gives me an invalid serial number error

    i have had lightroom 5 for some time now, and have used on my pc.  I just got a mac (no disc drive) so I downloaded the trial version of LR5 from the adobe site.  Once installed, i tried to key in my serial number. 
    I get an invalid serial number error.
    has anyone ran into this before?

    Serial number and activation support (non-CC)
    http://helpx.adobe.com/x-productkb/global/service1.html ( http://adobe.ly/1aYjbSC )

  • I am trying to download a disc verion of Elements 11 to my desktop and receiving serial number error

    Hello, I am trying to download my Adobe Photoshop Elements 11 disc on my desktop computer.  I am receiving a serial number error message.  I loaded this disc on my laptop last night without any problems.  Any help would be appreciated.

    It is telling me that the seriel number is invalid and I know that it is not as I registered it and am entering exactly as I did on my laptop.

  • Old computer died, can't activate Lightroom on new computer. Invalid serial number error.

    My old computer fried. Obviously, didn't deactivate Lightroom. Installed Lightroom on new computer but can't activate... getting invalid serial number error. Trying to get thru to Adobe is a joke. Help.

    Most likely, you downloaded the Creative Cloud version of Lightroom which will not accept your serial number. You need to uninstall it, reboot, then download the standalone version of Lightroom and install that.

  • Common batch errors

    Hello all,
    I have been monitoring batch process chains for just over 2 months now and there seems to be a new error associated with a full and/or delta load etc everyday.
    Does anybody have a tutorial/file etc on common batch errors and how to solve them.
    Thank you and kind regards,
    Keith

    Hello Keith,
    check out these:
    /people/siegfried.szameitat/blog/2005/07/28/data-load-errors--basic-checks
    /people/sap.user72/blog/2005/04/19/logistic-cockpit-a-new-deal-overshadowed-by-the-old-fashioned-lis
    /people/sap.user72/blog/2005/02/14/logistic-cockpit--when-you-need-more--first-option-enhance-it
    /people/sap.user72/blog/2005/01/19/logistic-cockpit-delta-mechanism--episode-three-the-new-update-methods
    /people/sap.user72/blog/2004/12/23/logistic-cockpit-delta-mechanism--episode-two-v3-update-when-some-problems-can-occur
    Hope it helps..
    thanks,

  • Fresh install of cs 2, invalid serial number error

    My version of CS wont register anymore. I was directed to install version CS2 from the website download section. I uninstalled CS from windows 7 and installed CS2 using the supplied installer. I used the supplied serial number only to get a inavlid name, company, or serial number error, and the program shuts down. Online help was of no help other than walking me through another fresh install of the program ending up with the same results.
    Is the problem in the registry? and if so how do I clean it without disrupting other programs?

    To locate the serial number:
    http://helpx.adobe.com/x-productkb/global/find-serial-number.html
    Serial number and activation chat support (non-CC)
    http://helpx.adobe.com/x-productkb/global/service1.html ( http://adobe.ly/1aYjbSC )

  • Batch error in output.

    Dear Gurus,
    I am getting batch error while giving the output. We have batch split funcionality that was working fine upto now. Working on next rollout. But, this time system is also looking for batch in the batch header item and terminating the process. Now, even the previous invoices are not being printed. Any idea what got changed that is trigerring this error?
    Regards,
    Manu

    Hi Manu
    But as you said in your previous thread that you are getting error Batch Error while giving output ,
    So Check the following data :
    1) Go to Output type details and check wheather background job has been checked or not
    2) Check wheather any smartforms is assigned or not , if any smartforms are assigned then remove that smartforms and then check
    3) Also check in the output procedure details  which you have assigned to the document type  wheather any Requirement has been assigned to the output type or not
    4) Also check the key combination you have assigned to the access sequence and that access sequence assigned to the output type
    Regards
    Srinath

  • Available Serial/Batch Number under the bin location

    Hi Expert,
    When applying bin location in SBO 9. Each line need to select particular bin location for counting. Now, i encounter a problem to list out the available serial/batch number under the bin location.
    i am able to get the list of serial number but lacking the bin location filter.
    SELECT ROW_NUMBER() OVER (ORDER BY T2.ItemCode) AS 'RowHeader', T2.ItemCode, T0.BinEntry ,
    UPPER(T2.DistNumber) AS 'MnfSerial', T2.InDate, T1.WhsCode FROM OSRQ T1 INNER JOIN OSRN T2
      ON T1.SysNumber = T2.SysNumber AND T1.ItemCode = T2.ItemCode
      INNER JOIN INC1 T0 ON T0.DocEntry = 1
    WHERE T1.Quantity > 0 AND T1.ItemCode IN (SELECT ItemCode from
    INC1 WHERE DocEntry =1)

    Hi,
    Check these tables :
    OSBQ
    OBBQ
    Regards
    Edy

  • Selected Serial/Batch Management Method can't be canged

    Dear All,
    I could not change selected serial/batch management method. it is blocked. is it possbile to change it ? Let me know.
    Rgds,
    Edu

    Hello,
    I copied the answer directly from SAP Notes, here it is :
    The option to change the method specified in the Manage Item by field is blocked both from within the application and via the DI, unless all the following conditions are fulfilled:
    The In Stock (=on hand) quantity of the item must be zero in each and every warehouse.
    The available quantity of serial numbers created for the item must be zero in each and every warehouse.
    The available quantity of batch numbers created for the item must be zero in each and every warehouse, as well as:
              o There are no open Sales Orders for this item with allocated batch numbers.
              o There are no open A/R Reserve Invoices for this item with allocated batch numbers.
    The following queries provide you with relevant information about the items you maintain in your database (relevant for SAP Business One 2005 A SP01 PL: 18 and higher):
       1. To find all items that are currently managed by batches and can NOT be changed to "not managed by batch", generate the following query:
    select distinct t0.itemcode, sum(isnull(t1.onhand,0)) in_stock, sum(isnull(t2.quantity,0)) on_batch, sum(isnull(t2.IsCommited,0)) allocated
    from OITM T0 INNER JOIN OITW T1 ON T0.ItemCode = T1.ItemCode
    INNER JOIN OIBT T2 ON T0.ItemCode = T2.ItemCode and t1.whscode = t2.whscode
    where t0.manbtchnum = 'Y'
    group by t0.itemcode
    having (sum(isnull(t1.onhand,0)) <> 0 or sum(isnull(t2.quantity,0)) <> 0 or sum(isnull(t2.IsCommited,0)) <> 0)
       1. To find all items that are currently managed by serial numbers and can NOT be changed to "not managed by serial numbers", generate the following query:
    select distinct t0.itemcode, sum(isnull(t1.onhand,0)) in_stock,
    count(status) available_serials
    from OITM T0 INNER JOIN OITW T1 ON T0.ItemCode = T1.ItemCode
    INNER JOIN OSRI T2 ON T0.ItemCode = T2.ItemCode and t1.whscode =
    t2.whscode
    where t0.mansernum = 'Y' and t2.status = 0
    group by t0.itemcode
    having (sum(isnull(t1.onhand,0)) <> 0 or count(status) > 0)
    Let me know if you need further assistance.
    JM

Maybe you are looking for

  • Query adf uix

    Hello I've 2 pages uix (xml format). In the first page (source.uix) I've a combobox and I can select a number that represents an record identifying . In the same page there's a submit buttom with destination to other page (record.uix). I'd like in th

  • Iphoto - organizing Pictures into albums

    In iphoto, I drag photos to an album and it bounces back.  Album won't take it, like its full.  I've been doing it all night and all of a sudden I cant add anymore. Any help

  • How to add one second to a date time stamp

    What is the proper syntax to add one second to a date/timestamp?

  • Trial Acrobat XI

    Having trouble downloading trial of Adobe Acrobat XI.  I am on a Windows 8 platform, using Chrome.  When I hit the "start trial" button, screen freezes.

  • Exicse invoice tab coming in MIGO while posting GR against PO w/o material

    Hi guys, We Were creating the PO with only short text, Created the std PO without material, with only text with account assignment" K". The perticular vendor is not menationed in J1ID, We are not found any blank chapter id in Material and chapter id