Skip to Content
0

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

May 09, 2017 at 07:25 PM

103

avatar image

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,

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Diego Rodrigo Grein May 09, 2017 at 07:43 PM
0

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.

Share
10 |10000 characters needed characters left characters exceeded
ANKIT CHAUHAN
May 10, 2017 at 10:43 AM
0

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded

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);
        }
    }
    
}
0
Diego Rodrigo Grein May 11, 2017 at 11:10 AM
0

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.

Show 2 Share
10 |10000 characters needed characters left characters exceeded

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

0

OK,
Thank you for your attention.

0