cancel
Showing results for 
Search instead for 
Did you mean: 

Stop Matrix flickering

former_member275826
Participant
0 Kudos
171

Dear all,

I have written the code on list focus of column. Due to which whole matrix gets flicker.

Also i have used the "Freeze", but there is no use of this functionality.

oForm = SBO_Application.Forms.GetForm(pVal.FormTypeEx, pVal.FormTypeCount);

  oForm.Freeze(true);

  oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item(pVal.ItemUID).Specific;

  Barcode = ((SAPbouiCOM.EditText)oMatrix.Columns.Item(pVal.ColUID).Cells.Item(pVal.Row).Specific).Value;

   oRecord = oDAL.returnReocord("SELECT U_BARCODE,U_ITEMCODE,U_WHSCODE,U_BIN,U_STKQTY,U_Batchnum FROM [@BSTK]        WHERE U_BARCODE='" + Barcode + "'", oCompany);

   if (!oRecord.EoF)

    {

    ((SAPbouiCOM.EditText)oMatrix.Columns.Item("1").Cells.Item(pVal.Row).Specific).Value = oRecord.Fields.Item("U_ITEMCODE").Value.ToString();

    ((SAPbouiCOM.EditText)oMatrix.Columns.Item("24").Cells.Item(pVal.Row).Specific).Value =   oRecord.Fields.Item("U_WHSCODE").Value.ToString();

     }

    oForm.Freeze(false);

Can anybody suggest me is there anyway to tackle this situation.

Accepted Solutions (0)

Answers (1)

Answers (1)

edy_simon
Active Contributor
0 Kudos

Hi Pravin,

What event is 'list focus of column' ?

if this event supports before and after event.

Try to put the form.freeze(true) in the before event.

And form.freeze(false) in the after event.

But do becarefull to handle any exception to un freeze the form since the form freeze in between two events.

Regards

Edy

former_member275826
Participant
0 Kudos

Sorry its Lost focus event

edy_simon
Active Contributor
0 Kudos

Hi Pravin,

Is this System Form or your user form ?

if it is the later, set the matrix data directly through its data source.

Regards

Edy


former_member275826
Participant
0 Kudos

Hi Edy,

its system form.

edy_simon
Active Contributor
0 Kudos

Hi Pravin,

I suppose this matrix is also a system matrix ?

Then your only choice might be to move your code into the Validate Event.

Put the Freeze on Before Validate and Unfreeze it on After Validate.

Regards

Edy

former_member275826
Participant
0 Kudos

Hi Edy,

i have used the validate event but now sap gets crashed.

edy_simon
Active Contributor
0 Kudos

Hi Pravin,

Can i see your code where you catch this validate event?

Make sure that you have catch specific cell only.

If you didnt do that, when you set the value of itemcode and warehouse, it will trigger another validate event.

When that happens, you will be caught in an infinite loop until SBO ran out of memory and crash.

Regards,

Edy