Update order document through DI API generates delete / insert ?

Hi,
I am developing with B1 88 PL10 and I am doing an update of userfields with DI API.
Looking on sql server profiling tool I found that  the DI API generates delete / insert instead of update statements ?
Has someone an explanation ?
Regards,
Gregory

Hi Gregory,
There are couple of possible reasons for this. I think the most probable one is for performance and accuracy.
Delete / insert may actually take less time than Update alone.
Thanks,
Gordon

Similar Messages

  • Any way to update PO document through DTW without using "Doc Entry"

    Dear all,
    Just have a question.
    I need to use DTW to update existing PO document. I realized that I have to have Doc Entry to be entered in the DTW template.
    Is there any way to update PO document through DTW without using that field, "Doc Entry"?
    thanks
    Tony

    Tony,
    A similar situation related to Bank files was resolved with one of my clients on the following way...
    The file from the Vendor can be an any order or format on the Excel.  Till the time it is consistant it should work fine..
    We created a Job in SQL Server to read this Excel file and to use the DocNum to get the DocEntry from SAP PO and output another excel file which is exactly the template format for PO Update.
    This may even not be required in your case.....
    You can get this done through an Excel Macro....which will connect to the database and using the DocNum get the DocEntry and update the Excel....
    This is 100% achievable and a better solution for regular use
    Suda

  • Mass Update Contract Documents through workbook?

    HI Experts,
    Is it possible to mass update Contract documents through Workbook? if yes please proivde the workbook.
    Thanks
    Kushagra A

    HI Kushagra
    Please use the below mention fields to update the current Contract Document. you can use an CSV file to upload this.
    see the attachment.
    # Field name:
    # Unique Agreement Name : This is the agreement's unique name to identify the agreement.
    # Agreement Class ID :  This is the agreement's class ID. It is '1004' for Master Agreement and '1003' for Sub-Agreement.
    # Agreement Display Name :  This is the agreement's display name.
    # Attachment Name : This is the attachment's display name.
    # Attachment Order Code :  This is the attachment's order code to locate the attachment collected by the agreement.
    # Attachment Size (KB) :  This is the attachment's size in KB.
    # Attachment Visibility :  This is the attachment's visibility. Either Buyside only or Buyside and Sellside.
    # Added by :  This field indicates who added this attachment.
    # Contract Document (Y/N?) :  Please enter this field with either 'Y' or 'N' to indicate if you want to convert this attachment to a contract document.
    # Contract Document Type:  Please enter this field with the display name of the contract document type. Check the Setup->Contract Document Type for available choices.
    # Contract Document Phase External ID: enter this field with the External ID of the contract document phase. The phase should be defined in the phase configuration of your contract document type.
    Let me know if this helps
    Thanks
    Kanchan

  • Update Order Document

    Hi
    How do you update an order document when the printed field is set to 'A', meaning the document has been amended.
    The Update fails because it doesnt recognize an A, its only a YES/NO Enum in the SDK.
    Has the bug been resolved
    Thanks

    Hi,
    I wish to update a UDF on the order line, also the quantity eventually. This is critical and I see no reason why it should not be possible while the order is still open.
    The order can be updated if the flag is set to 'Y' or 'N' but as you say when it contains 'A' it cannot be updated anymore.
    In my mind this is indeed a bug/oversight as even though the printed field is read-only, due to it being seen only as a Yes/No type in the SDK, it then fails when it contains 'A' during the Update process/validation.
    I'm on patch level 7 so would have hoped this would have been fixed?

  • Error on creating Purchase order document using DI API

    Dear all,
    I am getting an error "<b>Server threw an exception</b>"  at the time of initializing object of Purchse order document. code is
    vDrafts = GOD_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDrafts)
    I am using SBO 2005B SP 0 PL-20.
    Reply as soon as possible.
    Regards,
    Manish Jha

    Hi Manish,
    I am not sure if I am right, but I remember something about a bug in SBO SDK that gave an error when trying create draft object. Not sure on which patch this was though and am not sure if this is your problem too. Maybe someone else can remember what patch it was on?
    Hope it helps,
    Adele

  • Updating a sales order through DI API

    Hi All,
         I have an issue regarding updating a sales order.
    The problem is:
      If there r 2 items(A00001&A00002) existed in the sales order and if I am adding two more items(A00003 & 4)the sales order is updated in a fashion that first item is replaced with third item and forth item is added as last record.The items to that particular sales order after updating will be like this(A00003,A00002,A00004).My doubt is why the 3rd item is replaced with first record.I am sending the code also i have written.
    objRecordSet = SBOCOMUtil.newRecordset(company);
                          IDocuments  oOrder =SBOCOMUtil.newDocuments(company,SBOCOMConstants.BoObjectTypes_Document_oOrders);
                                  objRecordSet.doQuery("select DocEntry from ORDR where DocNum=" + 1111);
                                  DocEntryL =objRecordSet.getFields().item(new String("DocEntry")).getValueInteger().intValue();
                          str += DocEntryL;
                          System.out.println(DocEntryL);
                          if (oOrder.getByKey(new Integer(DocEntryL))) {
                                  //objRecordSet2.doQuery("delete  from rdr1 where DocEntry="+DocEntryL);
                                  str += "2";
                                  System.out.println(str);
                                  //oOrder.remove();
                                  oOrder.setDiscountPercent(new Double(5));
                                  oOrder.setComments("success");
                                  System.out.println(str);
                                  IDocument_Lines oOrderLines = oOrder.getLines();
                                  str += "3";
                                  String[] item={"A00005","A00006"};
                                  for (int counter = 0; counter < item.length; counter++) {
                                       //  oOrderLines.setCurrentLine(new Integer(counter));
                                         if (counter > 0)
                                                 oOrder.getLines().add();
                                         str += "4";
                                  oOrderLines.setItemCode(item[counter]);
                                  System.out.println(item[counter]);
                                     //oOrderLines.setBaseType(new Integer(-1));
                                     //oOrderLines.setBaseEntry(new Integer(0));
                                   //oOrder.getLines().setCurrentLine(new Integer(counter));
                               //oOrderLines.setQuantity(new Double(1));
                                         //oOrderLines.setPrice(new Double(1500));
                                         //oOrderLines.setCurrency(strCurrency[counter]);
                                         //oOrderLines.setLineTotal(new Double(dblLineTotal[counter]));
                                  str += "5";
                                  //oOrder.getLines().getUserFields().getFields().item("Quantity").setValue(new Integer(2));
                                  System.out.println(str);
                                  int result = oOrder.update();
                                  str += "6" + result;
                                  if (result == 0) {
                                         System.out.println("successfully updated");
                                         company.disconnect();
                                  } else {
                                         company.getLastErrorDescription();
                                         System.out.println(
                                                 "Error :" + company.getLastErrorDescription());
                                         company.disconnect();

    If you are using SBP 2004 there are many threads on this forum talking about bugs when updating sales order lines through DI API. This issue was supposed to be fixed with patch level 45 for 2004 which was recently released.
    If u are using 2005 or SP1 I think you may have found a new bug.

  • How to Update UDO through DI API code

    Hello,
    I have created UDO through DI API successfully, now I want to update the UDO through DI API code, and want to add some more child tables, but I am unable to do that, its showing me message that UDO successfully updated but when I am checking through B1, I can see that newly created child tables are not ticked in the check boxes. I am pasting my code, Please some one tell me how to fix this problem.
    Private Sub AddUDO()
    Dim oUserObjectMD As SAPbobsCOM.UserObjectsMD
    oUserObjectMD = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserObjectsMD)
    oUserObjectMD.CanCancel = SAPbobsCOM.BoYesNoEnum.tYES
    oUserObjectMD.CanClose = SAPbobsCOM.BoYesNoEnum.tYES
    oUserObjectMD.CanCreateDefaultForm = SAPbobsCOM.BoYesNoEnum.tNO
    oUserObjectMD.CanDelete = SAPbobsCOM.BoYesNoEnum.tYES
    oUserObjectMD.CanFind = SAPbobsCOM.BoYesNoEnum.tYES
    oUserObjectMD.CanLog = SAPbobsCOM.BoYesNoEnum.tNO
    oUserObjectMD.CanYearTransfer = SAPbobsCOM.BoYesNoEnum.tYES
    oUserObjectMD.ManageSeries = SAPbobsCOM.BoYesNoEnum.tYES
    oUserObjectMD.ChildTables.TableName = "DC3_N"
    oUserObjectMD.ChildTables.Add()
    oUserObjectMD.ChildTables.TableName = "DC4_N"
    oUserObjectMD.Code = "UDO_CHECK_N"
    oUserObjectMD.ManageSeries = SAPbobsCOM.BoYesNoEnum.tYES
    oUserObjectMD.Name = "UDO_CHECK_N"
    oUserObjectMD.ObjectType = SAPbobsCOM.BoUDOObjType.boud_Document
    oUserObjectMD.TableName = "DMT_N"
    oUserObjectMD.GetByKey("UDO_CHECK_N")
    lRetCode = oUserObjectMD.Update()
    If lRetCode <> 0 Then
    If lRetCode = -1 Then
    'chkUDOAfter.SetItemChecked(12, True)
    Else
    oCompany.GetLastError(lRetCode, sErrMsg)
    MsgBox(sErrMsg)
    End If
    Else
    MsgBox("UDO: " & oUserObjectMD.Name & " was updated successfully")
    'chkUDOAfter.SetItemChecked(14, True)
    End If
    oUserObjectMD = Nothing
    GC.Collect() 'Release the handle to the table
    End Sub
    Regards,
    Sudeshna.

    Hi Ian,
    I have pasted the line "oUserObjectMD.GetByKey("UDO_CHECK_N")" immediately after "oUserObjectMD = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserObjectsMD)
    " like below:
    oUserObjectMD = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserObjectsMD)
    oUserObjectMD.GetByKey("UDO_CHECK_N")
    but this time it is adding the two new tables in UDO, but some how removing the first Master table from UDO.
    Can you tell me how solve this, or can you provide some working code example regarding this.
    Regards,
    Sudeshna.

  • Unable to Change Withholding Tax Base Amount while creating Service AP Invoice through DI API?

    Dear All,
    I am trying to create Service AP Invoice through DI API.
    If I post the document without changing SAPPurchaseInvoice.WithholdingTaxData.TaxableAmount the dount ocument is created in SAP without any problem.
    But if I change amount in above field then DI API throws error Unbalanced Transaction.
    If I post same document in SAP with changed base amount it got posted in SAP without any Issue.
    Where I am doing wrong?
    please guide.
    Using:
    SAP B1 version 9 Patch Level 11
    Location : India.
    Thanks.

    Hi ,
    maybe you can find solution to these note 1812344
    1846344  - Overview Note for SAP Business One 8.82 PL12
    Symptom
    This SAP Note contains collective information related to upgrades to SAP Business One 8.82 Patch Level 12 (B1 8.82 PL12) from previous SAP Business One releases.
    In order to receive information about delivered patches via email or RSS, please use the upper right subscription options on http://service.sap.com/~sapidp/011000358700001458732008E
    Solution
    Patch installation options:
    SAP Business One 8.82 PL12 can be installed directly on previous patches of SAP Business One 8.82
    You can upgrade your SAP Business One to 8.82PL12 from all patches of the following versions:8.81; 8.8; 2007 A SP01; 2007 A SP00; 2007 B SP00; 2005 A SP01; 2005 B
    Patch content:
    SAP Business One 8.82 PL12 includes all corrections from previous patches for releases 8.82, 8.81, 8.8, 2007, and 2005.
    For details about the contained corrections, please see the SAP Notes listed in the References section.
    Notes: SAP Business One 8.82 PL12 contains B1if version 1.17.5
    Patch download:
    Open http://service.sap.com/sbo-swcenter -> SAP Business One Products -> Updates -> SAP Business One 8.8 -> SAP BUSINESS ONE 8.82 -> Comprised Software Component Versions -> SAP BUSINESS ONE 8.82 -> Win32 -> Downloads tab
    Header Data
    Released On
    02.05.2013 02:34:18  
    Release Status
    Released for Customer  
    Component
    SBO-BC-UPG Upgrade  
    Priority
      Recommendations/additional info  
    Category
      Upgrade information  
    References
    This document refers to:
      SAP Business One Notes
    1482452
    IN_Wrong tax amount was created for some items in the invoice with Excisable BOM item involves
    1650289
    Printing Inventory Posting List for huge amount of data
    1678528
    Withholding amount in the first row is zeroed.
    1754529
    Error Message When Running Pick and Pack Manager
    1756263
    Open Items List shuts down on out of memory
    1757641
    Year-end closing
    1757690
    SEPA File Formats - New Pain Versions
    1757898
    Incoming Bank File Format
    1757904
    Outgoing Bank File Format
    1762860
    Incorrect weight calculation when Automatic Availability Check is on
    1770690
    Pro Forma Invoice
    1776948
    Calendar columns are wrong when working with Group View
    1780460
    OINM column description is not translated
    1780486
    UI_System crash when you set extreme value of double type to DataTable column
    1788256
    Incorrect User-Defined Field displayed in a Stock Transfer Request
    1788372
    ZH: 'Unacceptable Field' when export document to word
    1788818
    RU loc: No freight in the Tax Invoice layout
    1790404
    Cash Flow Inconsistency when Canceling Payment
    1791295
    B1info property of UI API AddonsInstaller object returns NULL value
    1791416
    Adding a new item to BoM is slow
    1794111
    Text is overlapping in specific localization
    1795595
    Change log for item group shows current system date in all the "Created" fields
    1797292
    Queries in alerts should support more query results
    1800055
    B1if_ Line break issue in inbound retrieval using JDBC
    1802580
    Add Journal Voucher to General Ledger report
    1803586
    Not realized payment is exported via Payment Engine using 'SAPBPDEOPBT_DTAUS' file format
    1803751
    Period indicator of document series can be changed although it has been used
    1804340
    LOC_BR_Cannot update Nota Fiscal Model
    1805554
    G/L Account displayed in a wrong position when unticking the checkbox "Account with Balance of Zero"
    1806576
    Payment Cannot Be Reconciled Internally
    1807611
    Cannot update UDF in Distribution Rule used in transactions
    1807654
    Serial No./Batch inconsistency by canceled Inventory Transfer
    1808694
    BR: Business Partner Code cannot be updated with CNPJ CPF error
    1809398
    CR_Cannot Display Related Multi-Value Parameters
    1809758
    Arrow key not work for Batch/Serial Number Transactions Report
    1810099
    Tax Amount is Recalculated Even if Tax Code Is Not Changed
    1811270
    Upgrade fails on Serial And Batches object with error code -10
    1811846
    Cannot run Exchange Rate Differences when multi branch is activated
    1812344
    Withholding Tax Amount Is Not Updated in Payment Once Witholding Tax Code Is Changed in Document through DI API
    1812740
    DI:"Operation Code" show wrong value when add "A/P Tax Invoice" based on "A/P Invoice"
    1813029
    US_Vendor address on 1099 Summary by Form/Box Report is not updated according to the latest Invoice
    1813835
    Wrong amounts of Goods Return in Open Item List
    1814207
    Preliminary page prints setting does not keep after upgrade
    1814860
    Value "Zero" cannot be imported to "Minimum Inventory Level" field via Excel file
    1815535
    RFQ: Web front end not displayed in supplier language
    1815810
    GT: Adding Incoming Payment for Some Cash Flow Relevant Accounts Fails
    1816191
    BR:System Crashes While Working with Tax Code Determination Window
    1816611
    CR_Crystal Report Displayed Incorrectly Afte

  • SCM Issues with Sales Orders Created through CRM

    Hi All,
    I'm trying to ascertain any issues with ERP processing that will not update orders created through CRM, i see there was a OSS Note some time back informing that the backorder reschedule program would not update orders created in the CRM system. Is this still the case and are there any other process that we should be marking as an issue?
    Thanks

    Hi Sirisha,
    The solution depends on the exact issue you are facing.
    The CRM Sales Order is created OK, but you only see the error when you open the Sales Order?
    If this is the case, then you can follow the steps below:
    1. Find the Message ID and Message No for the error message
    2. Use Program - CRM_MESSAGES_DELETE to delete error messages from the error producing Sales Orders.
    Let me know if this is not the issue you are facing.
    Regards,
    Nelson

  • Payment through DI API

    Hi All,
    In our addon we are creating AR Invoice and Payment document through DI API . We have tested the addon  as a logistic user , it is working fine, but when we try to open the incoming payment through SAP  Business One it will give an error message  "You cannot open window[170] Receipt with your current license" . My doubt is that if we create payment through DI API as logistic user is this a violation of SAP license ? Please advise me..
    Thanks in Advance
    Regards
    ARUN

    From my experience - we created through DI API document for which limited user has no acces through UI, customer was happy that with limited licence they may work. Unfortunately after few months in new patch this was corrected and cutomer had to upgrade licences.
    So I think it will be corrected by SAP development team in few future patches and it will not work as now already.

  • Printing marketing documents via DI API

    Hello everybody?
    I've been looking for some information about how to print marketing documents through DI API using the layout assigend in the PLD. Until now i have not found a way to do this, so I want to know if anyone has found a solution either using ALD?
    I've seen some workaround using the DI API but it's not useful for me, so it's a definitive answer to say that it's not possible to do this?
    Thanks

    Hi,
    When i had a similar requirement i used Crystal reports to preview and print my custom reports, I opened the Report on the Print Preview menu icon click.
    Hope it helps,
    Vasu Natari.

  • Problem In Creating Sales Order Through DI API

    Hi
    I am Creating The Sales Order Through DI API.
    the Error Is Coming - " [OACT] , 'No matching records found (ODBC -2028)'"
    anyone  can help me solving it.

    Hi vivek,
    Have you tried adding the same document with the client ?
    OACT is the accounts table and this error message typically indicates that there is an account parameter missing somewhere in the system.
    Possible causes include:
    - you are using a tax group or warehouse which does not have all the required accounts set
    - There is a price rounding and the rounding price account has not been set in the account settings
    - etc.
    The first things I would check include the tax group settings and the G/L Account determination settings.
    Henry

  • Adding binlocation items from sales order to sales invoice through DI API

    Hi
    I  want to add items from sales order to sales invoice.
    when i am allocated bin locations for the item sales invoice is not adding
    is there any way to update BIN Location Alocation-Issue qty through DI API
    please help me....
    regard,
    LakkshmiKantth

    Hi Lakshmi,
    check this http://scn.sap.com/message/14740146#14740146
    REgards
    edy

  • How do I use icloud to restore my documents that were in Pages? Pages got stuck in "waiting" to update and when nothing else worked I deleted it and reloaded Pages. I don't want to restore everything just my Pages documents.

    How do I use icloud to restore my documents that were in Pages? Pages got stuck in "waiting" to update and when nothing else worked I deleted it and reloaded Pages. Everything I can find is about wiping everything out and restoring everything. I don't want to restore everything just my Pages documents (and numbers and keynote that also locked up during updating).

    What I meant is turn off Documents and Data in iCloud in OS X. Keep it on on your iOS devices. iCloud will sync documents between the iOS devices and make them available on the iCloud web site, but it won't mess up iWorks' open and save dialog boxes. It also won't assume that you want all your documents in iCloud, which I think is undesirable anyway.
    Keep iOS and OS X separate, and use the web site to move files between the two as necessary.
    iOS iWork is different from OS X iWork. There are fewer fonts on an iOS device. iOS iWork programs have slightly different feature sets than OS X iWork programs, and the file formats are different. iCloud automatically converts the file format when necessary, but if you make a habit of saving things directly to iCloud, you are limited to the lowest common denominator between the two versions of iWorks. So why would anyone want iWork on the Mac to open and save documents on iCloud by default?
    If you want to store files in the cloud and sync them on your Macs, SugarSync is a much better solution. It lets you choose your sync folders, it doesn't make you reorganize your files, it lets you sync all file types, it doesn't convert files to a different format and back, and it stores everything in the cloud, too. Just the simle act of saving a file backs it up and syncs it. I wouldn't live without it. iCloud is best with iTunes purchases and synchronizing Mac settings and iOS files; I woudln't live without it. The two make an unbeatable combination.

  • How to print a document in reverse order using Java Print API ?

    I need to print a document in reverse order using Java Print API (*Reverse Order Printing*)
    Does Java Print API supports reverse order printing ?
    Thnks.,

    deepak_c3 wrote:
    Thanks for the info.,
    where should the page number n-1-i be returned ?
    Which method implementation of Pageable interface should return the page number ?w.r.t. your first question: don't return that number but return page n-1-i when page i is requested; your document will be printed in reverse order. Your class should implement the entire interface and wrap the original Pageable. (for that number n your class can consult the wrapped interface; read the API for the Pageable interface).
    kind regards,
    Jos

Maybe you are looking for