Skip to Content
0
Former Member
Aug 08, 2012 at 02:11 PM

Adding Combo In matrix

61 Views

I want to add combo inside the matrix,i use this code for adding Combo in matrix but there is no action in combo box what i have to do, can you help for this problem

In Load screen


oMatrix = oForm.Items.Item("13").Specific

oColumns = oMatrix.Columns

matcol1 = oColumns.Item("V_9")

matcol2 = oColumns.Item("V_8")

LoadCombo(matcol1)

Private Sub LoadCombo(ByVal matcol1 As Column)

Try

oCombo = oForm.Items.Item("13").Specific

objRS = objAddOn.oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)

strSQL = "select U_empcode,U_lastName from [@SST_EI_EMPD]"

'strSQL = " select Code,Name from [@SST_HR_CTRY]"

objRS.DoQuery(strSQL)

If objRS.RecordCount > 0 Then

While Not objRS.EoF

oCombo.ValidValues.Add(objRS.Fields.Item(0).Value, objRS.Fields.Item(1).Value)

objRS.MoveNext()

End While

End If

Catch ex As Exception

End Try

End Sub

In Item Event


Select Case pVal.EventType

Case SAPbouiCOM.BoEventTypes.et_COMBO_SELECT And oForm.Mode = SAPbouiCOM.BoFormMode.fm_ADD_MODE Or oForm.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE

Try

If (pVal.ItemUID = "13") And (pVal.ColUID = "V_9") Then

matcol2 = oColumns.Item("V_8")

matcol1 = oColumns.Item("V_9")

oCombo = matcol1.Cells.Item(pVal.Row).Specific

oEdit = matcol2.Cells.Item(pVal.Row).Specific

oEdit.Value = oCombo.Selected.Description

End If

Catch ex As Exception

End Try