cancel
Showing results for 
Search instead for 
Did you mean: 

Re:Query CFL

Former Member
0 Kudos

Hi All,

How to set multiple conditions in a query CFL.

This is my Code :

oRs.DoQuery("Select * from [@PSSIT_CMSAMHDR] where U_CardCode = '" & oVenCodeTxt.Value & "'")

oCFL = oForm.ChooseFromLists.Item("SRLst")

oCFL.SetConditions(emptyCon)

oCons = oCFL.GetConditions()

For IntICount = 0 To oRs.RecordCount - 1

If IntICount = (oRs.RecordCount - 1) Then

oCon = oCons.Add()

oCon.Alias = "U_CardCode"

oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL

oCon.CondVal = oVenCodeTxt.Value

Else

oCon = oCons.Add()

oCon.Alias = "U_CardCode"

oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL

oCon.CondVal = oVenCodeTxt.Value

oCon.Relationship = SAPbouiCOM.BoConditionRelationship.cr_OR

End If

oRs.MoveNext()

Next

oCFL.SetConditions(oCons)

I want to set another condition for status which should be 'open'. how should i achieve this.

Regards

Mohana

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Mohana,

if you want to Add condition on both if and else part means try this following code after oCon.CondVal on both if and else statements,

oCon.Relationship = SAPbouiCOM.BoConditionRelationship.cr_AND

oCon = oCons.Add()

oCon.Alias = "U_status"

oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL

oCon.CondVal = "Open"

Regards,

Ganesh k

Answers (0)