on 11-02-2009 10:39 AM
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
Hi,
What is the problem you have exactly ?
else you can try this :
oCondition.BracketOpenNum = 3
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 = 3
Hope it's help you.
Regards,
Michael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi thanx for the reply...
my problem is ...
in my form i have 2 text boxes (U_shelfNUmber) and (U_rented)....and a matrix....
based on what i enter in 2 textboxes i have to fetch data from DB to my matrix....
the code that u have seen id working fine only if i enter in either of textboxes.....
but once when i enter data in both the textboxes the data which i'm getting is not mathing at all with the conditions.....
even i have tried with the code that u hae snet to me...that is also not working...
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.