Skip to Content
avatar image
Former Member

Error addon. There is a difference between the total document and its components

Hello,

After you upgrade SAP B1 from version 9.0 to 9.2 PL07, you are experiencing the error while trying to create a sales order:

There is a difference between the total document and its components. [Sales Order - Document Total (FC)] [Message 439-138]

This add-on includes a credit limit control and does some validation on the order.
To try to identify the problem reason, I commented on all the points where the Add-on changes the request data, and I could not identify the source of the problem.
In SAP 9.0, the add-on works without problems, only in version 9.2 the problem occurs.
Has anyone else ever had this problem? Can you give me an idea of what it could be?

I thank you,

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    May 09, 2017 at 07:43 PM

    I was able to identify that the error occurs when the add-on executes the FormDataAdd_Before event
    on the line:

    Form oFormNew = B1AppDomain.Application.Forms.GetForm ("-" + oForm.Type, oForm.TypeCount);
    ComboBox oComboBox = oFormNew.Items.Item ("U_VerifLimites"); OComboBox.Select ("Y", BoSearchKey.psk_ByValue);


    The error only occurs when the value of the ComboBox is changed.
    For example, if the screen is "Y", and the add-on changes to "Y", the error does not occur.
    If it is "Y", and change to "N", or if the screen is "N" and the add-on changes to "Y", then the error occurs.

    Add comment
    10|10000 characters needed characters exceeded

  • May 10, 2017 at 10:43 AM

    Hi Diego Rodrigo Grein,

    I haven't been able to reproduce this issue on DEMO Database (DemoUK) on SAP Business One Version 9.2 PL07. Here are the details:

    1. Following code is being used under "FORM_DATA_ADD" Event:

    If pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_DATA_ADD And pVal.BeforeAction And pVal.FormTypeEx = 139 Then
                Try
                    Dim formA As SAPbouiCOM.Form = oApplication.Forms.Item(pVal.FormUID)
                    Dim form As SAPbouiCOM.Form = oApplication.Forms.GetForm("-139", formA.TypeCount)
                    Dim editTest As SAPbouiCOM.ComboBox = form.Items.Item("U_test").Specific
                    editTest.Select("N", SAPbouiCOM.BoSearchKey.psk_ByValue)
                    oApplication.SetStatusBarMessage("Item Updated", , False)
    
                Catch ex As Exception
                    oApplication.SetStatusBarMessage("Item Not Updated - " + ex.Message, , False)
                End Try
            End If
    

    2. Sales Order is being created manually via SAP Business One Client.

    It would be nice, if you could provide more steps to reproduce this issue.

    Kind regards,

    ANKIT CHAUHAN

    SAP SME Support

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      I made new tests:
      - I created a new, blank database.
      - I created new add-on, with only the code that generates the error.
      I create a sales order, manually, type the customer, date of delivery and item, and click on Add, and it is still generating the error for me.
      The User-Defined Fields option is active in the tests.

      static void objApplication_FormDataEvent(ref SAPbouiCOM.BusinessObjectInfo pVal, out bool bubbleEvent)
      {
          bubbleEvent = true;
          if (pVal.EventType == SAPbouiCOM.BoEventTypes.et_FORM_DATA_ADD && pVal.BeforeAction && pVal.FormTypeEx == "139")
          {
              try { 
                  SAPbouiCOM.Form oForm = objApplication.Forms.Item(pVal.FormUID);
                  SAPbouiCOM.Form oFormNew = objApplication.Forms.GetForm("-139", oForm.TypeCount);
                  SAPbouiCOM.ComboBox oComboBox = (SAPbouiCOM.ComboBox)oFormNew.Items.Item("U_TesteCombo").Specific;
                  oComboBox.Select("Y", SAPbouiCOM.BoSearchKey.psk_ByValue);
                  Marshal.FinalReleaseComObject(oComboBox);
                  objApplication.SetStatusBarMessage("Ok", SAPbouiCOM.BoMessageTime.bmt_Short, false);
              }
              catch (Exception ex)
              { 
                  objApplication.SetStatusBarMessage(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Medium, true);
              }
          }
          
      }
  • avatar image
    Former Member
    May 11, 2017 at 11:10 AM

    Hi,

    I did more testing, but in the Form_Data_Add event, the error always occurs.
    I changed the code, that changes the value of the combo-box to the ItemClicked Before event by testing the Ok button and the Form state, and the error has not occurred anymore.

    Add comment
    10|10000 characters needed characters exceeded