on 02-26-2008 12:20 PM
I have loaded data in the matrix.The cells in the matrix are editable.I want to set cfl for the column item in the matrix.
Hi,
try it as
oItem = oForm.Items.Add("EditTxt", SAPbouiCOM.BoFormItemTypes.it_EDIT)
oItem.Left = 120
oItem.Top = 10
oItem.LinkTo = "StaticTxt"
oEdit = oItem.Specific
oEdit.DataBind.SetBound(True, "", "EditDS")
oEdit.ChooseFromListUID = "CFL1"
oEdit.ChooseFromListAlias = "CardCode"
and before create CFL as
Dim oCFLs As SAPbouiCOM.ChooseFromListCollection
Dim oCons As SAPbouiCOM.Conditions
Dim oCon As SAPbouiCOM.Condition
oCFLs = oForm.ChooseFromLists
Dim oCFL As SAPbouiCOM.ChooseFromList
Dim oCFLCreationParams As SAPbouiCOM.ChooseFromListCreationParams
oCFLCreationParams = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)
oCFLCreationParams.MultiSelection = False
oCFLCreationParams.ObjectType = "2"
oCFLCreationParams.UniqueID = "CFL1"
oCFL = oCFLs.Add(oCFLCreationParams)
oCons = oCFL.GetConditions()
oCon = oCons.Add()
oCon.Alias = "CardType"
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
oCon.CondVal = "S"
oCFL.SetConditions(oCons)
hope it helps
Petr
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
well - i think that you only need to change the perfect code from petr a bit
don't create a edittext, just try something like this
oEdit = oForm.Items.item("mtxUID").Specific.Columns.item("ColUID").specific
oEdit.DataBind.SetBound(True, "", "EditDS")
oEdit.ChooseFromListUID = "CFL1"
oEdit.ChooseFromListAlias = "CardCode"
petr? what do you think ?
David
Petr and David,
The above code did not worked.
oForm.Items.item("mtxUID").Specific.Columns.item("ColUID").specific
The object could not be accessed after the word Specfic which is in bold.It gives me as,
oForm.Items.item("mtxUID").Specific.GetType()
In the above code, u have set cfl for each and every column.The columns in my matrix are as ,
objColumn = objColumns.Add("U_Entry_No", SAPbouiCOM.BoFormItemTypes.it_EDIT)
objColumn.TitleObject.Caption = "U_Entry_No"
objColumn.Width = 30
objColumn.Editable = True
I need to create object as per the columns.
For the above code I have tried a alternative code as,
Dim matQA As SAPbouiCOM.Matrix
Dim objColumns As SAPbouiCOM.Columns
Dim objColumn As SAPbouiCOM.Column
matQA = SBO_Application.Forms.ActiveForm.Items.Item("matQA").Specific
objColumns = matQA.Columns
objColumn = objColumns.Item(3)
SBO_Application.Forms.ActiveForm.DataSources.UserDataSources.Add("DSMatrix", SAPbouiCOM.BoDataType.dt_SHORT_TEXT)
objColumn.DataBind.SetBound(True, "", "DSMatrix")
For this code it gave error as
Matrix Line exits
Private Sub AddChooseFromListForMatrix()
Try
Dim oCFLs As SAPbouiCOM.ChooseFromListCollection
Dim oCons As SAPbouiCOM.Conditions
Dim oCon As SAPbouiCOM.Condition
oCFLs = SBO_Application.Forms.ActiveForm.ChooseFromLists
Dim oCFL As SAPbouiCOM.ChooseFromList
Dim oCFLCreationParams As SAPbouiCOM.ChooseFromListCreationParams
oCFLCreationParams = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)
' Adding 2 CFL, one for the button and one for the edit text.
oCFLCreationParams.MultiSelection = False
oCFLCreationParams.ObjectType = "4"
oCFLCreationParams.UniqueID = "CFL7"
oCFL = oCFLs.Add(oCFLCreationParams)
Catch ex As Exception
' app.MessageBox(ex.Message)
End Try
End Sub
After calling the function AddChooseFromListForMatrix() I have executed the following code-
Dim matQA As SAPbouiCOM.Matrix
Dim objCol As SAPbouiCOM.Columns
matQA = SBO_Application.Forms.Item("Quality Analysis").Items.Item("matQA").Specific
Dim objColumns As SAPbouiCOM.Columns
Dim objColumn As SAPbouiCOM.Column
Dim strCol As String
objColumns = matQA.Columns
objColumn = objColumns.Item(3)
objColumn.Editable = True
SBO_Application.Forms.ActiveForm.DataSources.UserDataSources.Add("DSMatrix", SAPbouiCOM.BoDataType.dt_SHORT_TEXT)
objColumn.DataBind.SetBound(True, "", "DSMatrix")
objColumn.ChooseFromListUID = "CFL7"
objColumn.ChooseFromListAlias = "ItemCode"
In the SBO_Application_ItemEvent for et_CHOOSE_FROM_LIST event I have used the following code-
If (pVal.ItemUID = "matQA") And pVal.FormUID = "Quality Analysis" Then
oForm.DataSources.UserDataSources.Item("DSMatrix").ValueEx = val
End If
In this code,I have first created matrix then I have created cfl and then loaded data in the matrix.
Petr,
I have solved the problem.I modified the datasource from which the matrix is loaded.Then I reloaded the matrix.The code is as,
SBO_Application.Forms.Item("Quality Analysis").DataSources.DataTables.Item("MyDataTable").SetValue("U_Item_Code", pVal.Row - 1, val)
LoadMatrix()
Thanks for spending u r valuable time in solving the problem.
Regards,
Dilip Kumbhar
User | Count |
---|---|
89 | |
7 | |
7 | |
4 | |
4 | |
3 | |
3 | |
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.