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

Similar Messages

  • Error when using Oracle Migration WorkBench (Sql Server 2k to Oracle 8i)

    I'm trying to migrate a Sql Server 2k database to an Oracle 8i schema using OMWB. After using BCP to collect metadata information on the source database, I tried to capture the source data model and got a "Capture aborted" message on the progress screen (even though then it appears a dialog window reporting "0 errors and 0 warnings", funny!). Down there is the error log OMWB generated. After reading some posts, I changed some columns of the OMWB dictionary that holds the source database name, but still got the same error. If someone can enlighten me on this toppic, I'd greatly appreciated it.
    Here's the error log of OMWB:
    ** Oracle Migration Workbench
    ** Production
    ** ( Build 20050629 )
    ** OMWB_HOME: D:\Datos\Download\Oracle\Oracle Migration Workbench\omwb
    ** user language: es
    ** user region: null
    ** user timezone:
    ** file encoding: Cp1252
    ** java version: 1.4.2_04
    ** java vendor: Sun Microsystems Inc.
    ** o.s. arch: x86
    ** o.s. name: Windows 2000
    ** o.s. version: 5.0
    ** Classpath:
    ..\lib\boot.jar
    ** Started : Fri Feb 23 17:18:48 GMT-03:00 2007
    ** Workbench Repository : Oracle8i Enterprise Edition Release 8.1.6.0.0 - Production
    With the Partitioning option
    JServer Release 8.1.6.0.0 - Production
    Repository Connection URL: jdbc:oracle:thin:@ServerCms:1521:sigcewbc
    ** The following plugins are installed:
    ** Microsoft Access 2.0/95/97/2000/2002/2003 Plugin, Production Release 10.1.0.4.0
    ** Microsoft SQLServer 2000 Plugin, Production Release 10.1.0.4.0
    ** Microsoft SQLServer 6.5 Plugin, Production Release 10.1.0.4.0
    ** Microsoft SQLServer 7.0 Plugin, Production Release 10.1.0.4.0
    ** Active Plugin : SQLServer2K
    EXCEPTION :SQLServer2KDisconnSourceModelLoad.loadSourceModel(): oracle.mtg.migration.MigrationStopException: java.lang.IndexOutOfBoundsException: Index: 15, Size: 15
    ** Shutdown : Fri Feb 23 18:00:50 GMT-03:00 2007

    Duplicate thread
    Error when using Oracle Migration WorkBench (Sql Server 2k to Oracle 8i)

  • -t2cGetCharSet error when using thick client with 1.0.0.15.57

    I think I have found a bug in 1.0.0.15 related to accessing a database using the thick client. I have tested this with 1.0.0.14 release of SQLDeveloper and that version DOES work OK.
    Simply put, I try connecting to a database using the 10g Client on Windows XP and I get "Failure: -t2cGetCharSet" error when running 1.0.0.15.57. I must use 10g thick client so that I can use encyption between the client and the database. 9i thick client doesn't work between Windows and Linux when using encryption. Also, instant client isn't an option; it doesn't support Advanced Security Option (encryption).
    I DID test without encryption enabled to eliminate that as a possible cause and the results were the same.
    If need be, I could back down to 1.0.0.14, but I would prefer not to.

    See:
    Re: TNS Connection Issues
    Raptor does not find My tnsnames
    If don't to solve your problem, let us to know.

  • Unknown namespace prefix Error - when using custom Aliases with RDF aliases

    I am getting unknown namespace prefix error when I use custome SEM_ALIAS with rdf SEM_ALIAS. It seems once you specify custom SEM_ALIAS, the default rdf alias is not recognized. Following are the details of queries
    I have a sem_Model "test" which has "event" as a class and "Merger" as a sub-class of event, with "acquiringorg" as a property having the domain "org". "Org" is also defined as a class with the literal attribute "hasname". I have added one instance of "merger" class with appropriate values for "acquiringorg" property. There is one instance or "Org" as well for reference in the instance above.
    the following query(return all objects having property "acquiringorg" and its .e. "hasName" attribute for the object) runs fine and returns appropriate resultset
    select x event,z acquiringorg ,l acquireeorg from table(SEM_MATCH(
    '(?x Evnt:AcquiringOrg ?y)(?k orgn:hasName ?l)',
    SEM_MODELS('test'),
    null,
    SEM_ALIASES(SEM_ALIAS('Evnt','http://www.abc.com/Event/Merger/'),
    SEM_ALIAS('orgn','http://www.abc.com/Org/')),
    null));
    However when I want to add another criteria i.e. show me events of type merger(?x rdf:type :Merger) , the query fails with the "unknown namespace prefix error" as above
    select x event,z acquiringorg ,l acquireeorg from table(SEM_MATCH(
    '(?x rdf:type :Merger)(?x Evnt:AcquiringOrg ?y)(?k orgn:hasName ?l)',
    SEM_MODELS('test'),
    null,
    SEM_ALIASES(SEM_ALIAS('Evnt','http://www.abc.com/Event/Merger/'),
    SEM_ALIAS('orgn','http://www.abc.com/Org/')),
    null));
    specifying "rdf" ALIAS explicitly also does not work
    select x event,z acquiringorg ,l acquireeorg from table(SEM_MATCH(
    '(?x rdf:type :Merger)(?x Evnt:AcquiringOrg ?y)(?k orgn:hasName ?l)',
    SEM_MODELS('test'),
    null,
    SEM_ALIASES(_SEM_ALIAS('rdf', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'),_
    SEM_ALIAS('Evnt','http://www.abc.com/Event/Merger/'),
    SEM_ALIAS('orgn','http://www.abc.com/Org/')),
    null));
    I am unable to figure out why default namespace i.e. rdf is returning this error
    Stuck at this point badly!!Any pointers would be useful!!

    Full error details are as below
    ORA-29532: Java call terminated by uncaught Java exception: oracle.spatial.rdf.server.ParseException: Unknown namespace prefix ''
    ORA-06512: at "MDSYS.RDF_MATCH_IMPL_T", line 153
    ORA-06512: at "MDSYS.RDF_MATCH_IMPL_T", line 842
    ORA-06512: at "MDSYS.RDF_MATCH_IMPL_T", line 235
    ORA-06512: at line 1
    29532. 00000 - "Java call terminated by uncaught Java exception: %s"
    *Cause:    A Java exception or error was signaled and could not be
    resolved by the Java code.
    *Action:   Modify Java code, if this behavior is not intended.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Mbx_bad_handle error when using ssh -X user name @ server name

    We have a Solaris 10 server that we're migrating an old Cadre Teamwork application to. We find that when users on Sun workstations use ssh -X <username>@<new server> and run Teamwork on this new server it is fine.
    When cygwin users and linux users run ssh -X to get to this new platform they initially get some positive feedback but they then receive the following error message:
    ==> teamwork
    teamwork
    Copyright 1984-1996.
    Cadre Technologies Inc., a wholly owned subsidiary of Cayenne Software, Inc.
    All Rights Resereved.
    Date: Tue Feb 24 11:06:16 EST 2009
    Version: TeamWork 7.1.1
    ERROR: 11:06:20 24 Feb 09 HOST usat0x49 (NODE 842c0c1a)
    Exception in interactive_sim: MBX_NO_SERVER_FOR_MAILBOX
    ERROR: 11:06:20 24 Feb 09 HOST usat0x49 (NODE 842c0c1a)
    EXC_PANIC -- Raise: No Context
    Exception = 'MBX_BAD_HANDLE'
    Traceback:
    Can someone help explain why this is happening and what we need to do to correct the problem?
    Thanks!
    M. Meadows

    We have a Solaris 10 server that we're migrating an old Cadre Teamwork application to. We find that when users on Sun workstations use ssh -X <username>@<new server> and run Teamwork on this new server it is fine.
    When cygwin users and linux users run ssh -X to get to this new platform they initially get some positive feedback but they then receive the following error message:
    ==> teamwork
    teamwork
    Copyright 1984-1996.
    Cadre Technologies Inc., a wholly owned subsidiary of Cayenne Software, Inc.
    All Rights Resereved.
    Date: Tue Feb 24 11:06:16 EST 2009
    Version: TeamWork 7.1.1
    ERROR: 11:06:20 24 Feb 09 HOST usat0x49 (NODE 842c0c1a)
    Exception in interactive_sim: MBX_NO_SERVER_FOR_MAILBOX
    ERROR: 11:06:20 24 Feb 09 HOST usat0x49 (NODE 842c0c1a)
    EXC_PANIC -- Raise: No Context
    Exception = 'MBX_BAD_HANDLE'
    Traceback:
    Can someone help explain why this is happening and what we need to do to correct the problem?
    Thanks!
    M. Meadows

  • ORA-03113 error when using Oracle 9i with Mapx 5.0

    Hello,
    I am using Personal Oracle 9i Release 2 with Mapx5.0 on Delphi.
    Accessing the layers using tab files also as server layers..,
    and commonly using the method of Mapx Layer.SearchAtPoint
    Search is done on region, line as well as on point objects...,
    at some point of time it flashes me the error
    ORA-03113 end-of-file on communication channel
    I am not exactly able to figure out when it gives..,
    but i m getting it after some clicks on the layers
    The same executable is working fine with Oracle 8.1.7
    As anybody faced such a problem and knows the possible cause
    Thanks,
    Binoy

    There is some java bug that is causing some problems if you are using 9.2.0.3. Here is some information:
    Workaround for bug 2755842:
    Event 10499 can be set (any non-zero level) to revert to the old behaviour.
    ==================================================
    Setting the EVENT 10499
    =======================
    Check if the database server is using a server parameter (spfile) a parameter (init.ora) file.
    From sqlplus, connect as sysdba and execute the command:
    show parameters spfile
    If the value is NULL or empty, then spfile is NOT enabled and init.ora is used.
    1) If SPFILE is used:
    SQL> show parameters spfile
    NAME TYPE VALUE
    spfile string
    %ORACLE_HOME%\DATABASE\SPFILE%ORACLE_SID%.ORA
    a) Using sqlplus logon as sysdba
    b) Execute: alter system set event="10499 trace name context forever,level 4" scope=spfile
    sid='*';
    c) shutdown
    d) startup the database
    2) If INIT.ORA is used:
    a) In the init<SID>.ora file, add the parameter event="10499 trace name context forever,level 4"
    b) Stop and start the database
    Hope this is it.
    Dan

  • Javascript error when using ExternalInterface.addCallback  with crossdomain swf file

    how can i use ExternalInterface.addCallback when using
    javascript access from Server A (html) to Server B (swf) ? coz it
    showing error?
    Server A
    192.168.0.10/XXX/example.html
    ===========
    <object
    classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
    id="MGSInsurances1" width="960" height="600"
    codebase="
    http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
    <param name="movie" value="
    http://192.168.0.22/MGS/flex/MGSInsurances1.swf"
    />
    <param name="quality" value="high" />
    <param name="bgcolor" value="#869ca7" />
    <param name="allowScriptAccess" value="always" />
    <embed src="
    http://192.168.0.22/MGS/flex/MGSInsurances1.swf"
    quality="high" bgcolor="#869ca7"
    width="960" height="600" name="MGSInsurances1"
    align="middle"
    play="true"
    loop="false"
    quality="high"
    allowScriptAccess="always"
    type="application/x-shockwave-flash"
    pluginspage="
    http://www.adobe.com/go/getflashplayer">
    </embed>
    </object>
    <script language="javascript">
    window.MGSInsurances1 =
    document.getElementById('MGSInsurances1');
    </script>
    Server B
    192.168.0.22/MGS/flex/MGSInsurances1.swf
    ==================
    Security.allowDomain("*");
    if(ExternalInterface.available)
    ExternalInterface.addCallback("onchange",onchange);
    ExternalInterface.addCallback("datachange",datachange);
    but javascript Error is showing "Unknown name", how can i fix
    it? urgent! somebody know this?

    i solved it! because i havent restart my server again! No
    Error again ! sorry for bothering everybody.

  • Getting Run-time error when using Client ADI with Office 2010

    Hi,
    We are unable to import journals from Client ADI when using Office 2010.
    Please let me know how to resolve this issue.
    Thanks,
    Pooja

    Duplicate post -- Client ADI display A runtime error in Office 2010

  • Error when using Analytic view with Input Parameters

    Hi,
    I am trying to create an info space based on my Analytic view which has input parameters. The infospace is validated and indexed without any issue. However when I ran the view, I get an error (50011) as it is unable to fetch any results. I tried using an infospace based on Calculation view with input parameters and the explorer view works without any issue.
    Has anyone faced similar issues?
    We are using HANA SP 6 rev 67 and BI 4.0 SP 4.
    Also is there a way to enable input prompts for the users when they refresh the BO Explorer view? If not currently available is there any work around ?
    Thanks

    Hello George,
    I don't have any personalization set on the info space. Also I am using mapped Account in BI to connect to HANA. The confusing part is that it is able to validate the infospace with the input parameters and index it. However query does not return any results. I even tried running the same query which explorer sends to HANA in the SQL editor and there too the same results,the query does not return anything. The model does return data when I do a data preview and if accessed from other tools like AAO.
    Also when I use SSO connection to HANA, indexing of the infospace fails. Where can I see the error log?
    Thanks,

  • Certificate Error when using pub services with IE7

    everytime i try to use pub services admin console i get the
    following warning im using IE7 any idea how to stop this nag ? :
    There is a problem with this website's security certificate.
    The security certificate presented by this website was not
    issued by a trusted certificate authority.
    Security certificate problems may indicate an attempt to fool
    you or intercept any data you send to the server.
    We recommend that you close this webpage and do not continue
    to this website.
    Click here to close this webpage.
    Continue to this website (not recommended).
    More information
    If you arrived at this page by clicking a link, check the
    website address in the address bar to be sure that it is the
    address you were expecting.
    When going to a website with an address such as
    https://example.com, try adding the 'www' to the address,
    https://www.example.com.
    If you choose to ignore this error and continue, do not enter
    private information into the website.

    hi,
    IE 7 has changed the way certificates were handled when
    compared to IE 6. In IE 6, the user gets an option to view the
    certificate before proceeding to view the site. In the process the
    user can import the certificate into the browsers trust store.
    Since CPS is deployed with a self signed certificate, in IE 7
    we get a certificate error.
    There is currently no workaround for the same, except to
    deploy cps war file on an application server that has a certificate
    signed by a signing authority
    thanks,
    sudharshan

  • SVG Security Error when using a swf with svg in a web application

    Anymap works fine when generating the swf, it's great !
    But when i try to use the swf in a web aplication, i have this error : SVG Security Error, check the web server cross-domain policy file allows access.
    I copied the .jpg and .svg at the good repertories.
    But i had this crossdomain:xml <?xml version="1.0"?>
    <!DOCTYPE cross-domain-policy SYSTEM
    "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
    <cross-domain-policy>
    <allow-http-request-headers-from domain="" headers="" secure="false" />
    <allow-access-from domain="*" secure="false" />
    </cross-domain-policy>
    Thanks in advance and sorry for my poor english.

    You might also want to turn on [Adobe Flash policy file logging|http://www.adobe.com/devnet/flashplayer/articles/fplayer9_security_05.html#_Using_Logging].
    We recommend uninstalling the Flash Player before installing the Debug Flash Player.
    Uninstall Flash Player using the following link:
    [http://download.macromedia.com/pub/flashplayer/current/uninstall_flash_player.exe|http://download.macromedia.com/pub/flashplayer/current/uninstall_flash_player.exe]
    Regards,
    Matt

  • Error when use Crytal Reports with Delphi.

    Delphi 2010  and CR2008
    When i code :
               Crpe1.ReportName := 'c:\temp\invoice.rpt';
               Crpe1.Output :=  toPrinter;
               Crpe1.Print;
    Problem with Print Method !
    Error : 538
    Error in File invoice.rpt:
    Parameter has invalid structure size.
    PrintOptions.GetCopies <PEGetPrintOptions>
    Pleave help me fix this error !

    Looks like you are using the VCL? Where did you get the VCL?
    I'd also like to draw yor attention to the following blogs;
    http://weblogs.sdn.sap.com/pub/wlg/14384? [original link is broken] [original link is broken] [original link is broken]
    Crytal Reports for Delphi Support
    /people/trevor.dubinsky/blog/2009/10/09/introduction-to-delphi-prism-applications-development
    /people/trevor.dubinsky/blog/2009/10/19/delphi-prism-how-to-setup-the-environment-for-crystal-reports-2008-and-bobj-enterprise-r3-development
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup

  • XSL Errors When Using AQ Adapter with EBS Business Events

    I am triggering a BPEL process with an Oracle EBS Business Event. After receiving the event, I am trying to perform an XSL transformation to extract parameters from the event. However, I keep getting XSL errors because the BE field ERROR_SUBSCRIPTION comes in containing invalid XML characters (#).
    It seems that BPEL or EBS do not properly escape the XML input. Is that a bug, or is there a way to work around this. I know I could filter the XML input in some way, but that seems likely to be more brittle to any future changes to the EBS BE message types.

    Adding to the above post, how will the PL/SQL program which triggers the Business Event ensure that the complete data is enqueued in the queue in form of XML?
    What will be the additional logic to send complete data in the XML format?

  • Error when trying to sync with publishing server

    Hi,
    I'm trying to run the Sync-AppVPublishingServer cmdlet on a Windows 7 client however I get the following error back:
    sync-appvpublishingserver : Application Virtualization Service failed to complete the requested operation.
    Operation attempted: RefreshPublishingServer.
    Windows Error: 0x80190194 -
    Error module: Publishing. Internal error detail: 45500D2780190194.
    Please consult AppV Client Event Log for more details.
    At line:1 char:1
    + sync-appvpublishingserver
    +
    + CatergoryInfo: InvalidResult; <:> [Sync-AppvPublishingServer], Client Exeception
    + FullyQualifiedErrorId: RefreshPublishingServerError,Microsoft.AppV.AppvClientPowerShell.SyncAppvPublishingServer
    In the error logs on the client, I get 2 that I can see:
    HttpRequest sendRequest failed.
    URL: http://appsvr:8080/
    Error code: 0x45500D27 - 0x80190194
    Getting server publishing data failed.
    URL: http://appsvr:8080/
    Error code: 0x45500D27 - 0x80190194
    Does anyone have any ideas how to fix this?
    For testing, I've turned off the firewall on both the client and server side and also all full access for 'Everyone' to the App-V share.
    Thanks

    what's the result if you enter the URL into a browser? 194[hex] = 404[dec]: HTTP File not found
    Falko
    Twitter
    @kirk_tn   |   Blog
    kirxblog   |   Web
    kirx.org   |   Fireside
    appvbook.com

  • Error in Loading Sales Bom

    Hi ..
    When im  loading Sales BOM from Sales Quotation to Invoice with Sales Bom  via SDK , im receiving this error message .
    " Error The complete Sales BOM, not just some of the components, must be copied to an A/R Invoice or a Delivery  [INV1.TreeType][line: 42] " , im basically transfering record by record from  Sales Quotation to Invoice
    But if i used the copy to function to invoice this Sales Quotation , i can be invoice
    I would like to know, whats is reason of this error message?
    thanks
    Loren

    Hi Yatsea
    Thank you for your response,
    Yes i followed some of the documents in the forum on how to add /copy a document to another document . My problem right now, if i will load 2 or more bom items on one invoice,  i receive the same errror "Error The complete Sales BOM, not just some of the components, must be copied to an A/R Invoice or a Delivery http://INV1.TreeTypeline: 42"
    but if a sepate the sales bom on different invoice (1 invoice = 1 Sales BOM) , the transaction goes well ....
    please see code
      start code -
        Private Function CreateInvoiceFromQuotation()
            Dim oInvoice As SAPbobsCOM.Documents
            Dim oSalesQuotation As SAPbobsCOM.Documents
            Dim rsForInvoice As SAPbobsCOM.Recordset ' A recordset object
            Dim rsFrInvDtls As SAPbobsCOM.Recordset ' A recordset object
            Dim oRecordCount As Integer
            Dim rUpdateStatus As SAPbobsCOM.Recordset
            Dim SQLStr As String
            Try
                rsForInvoice = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
                SQLStr = "SELECT OQUT.DocEntry,OQUT.DocDate, OQUT.DocDueDate, OQUT.CardCode, OQUT.NumAtCard, OQUT.Comments "
                SQLStr = SQLStr & "FROM [@TDOCPROC] INNER JOIN OQUT ON [@TDOCPROC].U_DocEntry = OQUT.DocEntry"
                rsForInvoice.DoQuery(SQLStr)
                oRecordCount = rsForInvoice.RecordCount
                Do While rsForInvoice.EoF = False
                    'oCompany.StartTransaction()
                    oInvoice = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices)
                    oInvoice.CardCode = rsForInvoice.Fields.Item("CardCode").Value
                    oInvoice.DocDate = rsForInvoice.Fields.Item("DocDate").Value
                    oInvoice.DocDueDate = rsForInvoice.Fields.Item("DocDueDate").Value
                    oInvoice.Comments = rsForInvoice.Fields.Item("Comments").Value
                    oInvoice.DocType = SAPbobsCOM.BoDocumentTypes.dDocument_Items
    details -
                    Dim StrFilter As String
                    Dim z As Integer
                    Dim RecCnt As Integer
                    Dim oInvNum As String = 0
                    rsFrInvDtls = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
                    StrFilter = "SELECT * FROM qut1 WHERE DOCENTRY =" & rsForInvoice.Fields.Item("DocEntry").Value & " order by linenum "
                    rsFrInvDtls.DoQuery(StrFilter)
                    RecCnt = rsFrInvDtls.RecordCount
                    z = 0
                    Do While rsFrInvDtls.EoF = False
                        Dim prodCode As String
                        prodCode = rsFrInvDtls.Fields.Item("ItemCode").Value
                        If z = 0 Then
                            oInvoice.Lines.ItemCode = rsFrInvDtls.Fields.Item("ItemCode").Value
                            oInvoice.Lines.ItemDescription = rsFrInvDtls.Fields.Item("Dscription").Value
                            oInvoice.Lines.WarehouseCode = rsFrInvDtls.Fields.Item("WhsCode").Value
                            oInvoice.Lines.Quantity = rsFrInvDtls.Fields.Item("Quantity").Value
                            oInvoice.Lines.UnitPrice = rsFrInvDtls.Fields.Item("Price").Value
                            oInvoice.Lines.CostingCode = rsFrInvDtls.Fields.Item("OcrCode").Value '--- Profit Center             
                            ' oInvoice.Lines.TreeType = rsFrInvDtls.Fields.Item("TreeType").Value  '--- Profit Center
                            'oInvoice.Lines.AccountCode = rsFrInvDtls.Fields.Item("Acctcode").Value
                            oInvoice.Lines.LineTotal = rsFrInvDtls.Fields.Item("LineTotal").Value
                            oInvoice.Lines.BaseLine = rsFrInvDtls.Fields.Item("LineNum").Value
                            oInvoice.Lines.BaseEntry = rsForInvoice.Fields.Item("DocEntry").Value
                            oInvoice.Lines.BaseType = SAPbobsCOM.BoObjectTypes.oQuotations
                        Else
                            oInvoice.Lines.Add()
                            oInvoice.Lines.SetCurrentLine(z)
                            oInvoice.Lines.ItemCode = rsFrInvDtls.Fields.Item("ItemCode").Value
                            oInvoice.Lines.ItemDescription = rsFrInvDtls.Fields.Item("Dscription").Value
                            oInvoice.Lines.WarehouseCode = rsFrInvDtls.Fields.Item("WhsCode").Value
                            oInvoice.Lines.Quantity = rsFrInvDtls.Fields.Item("Quantity").Value
                            oInvoice.Lines.UnitPrice = rsFrInvDtls.Fields.Item("Price").Value
                            oInvoice.Lines.CostingCode = rsFrInvDtls.Fields.Item("OcrCode").Value '--- Profit Center             
                            'oInvoice.Lines.AccountCode = rsFrInvDtls.Fields.Item("Acctcode").Value
                            oInvoice.Lines.LineTotal = rsFrInvDtls.Fields.Item("LineTotal").Value
                            oInvoice.Lines.BaseLine = rsFrInvDtls.Fields.Item("LineNum").Value
                            oInvoice.Lines.BaseEntry = rsForInvoice.Fields.Item("DocEntry").Value
                            oInvoice.Lines.BaseType = SAPbobsCOM.BoObjectTypes.oQuotations
                        End If
                        z = z + 1
                        rsFrInvDtls.MoveNext()
                    Loop
                    rsFrInvDtls = Nothing
                    Dim cResult As String
                    Dim cMessage As String
                    Dim dPostDate As Date
                    cResult = ""
                    If oInvoice.Add <> 0 Then
                        ' MsgBox("Error " + oCompany.GetLastErrorDescription())
                        cMessage = "Error " + oCompany.GetLastErrorDescription()
                        cResult = "Failed"
                        dPostDate = DateTime.Now.ToString
                        dPostDate = Date.Parse(dPostDate)
                        rUpdateStatus = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
                        SQLStr = "update [@TDOCPROC] set U_DOCSTATUS = '" & cResult & "' ,U_InvNum = " & oInvNum
                        SQLStr = SQLStr & ",U_REMARKS = '" & cMessage & "'"
                        SQLStr = SQLStr & ",U_POSTDATE = '" & dPostDate & "'"
                        SQLStr = SQLStr & " where u_DocEntry = " & rsForInvoice.Fields.Item("DocEntry").Value
                        rUpdateStatus.DoQuery(SQLStr)
                    Else
                        Dim rs1 As SAPbobsCOM.Recordset
                        Dim retval As Long
                        Dim cValues As Integer
                        cResult = "Success"
                        oInvNum = oCompany.GetNewObjectKey()
                        oSalesQuotation = oCompany.GetBusinessObject(BoObjectTypes.oQuotations)
                        cValues = rsForInvoice.Fields.Item("DocEntry").Value
                        If (oSalesQuotation.GetByKey(cValues) = True) Then
                            oSalesQuotation.Close()
                            oSalesQuotation.Update()
                        Else
                            Dim errcode As String
                            Dim errmsg As String
                            oCompany.GetLastError(errcode, errmsg)
                            MsgBox(oSalesQuotation.CardCode)
                            MsgBox("Failed to Retrieve the record " & errcode & " " & errmsg)
                        End If
                    End If
                    dPostDate = DateTime.Now.ToString
                    dPostDate = Date.Parse(dPostDate)
                    rUpdateStatus = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
                    SQLStr = "update [@TDOCPROC] set U_DOCSTATUS = '" & cResult & "' ,U_InvNum = " & oInvNum & ","
                    SQLStr = SQLStr & " U_PostDate = '" & dPostDate & "'"
                    SQLStr = SQLStr & " where u_DocEntry =" & rsForInvoice.Fields.Item("DocEntry").Value
                    rUpdateStatus.DoQuery(SQLStr)
                    'If oCompany.InTransaction = True Then
                    '-ompany.EndTransaction(BoWfTransOpt.wf_Commit)
                    'End If
                    rsForInvoice.MoveNext()
                Loop
                rsForInvoice = Nothing
                '    'msg2send(NumOfInv) = oDocNum
                '    'Insert2OCTP(vDocNum, vDocDate, oDocNum, Now.ToShortDateString, vCardCode, vCardName)
            Catch ex As Exception
                MessageBox.Show(ex.Message)
            End Try
        End Function
       end code
    thank you

Maybe you are looking for

  • Tracing balances in reclassification account back to vendor/debtor

    Hi Gurus My client ran the balance reclassification program in September and the program was successful.Now in October the auditors requested to know which vendors and customers had the debit and credit balances respectively to explain the line items

  • Plz Help me put  navigation menu on my front page, but a good one......

    Hi ive used spryware ive used normal typing but my navigation bar is awful how can i can create a good one ? Another thing is ive made the spyware navigation menu bar horizontal but when i load it up on my ftp files for the internet it ends up going

  • Archived Log is not shifting from Primary to DR

    we have increase the table size without taking care of DR, so sapdata1 becomes 100% at DR site after that applying archived had stopped at DR, after that i manually added datafile using following commands, select * from v$recover_file where error lik

  • BPC - "Error occurs during UpdateRemainData. Invalid column name formula4

    Hi All, After creating a new dimension, I am trying to add members in it. I am not sure why, but first I got message to include FORMULAH1 and FORMULAH2 as properties to the dimesion. I added those two properties although I do not have any formula for

  • Multiple accounts facebook

    Is there a way to get two facebook accounts on the facebook app. if not is there a other app. that i can use for this ? Otherwise apple please make this for the app because there are more people u need this ? thanks. sybmar