cancel
Showing results for 
Search instead for 
Did you mean: 

How to set condition for my Choose From List

Former Member
0 Kudos

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....

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hello,

Above post is true...

But u have to call CFL Condition fn pval.BeforeAction = true

By

Firos.C

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

hi..thanx for the reply..

then where should i define the conditions and how the should be for my scenario

Former Member
0 Kudos

hi...

iam not getting the program....plz give me solution by looking at my post in the forum

Former Member
0 Kudos

Hi Shenaz,

You should set the CFL Conditions as soon as you assign the CFL to your control (Control can be EditText or Button).

Thanks,

Siju Dasan