on 12-24-2014 11:52 AM
Dear All Experts,
I have generated my user defined form. There is matrix in this form. Also there is a column 'LineStatus'.
And one field in header is 'Status'.
Now I want if some line's LineStatus is 'Close' then that lines should be non editable in OK Mode. the other should be editable.
And if all linestatus is Close then Status in header should be close and whole form should be noneditable.
How to do this ?
Plz reply.
Regards
Hi Kuldeep,
As counting Row by Row will consume more time. You can try it as follows:
SAPbouiCOM.Form oForm = (SAPbouiCOM.Form)SBO_Application.Forms.GetForm("FormTypeEx", 1);
SAPbouiCOM.DBDataSource _dBDataSourceMaster, _dBDataSourceChild;
_dBDataSourceChild = oForm.DataSources.DBDataSources.Item("@DETAILTABLE");
SAPbouiCOM.Matrix oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtrix").Specific;
try
{
if (oMatrix.VisualRowCount > 0)
{
oMatrix.FlushToDataSource();
int count = _dBDataSourceChild.Size;
for (int i = count - 1; i >= 0; i--)
{
string str = _dBDataSourceChild.GetValue("LINESTATUS", i).ToString();
if (str == "Close")
{
oMatrix.CommonSetting.SetRowEditable(i + 1, false);
}
else
{
oMatrix.CommonSetting.SetRowEditable(i + 1, true);
}
}
oMatrix.LoadFromDataSource();
}
}
catch
{
throw;
}
Hope it helps.
Thanks & Regards
Ankit Chauhan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi.
it is possible.
Case SAPbouiCOM.BoEventTypes.et_FORM_DATA_LOAD
If BusinessObjectInfo.ActionSuccess Then
Dim omat1 As SAPbouiCOM.Matrix
omat1 = frmContractOrder.Items.Item("944").Specific
For i1 As Integer = 1 To omat1.VisualRowCount
' If (omat1.Columns.Item("V_3").Cells.Item(i1).Specific.value = oUsername) Then
Dim ousname As String = oCompany.UserName
If (omat1.Columns.Item("V_4").Cells.Item(i1).Specific.value = oCompany.UserName) Then
If (omat1.Columns.Item("V_2").Cells.Item(i1).Specific.value = "Pending") And (Doc_Status = "Draft") Then
'If (omat1.Columns.Item("V_2").Cells.Item(i1).Specific.value = "Pending") Then 'Cell Editable ......
omat1.CommonSetting.SetCellEditable(i1, 3, True)
'Row Editable.....
omat1.CommonSetting.SetRowEditable(i1, True)
'omat1.CommonSetting.SetCellEditable(i1, 5, True)
Else
omat1.CommonSetting.SetCellEditable(i1, 3, False)
End If
Else
omat1.CommonSetting.SetCellEditable(i1, 3, False)
End If
Next
----------
your second question is
all the fields are disabled mode on non editable mode.
if docstatus="closed" then
oForm.Mode = SAPbouiCOM.BoFormMode.fm_VIEW_MODE
end if
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.