Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Re:Query CFL

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

Former Member
Former Member replied

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

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question