Skip to Content
avatar image
-1
Former Member

SAP Crushes in sales order

Hello experts,

I have a very simple and annoying problem , I created a form with a Matrix filled with ItemNames when the user double click a row it copy the ItemName to the matrix of the sales order , here SAP crushes It doesn't happen every time but occasionnaly and the users are always complaining about it .

here is the code it's very basic

try {

if (pVal.Row <= 0) return;

String ItemName = ((SAPbouiCOM.EditText)Matrix2.GetCellSpecific("Col_0", pVal.Row)).Value;

oMainForm = Application.SBO_Application.Forms.Item(MainFormUID);

Matrix = (SAPbouiCOM.Matrix)oMainForm.Items.Item("38").Specific;

SAPbouiCOM.EditText ed = (SAPbouiCOM.EditText)Matrix.GetCellSpecific("3", this.Row);

ed.Value = ItemName;

oForm.Close();

} catch (Exception Ex)

{

Application.SBO_Application.MessageBox(Ex.Message);

}

Please help

Best regards

Add comment
10|10000 characters needed characters exceeded

  • Could you also post the event handler part?

  • Former Member

    Thank you Danilo Kasparian for your answer , the event is DoubleClick After the code is

    this.Matrix2.DoubleClickAfter += new SAPbouiCOM._IMatrixEvents_DoubleClickAfterEventHandler(this.Matrix2_DoubleClickAfter);

    private void Matrix2_DoubleClickAfter(object sboObject, SAPbouiCOM.SBOItemEventArg pVal)

    {

    try

    { if (pVal.Row <= 0) return;

    String ItemName = ((SAPbouiCOM.EditText)Matrix2.GetCellSpecific("Col_0", pVal.Row)).Value;

    oMainForm = Application.SBO_Application.Forms.Item(MainFormUID);

    Matrix = (SAPbouiCOM.Matrix)oMainForm.Items.Item("38").Specific;

    SAPbouiCOM.EditText ed = (SAPbouiCOM.EditText)Matrix.GetCellSpecific("3", this.Row);

    ed.Value = ItemName;

    oForm.Close();

    } catch (Exception Ex) { Application.SBO_Application.MessageBox(Ex.Message);

    }

    }

    Thanks in advance

    Best regards

  • Get RSS Feed

1 Answer

  • Aug 02, 2017 at 12:40 PM

    Do you know where exactly is crashing?

    Just guessing, try to use the previous way of event handler

    Add comment
    10|10000 characters needed characters exceeded