on 06-05-2006 10:17 PM
Hi
I'am using a ChooseFromList in a Matrix column bound to the column segment_0 of the table OACT -
and I don't know how to show the account selected.
The next code always returns the segment_0 of the selected account
in the first row of the matrix because i'am using 0 (zero) as record number
in the setvalue property of the datasource:
oForm.DataSources.DBDataSources.Item("OACT").SetValue _
("Segment_0", <b>0</b>, DTable.GetValue("Segment_0", 0))
If pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST And _
Not pVal.BeforeAction Then
oForm = CSBOApp.Forms.Item(pVal.FormUID)
oCflEv = pVal
CflUID = oCflEv.ChooseFromListUID
oCFList = oForm.ChooseFromLists.Item(CflUID)
DTable = oCflEv.SelectedObjects
If DTable.Rows.Count > 0 Then
oMatrix = oForm.Items.Item("REG_GrdReg").Specific
oMatrix.FlushToDataSource()
oForm.DataSources.DBDataSources.Item("OACT"). _
SetValue("Segment_0", 0, DTable.GetValue("Segment_0", 0))
oMatrix.LoadFromDataSource()
End If
endif
How I can obtain the row number of the actual row?
or is there any other way to do this??
Thaks
Jesica
Hi Jessica,
I use the following code
Public Sub GetValuesFromChooseFromList(ByVal FormUID As String, ByVal SBO_Application As SAPbouiCOM.Application, ByVal pval As SAPbouiCOM.ItemEvent)
Try
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)
Dim oDataTable As SAPbouiCOM.DataTable
oDataTable = oCFLEvento.SelectedObjects
Dim ProfitCenter As String = Nothing
Try
ProfitCenter = CStr(oDataTable.GetValue(0, 0))
Catch ex As Exception
End Try
If ProfitCenter <> Nothing Then
Dim oMatrix As SAPbouiCOM.Matrix = SBO_Application.Forms.Item(FormUID).Items.Item("13").Specific
Dim oEdit As SAPbouiCOM.EditText = oMatrix.Columns.Item("U_OcrCode").Cells.Item(Row).Specific
oEdit.Value = ProfitCenter
oForm.Update()
oMatrix.Columns.Item("U_OcrCode").Cells.Item(Row).Click(SAPbouiCOM.BoCellClickType.ct_Regular)
End If
Catch ex As Exception
Log.WriteToFileLog("GetValuesFromChooseFromList", "Y", ex.Message)
End Try
End Sub
Row is a global variable that represents the row where i place the value from choose from list. Its set by the event that triggers the above procedure.
Hope it helps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
99 | |
12 | |
11 | |
6 | |
6 | |
4 | |
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.