Skip to Content
author's profile photo Former Member
Former Member

DBDataSource with Conditions doesn't filter

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    Posted on Nov 17, 2005 at 06:26 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 17, 2005 at 06:28 AM

    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?

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 17, 2005 at 11:35 AM

    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
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.