Skip to Content
0
Former Member
Oct 13, 2005 at 12:00 PM

How to change the forecolor of a single row of a matrix

165 Views

In a matrix which is displaying list of items like the Sales Order Form, I am trying to change the forecolor to red for only those items where the item's required quantity is lesser than the item's avialable quantity.

The Code Snippet is as follows:

ReqQty = oMatrix.Columns.Item("ReqQty").Cells.Item(pval.row).Specific.value

AvaQty = oMatrix.Columns.Item("AvaQty").Cells.Item(pval.row).Specific.value

If ReqQty > AvaQty Then

Dim txtField As SAPbouiCOM.EditText

oMatrix = oform.Items.Item("cMatrix").Specific

txtField = oMatrix.Columns.Item("ItemNo").Cells.Item (pval.row).Specific

txtField.ForeColor = 200

txtField = oMatrix.Columns.Item("ItemDesc").Cells.Item(pval.row).Specific

txtField.ForeColor = 200

oMatrix.Columns.Item("ReqQty").Cells.Item(pval.row).Specific

txtField.ForeColor = 200

oMatrix.Columns.Item("AvaQty").Cells.Item(pval.row).Specific

txtField.ForeColor = 200

End If

But the problem is , if this condition applies to any one of the items in the matrix, then all the rows in the matrix change the forecolor to red.

Has anyone faced this problem and has a solution to it?