Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

CFL in matrix

Hi to all, I have tried to use CFL in a matrix but I have a problem... I want fill each row of matrix with code and description of selected item.

AddChooseFromList(MyApp, lFrm, SAPbouiCOM.BoLinkedObject.lf_Items, "cod")
lFrm.DataSources.UserDataSources.Add("cod", SAPbouiCOM.BoDataType.dt_SHORT_TEXT)
            xCtrl.oColumn = xCtrl.oMatrix.Columns.Item("col1")
            xCtrl.oColumn.DataBind.SetBound(True, "", "cod")
            xCtrl.oColumn.ChooseFromListUID = "cod"

  lFrm.DataSources.UserDataSources.Add("descr", SAPbouiCOM.BoDataType.dt_SHORT_TEXT)
            xCtrl.oColumn = xCtrl.oMatrix.Columns.Item("col2")
            xCtrl.oColumn.DataBind.SetBound(True, "", "descr")

and in et_CHOOSE_FROM_LIST event:

Dim oCFLEvento As SAPbouiCOM.ChooseFromListEvent, sCFL_ID As String, oCFL As SAPbouiCOM.ChooseFromList
                                Dim oDataTable As SAPbouiCOM.DataTable

                                oCFLEvento = Pval
                                sCFL_ID = oCFLEvento.ChooseFromListUID
                                oCFL = Frm.ChooseFromLists.Item(sCFL_ID)
                                oDataTable = oCFLEvento.SelectedObjects
                                If Not oDataTable Is Nothing Then
                                    Dim s As String
                                    Dim s2 As String

                                    s = oDataTable.GetValue("ItemCode", 0)
                                    s2 = oDataTable.GetValue("ItemName", 0)

                                    _Frm.DataSources.UserDataSources.Item("cod").Value = s_
                                    Frm.DataSources.UserDataSources.Item("descr").Value = s2

                                    xCtrl.oColumn.Cells.Item(1).Specific.value = Frm.DataSources.UserDataSources.Item("cod").Value
                                    xCtrl.oColumn.Cells.Item(2).Specific.value = Frm.DataSources.UserDataSources.Item("descr").Value

                               End If

when I type '*+TAB' in "col1" I can view Items List but when I choose an Item from list the underlined line in code I have posted opens another list of Items where I have to choose another item.

Where is the problem in my code?

Regards, Luke

Not what you were looking for? View more on this topic or Ask a question