Skip to Content
Former Member
Mar 05, 2008 at 03:41 PM

UI fails to copy the choosen value from ChooseFromList form


I defined a chooseFromList to a column in a matrix, and it does not work. When I click the ikon of CFL the form appears, but the choosen value is not copyed to the cell

Expected Results:

The choosen value should be copyed to the DSResp Column, and the link button appears next to.

Actual Results:

When I choose a record in the CFL form, and press OK, or press duble clik, the CFL form closes, but the choosen value doesn't appears in the DSResp column. If I add/type a value to the column and click somewhere else the link button appears.

Private Sub AddChooseFromList()


Dim oCFLs As SAPbouiCOM.ChooseFromListCollection

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 = "171"

oCFLCreationParams.UniqueID = "CFL6"

oCFL = oCFLs.Add(oCFLCreationParams)



End Try

End Sub

Private Sub CreateForm()




oForm.DataSources.UserDataSources.Add("EmpDS", SAPbouiCOM.BoDataType.dt_SHORT_TEXT)




oColumn = oColumns.Add("DSResp", SAPbouiCOM.BoFormItemTypes.it_LINKED_BUTTON)

oColumn.TitleObject.Caption = "Responsible"

oColumn.Width = 90

oColumn.Editable = True

oColumn.DataBind.SetBound(True, "@QUA1", "U_Respon")

oLink = oColumn.ExtendedObject

oLink.LinkedObject = SAPbouiCOM.BoLinkedObject.lf_Employee

oColumn.DataBind.SetBound(True, "", "EmpDS")

oColumn.ChooseFromListUID = "CFL6"

oColumn.ChooseFromListAlias = "empID"




End Sub

Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent

If pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST Then

Dim oCFLEvento As SAPbouiCOM.IChooseFromListEvent

oCFLEvento = pVal

Dim sCFL_ID As String

sCFL_ID = oCFLEvento.ChooseFromListUID

Dim oForm As SAPbouiCOM.Form

oForm = SBO_Application.Forms.Item(FormUID)

Dim oCFL As SAPbouiCOM.ChooseFromList

oCFL = oForm.ChooseFromLists.Item(sCFL_ID)

If oCFLEvento.BeforeAction = False Then

Dim oDataTable As SAPbouiCOM.DataTable

oDataTable = oCFLEvento.SelectedObjects

Dim val As String

Dim val2 As String


val = oDataTable.GetValue(0, 0)

val2 = oDataTable.GetValue(1, 0)

Catch ex As Exception

End Try

If ((pVal.ItemUID = "DSResp") Or (pVal.ItemUID = "Button")) And sCFL_ID = "CFL6" Then

oMatrix.Columns.Item("DSResp").Cells.Item(oMatrix.RowCount).Specific.Value = val

End If

End If

End If

End Sub