Skip to Content
author's profile photo Former Member
Former Member

Multi selction in CFL

hi all

Now i m able to select one record from CFL ,its working fine for one record

But while selecting multiple records ,only one record coming to matrix .and also inert one empty line in matrix.

Case "Color_mat"
                        Select Case pVal.ColUID
                            Case "txticode"
                                Select Case pVal.EventType
                                    Case SAPbouiCOM.BoEventTypes.et_VALIDATE
                                         Case SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST
                                        Dim bonCflEvents As SAPbouiCOM.ChooseFromListEvent
                                        Dim bonDTTable As SAPbouiCOM.DataTable
                                        Dim bonCflList As SAPbouiCOM.ChooseFromList
                                        Dim bnnstrUID As String
                                        bonCflEvents = pVal
                                        bnnstrUID = bonCflEvents.ChooseFromListUID
                                        bonDTTable = bonCflEvents.SelectedObjects
                                        bonCflList = lonConvForm.ChooseFromLists.Item(bnnstrUID)
                                        If Not (bonDTTable Is Nothing) Then
                                            If bonCflList.UniqueID = "COLITEMCFL1" Then
                                                gonMatConvMatrix.GetLineData(pVal.Row)
                                                   lonDetailDatasource.SetValue("U_Itmcode", lonDetailDatasource.Offset, bonDTTable.GetValue(0, 0))
                                                lonDetailDatasource.SetValue("U_ItemName", lonDetailDatasource.Offset, bonDTTable.GetValue("ItemName", 0))
                                                gonMatConvMatrix.SetLineData(pVal.Row)
                                                If pVal.Row = gonMatConvMatrix.VisualRowCount Then
                                                    lonDetailDatasource.SetValue("U_Itmcode", lonDetailDatasource.Offset, "")
                                                    lonDetailDatasource.SetValue("U_ItemName", lonDetailDatasource.Offset, "")
                                                    lonDetailDatasource.SetValue("U_Avail", lonDetailDatasource.Offset, "")
                                                    lonDetailDatasource.SetValue("LineId", lonDetailDatasource.Offset, pVal.Row + 1)
                                                    gonMatConvMatrix.AddRow()
                                                    gonMatConvMatrix.SetLineData(pVal.Row + 1)
                                                    gonMatConvMatrix.FlushToDataSource()

                                                End If
                                            Else

                                            End If
                                        End If
                                End Select
                        End Select

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Oct 26, 2010 at 06:49 AM

    Hi

    When you create the choose from list enable MultiSelection=true

    Dim cflCreator As ChooseFromListCreationParams
     cflCreator = DirectCast(oApplication.CreateObject(BoCreatableObjectType.cot_ChooseFromListCreationParams), SAPbouiCOM.ChooseFromListCreationParams)
     cflCreator.UniqueID = "UID"
     cflCreator. MultiSelection= True
     cflCreator.ObjectType = "objectType"

    then on the after choosefromlist event try the below code

    Dim oDataTable As SAPbouiCOM.DataTable
                Dim oCFLEvento As SAPbouiCOM.IChooseFromListEvent
                Try
                    Dim str As String = ""
                    oCFLEvento = pVal
                    oDataTable = oCFLEvento.SelectedObjects
                    If oDataTable Is Nothing Then Exit Sub
                    form.DataSources.DBDataSources.Item("DBdatasource).Clear()
                    With form.DataSources.DBDataSources.Item("DBdatasource")
    
                        If oDataTable.Rows.Count > 0 Then
                            For i As Integer = 0 To oDataTable.Rows.Count - 1
                                .InsertRecord(i)
                                .SetValue("U_ItemCode", i, oDataTable.GetValue(0, i).ToString)
                                .SetValue("U_ItemName", i, oDataTable.GetValue(1, i).ToString)
       
                            Next
                        End If
    
                    End With
    
                    Dim oMatrix As SAPbouiCOM.Matrix = form.Items.Item("mtxItems").Specific
                    oMatrix.LoadFromDataSource()
    
                Catch ex As Exception
                    MsgBox(ex.Message)
                End Try

    Hope this will help you

    Regards

    Arun

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 30, 2010 at 04:27 AM

    thanks

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.