cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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,

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

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.

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Diego Rodrigo Grein,

Unfortunately, I haven't been able to reproduce this issue by any mean.

By the way, it was good to know that you been able to workaround this issue. Still, if you would like this issue to be investigated, you can create an incident for SAP support.

Hope it helps!

Kind regards,

ANKIT CHAUHAN

SAP SME Support

Former Member
0 Kudos

OK,
Thank you for your attention.

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

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

Former Member
0 Kudos

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);
        }
    }
    
}
Former Member
0 Kudos

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.