Hi,
I have created a custom table using SQL (instead of User Table)
I am able to retrieve the data from the table without a problem. However, Condition Object does not filter,my codes as below
oCondition = oConditions.Add
oCondition.Alias = "ItemCode"
oCondition.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
oCondition.CondVal = itemcode
Does the Condition object work on custom table?
LS
Hi,
Before your "oCondition = oConditions" you should have "oConditions = New SAPbouiCOM.Conditions" also.
Also more down you should have "oDBDatasource.Query(oConditions)". And then do a loadfromdatasource.
Your columns should also have been binded....databind.
Hope this helps
Oh Ya,
i'd also suggest making the table within SBO,could solve the problems if you have done the above. why didn't you in the first place?
That is a strange error. I usualy get that when it doesn't connect to the db properly through single sign on.
What are you trying to do? i think the "loadfromdatasource" functionality only works on sap tables. Not even user defined tables will it work on. Try this code, it works on OCRD table(SAP table), it works perfect. Works with a form that has a matrix with two columns. Once you got it working then change to see if it works with your table. But from experience i dont think loadfromdatasource will work on non sap tables.
Let me know
Dim oConditions As SAPbouiCOM.Conditions
Dim oCondition As SAPbouiCOM.Condition
Dim oItem As SAPbouiCOM.Item
Dim oMatrix As SAPbouiCOM.Matrix
Dim oColumns As SAPbouiCOM.Columns
Dim oColumn As SAPbouiCOM.Column
str += "%"
oConditions = New SAPbouiCOM.Conditions
oCondition = oConditions.Add
oCondition.Alias = "CardCode"
oCondition.Operation = SAPbouiCOM.BoConditionOperation.co_GRATER_THAN
oCondition.CondVal = str
oItem = SBO_Application.Forms.Item("Choose").Items.Item("Mat")
oMatrix = oItem.Specific
oColumns = oMatrix.Columns
oColumn = oColumns.Item("BPCode")
oColumn.DataBind.SetBound(True, "OCRD", "CardCode")
oColumn = oColumns.Item("BPName")
oColumn.DataBind.SetBound(True, "OCRD", "CardName")
oDBDatasource.Query(oConditions)
oMatrix.LoadFromDataSource()
Add a comment