Skip to Content
0
Former Member
Nov 02, 2009 at 10:39 AM

no replies yet :( problem in writing 2 conditions for a form

11 Views

in my form i have 2 text boxes......... my purpose is i should get data based on what i have entered in any of textboxes ...if i enter data in both texboxes data should be relevant to combination of those 2 texboxes.....

here is the code what i have written....

Try

oConditions = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_Conditions)

oCondition = oConditions.Add

oCondition.BracketOpenNum = 2

oCondition.Alias = "U_ShelfNumber"

oCondition.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL

oCondition.CondVal = DirectCast(oForm.Items.Item("5").Specific, SAPbouiCOM.EditText).Value.ToString()

oCondition.BracketCloseNum = 1

oCondition.Relationship = SAPbouiCOM.BoConditionRelationship.cr_OR

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

oCondition = oConditions.Add

oCondition.BracketOpenNum = 1

oCondition.Alias = "U_RentedAvailable"

oCondition.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL

oCondition.CondVal = DirectCast(oForm.Items.Item("7").Specific, SAPbouiCOM.EditText).Value.ToString()

oCondition.BracketCloseNum = 2

oCondition.Relationship = SAPbouiCOM.BoConditionRelationship.cr_AND

oCondition = oConditions.Add

oCondition.BracketOpenNum = 2

oCondition.Alias = "U_ShelfNumber"

oCondition.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL

oCondition.CondVal = DirectCast(oForm.Items.Item("5").Specific, SAPbouiCOM.EditText).Value.ToString()

oCondition.BracketCloseNum = 1

oCondition.Relationship = SAPbouiCOM.BoConditionRelationship.cr_OR

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

oCondition = oConditions.Add

oCondition.BracketOpenNum = 1

oCondition.Alias = "U_RentedAvailable"

oCondition.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL

oCondition.CondVal = DirectCast(oForm.Items.Item("7").Specific, SAPbouiCOM.EditText).Value.ToString()

oCondition.BracketCloseNum = 2

oDBDataSource.Query([oConditions])

Edited by: Shenaz Sultana on Nov 2, 2009 3:43 PM