cancel
Showing results for 
Search instead for 
Did you mean: 

How to filter Choose from list object rows?

Former Member
0 Kudos

Hi everyone,

I'd like to show Choose from list window using SBO 2005 PL07, Actually I want to show the Active Account of G/L Account, I set the CFL object to one column as following:

oCFLCreationParams.ObjectType = SAPbouiCOM.BoLinkedObject.lf_GLAccounts

oCFLCreationParams.UniqueID = "CFL"

oCFL = oCFLs.Add(oCFLCreationParams)

Who knows how to set Choose From list object only show Active Account and do not show Title Account.

Thanks for your help!

Kathy

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Kathy,

I think this should work after you've added your choose from list as in your post above.

            Dim oCons As SAPbouiCOM.Conditions
            Dim oCon As SAPbouiCOM.Condition
            oCons = oCFL.GetConditions()
            oCon = oCons.Add()
            oCon.Alias = "Postable"
            oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
            oCon.CondVal = "Y"
            oCFL.SetConditions(oCons)

Hope it helps,

Adele

<i>Message was edited by: Adele le Roux

See now that Louis basically said the same

I'm a bit slow this early in the morning ;)</i>

Former Member
0 Kudos

Thank you Louis and Adele,

It's just the right way to solve my problem.

Answers (1)

Answers (1)

former_member184566
Active Contributor
0 Kudos

Hi kathy

I have not tried it on the gl accounts. But basicaly you need to add conditions to filter it. The following is an example that you would of used for business partners but only customers.

Dim oCFLs As SAPbouiCOM.ChooseFromListCollection

Dim oCons As SAPbouiCOM.Conditions

Dim oCon As SAPbouiCOM.Condition

oCFLs = oForm.ChooseFromLists

Dim oCFL As SAPbouiCOM.ChooseFromList

Dim oCFLCreationParams As SAPbouiCOM.ChooseFromListCreationParams

oCFLCreationParams = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)

' Adding 2 CFL, one for the button and one for the edit text.

oCFLCreationParams.MultiSelection = False

oCFLCreationParams.ObjectType = "2"

oCFLCreationParams.UniqueID = "CFL1"

oCFL = oCFLs.Add(oCFLCreationParams)

' Adding Conditions to CFL1

oCons = oCFL.GetConditions()

oCon = oCons.Add()

oCon.Alias = "CardType"

oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL

oCon.CondVal = "C"

oCFL.SetConditions(oCons)

oCFLCreationParams.UniqueID = "CFL2"

oCFL = oCFLs.Add(oCFLCreationParams)

The above also compensates for the tab.

Hope it helps