cancel
Showing results for 
Search instead for 
Did you mean: 

Get event on Form - Matrix

Former Member
0 Kudos
507

Hi,

I want to capture any event on a system form Matrix.

I try using this:

if (((pVal.EventType == SAPbouiCOM.BoEventTypes.et_ALL_EVENTS) & (pVal.Before_Action == true)))

{

   SBO_Application.StatusBar.SetText("en form 41 all", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Success);

}

I want to capture when the matrix is filled by some SAP B1 Process.

How do I ?

Accepted Solutions (1)

Accepted Solutions (1)

maik_delly
Active Contributor
0 Kudos

Hi Pablo,

I am not sure if I understood you correctly - but I think you are searching for the FORM_DATA_LOAD event . First you need an handler ( Note : it is not an ItemEvent ) :


SBO_Application.FormDataEvent += new SAPbouiCOM._IApplicationEvents_FormDataEventEventHandler(SBO_Application_FormDataEvent);


  static void SBO_Application_FormDataEvent(ref SAPbouiCOM.BusinessObjectInfo BusinessObjectInfo, out bool BubbleEvent)

        {

            BubbleEvent = true;

            if (!BusinessObjectInfo.BeforeAction && BusinessObjectInfo.EventType == SAPbouiCOM.BoEventTypes.et_FORM_DATA_LOAD ) // add more filters

            {

            }

        }

This is the event fired when there is data "loaded" on the form. For your case  you should add a filter for the formtype ( e.g. BusinessObjectInfo.FormTypeEx == "139" for sales orders ) .

hope it helps,

Maik

Former Member
0 Kudos

Hi Maik, many thanks for your reply.

I want to check this:

the user get into the Good Receipt PO and insert his data. these article is with batch and open the 'Batch - Setup'  window. Here the user press the button 'automatic creation' and in this window the user clic ok for batch generation. Here the Created batch matrix is filled automatically.

I want to capture when the matrix is filled for set is read only.

this after the automatic creation. so the user can modify the generated batchs.

maik_delly
Active Contributor
0 Kudos

Hi Pablo,

I am still not sure whether I understand.

You mean this form, right ?

This is gonna be a little tricky. Form_Data_Load won't help you.

There is a lot of UI limitations coming together.

From the top of my head, I would do the following :

Form loaded -> disable Matrix, when batches gert created SBO enables again, so you can check for unload of creation form (65053) or what I prefer disable Matrix again when event GotFocus is fired.

Only problem : when Matrix is in focus ( active ) it cant be disabled -> so I put a "helper" EditText that is out of screen and give focus to that.

A little simplified it would look like that in ItemEvent :


if (pVal.EventType == SAPbouiCOM.BoEventTypes.et_FORM_DRAW && !pVal.BeforeAction && pVal.FormTypeEx == "41")

{

    SAPbouiCOM.Form oForm = SBO_Application.Forms.Item(pVal.FormUID);

    SAPbouiCOM.Item oItem = oForm.Items.Add("Test", SAPbouiCOM.BoFormItemTypes.it_EDIT);

    oItem.Left = 2400; // out of visible area

   ((SAPbouiCOM.EditText)oForm.Items.Item("Test").Specific).Active  = true;//put focus to this edittext

    oForm.Items.Item("3").Enabled = false; //disable Matrix

}

if (pVal.EventType == SAPbouiCOM.BoEventTypes.et_GOT_FOCUS && pVal.FormTypeEx == "41" && pVal.ItemUID == "3")

{

    SAPbouiCOM.Form oForm = SBO_Application.Forms.Item(pVal.FormUID);

    if (oForm.Visible) //after from is loaded

    {

        ((SAPbouiCOM.EditText)oForm.Items.Item("Test").Specific).Active = true;

        oForm.Items.Item("3").Enabled = false;

    }

}

regards,

Maik

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi, Maik, this was solved with your help. Many thanks again!