on 11-11-2009 3:13 PM
hi.. i have created a form where for a text box i have created ChooseFromList (CFL_2) with object type = 1 and it is working fine..when i click on choose from list it is opening all GL Accounts ...but i need to set a condition that only i should be able to get only Active Accounts but not the Title Accounts..
how to do this...
how to set the conditions whie accessing my CFL_2....
i tried this code..
If pVal.ItemUID = "19" Then '''' 19 is uid of my textbox
oCFLCreationParams = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)
oCFL = SBO_Application.Forms.Item("CQ_AssetCategory").ChooseFromLists.Item("CFL_2")
''' oCFL = oCFLs.Add(oCFLCreationParams)
oCons = oCFL.GetConditions()
oCon = oCons.Add()
oCon.Alias = "ActType"
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
oCon.CondVal = "Active Accounts"
oCFL.SetConditions(oCons)
oCFLCreationParams.UniqueID = "CFL_2"
oCFL = oCFLs.Add(oCFLCreationParams)
oDBDataSource.SetValue("U_BalenceSheet_Acct", 0, oCFLEvent.SelectedObjects.GetValue(0, 0))
End If
plz provide me with code....
Hello,
The correct is : Active Account marked in the database as Postable
oCon = oCons.Add()
oCon.Alias = "Postable"
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
oCon.CondVal = "Y"
Regards,
J.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks for the reply...but its not working ......i will send u the code plz solve it for me...send me the complete code if u dont mind
Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent
Dim EventEnum As SAPbouiCOM.BoEventTypes
EventEnum = pVal.EventType
Try
Select Case pVal.EventType
Case SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST
If pVal.BeforeAction = True Then
Dim oCFLEvent As SAPbouiCOM.IChooseFromListEvent = DirectCast(pVal, SAPbouiCOM.IChooseFromListEvent)
Dim oDataTable As SAPbouiCOM.DataTable = oCFLEvent.SelectedObjects
Dim val As String
Dim oCFLCreationParams As SAPbouiCOM.ChooseFromListCreationParams
Dim oCFLs As SAPbouiCOM.ChooseFromListCollection
Dim oCFL As SAPbouiCOM.ChooseFromList
oCFLCreationParams = SBO_Application.CreateObject( _
SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)
oCFL = oCFLs.Add(oCFLCreationParams)
oCondition = oConditions.Add()
oCondition.Alias = "Postable"
oCondition.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
oCondition.CondVal = "Y"
If pVal.ItemUID = "19" Then
'MsgBox(oCFLEvent.SelectedObjects.GetValue(0, 0))
Me.oDBDataSource.SetValue("U_BalenceSheet_Acct", 0, oCFLEvent.SelectedObjects.GetValue(0, 0))
End If
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End If
Exit Select
End Select
End Sub
Hello,
when you define the ChooseFromList, then you should define the contions, not in the eventhandler !
Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent
Dim EventEnum As SAPbouiCOM.BoEventTypes
EventEnum = pVal.EventType
Try
Select Case pVal.EventType
Case SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST
If pVal.BeforeAction = True Then
Dim oCFLEvent As SAPbouiCOM.IChooseFromListEvent = DirectCast(pVal, SAPbouiCOM.IChooseFromListEvent)
Dim oDataTable As SAPbouiCOM.DataTable = oCFLEvent.SelectedObjects
Dim val As String
If pVal.ItemUID = "19" Then
'MsgBox(oCFLEvent.SelectedObjects.GetValue(0, 0))
Me.oDBDataSource.SetValue("U_BalenceSheet_Acct", 0, oCFLEvent.SelectedObjects.GetValue(0, 0))
End If
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End If
Exit Select
End Select
End Sub
User | Count |
---|---|
106 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
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.