Writing query with conditions from textbox control on a form

i have written the following code for a query to run on a condition....
and i want to pass the condition value from textbox not directly as i did in my code
i want to get it from a textbox control on form
how to do this ....?
           oConditions = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_Conditions)
           oCondition = oConditions.Add
           oCondition.BracketOpenNum = 1
            oCondition.Alias = "U_RentedAvailable"
            oCondition.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
            oCondition.CondVal = "Y"   ' i want to get it from a textbox control on form
            oCondition.CompareFields
            oCondition.BracketCloseNum = 1
           oDBDataSource.Query([oConditions])
            oMatrix.LoadFromDataSource()

thanx for ur reply....
here i'm using UDO object for my table....when i enter data on my textbox and click on find i'm not getting data
..here is the sample code what i have written....
Public Sub loadMatrix()
        oitem = oForm.Items.Item("8")
        oMatrix = oItem.Specific
        oColumns = oMatrix.Columns
        oDBDataSource = oForm.DataSources.DBDataSources.Add("@VIDS_MGT")
        '' ''' setting conditions...
        '' to create the new condition collection
        Try
            oConditions = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_Conditions)
            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 = 1
            '' '''End of  setting conditions...
            oColumn = oColumns.Item("V_5")
            oColumn.DataBind.SetBound(True, "@VIDS_MGT", "Code")
            oColumn = oColumns.Item("V_4")
            oColumn.DataBind.SetBound(True, "@VIDS_MGT", "Name")
            oColumn = oColumns.Item("V_3")
            oColumn.DataBind.SetBound(True, "@VIDS_MGT", "U_CardCode")
            oColumn = oColumns.Item("V_2")
            oColumn.DataBind.SetBound(True, "@VIDS_MGT", "U_ShelfNumber")
            oColumn = oColumns.Item("V_1")
            oColumn.DataBind.SetBound(True, "@VIDS_MGT", "U_SpaceNumber")
            oColumn = oColumns.Item("V_0")
            oColumn.DataBind.SetBound(True, "@VIDS_MGT", "U_RentedAvailable")
            oDBDataSource.Query([oConditions])
            oMatrix.LoadFromDataSource()
        Catch ex As Exception
            SBO_Application.MessageBox(ErrorToString)
        End Try
    End Sub

Similar Messages

  • Sql query with conditions and calculations???

    Hi,
    how I can build a query with conditions and calculations?
    E.g. I've got this table
    Start          | End     |     Working Place     |     Mandatory
    01-JAN-13 | 11-JAN-13 |     Office           |          1
    14-JAN-13 | 25-JAN-13 |     Home Office      |     0
    04-MRZ-13| 15-MRZ-13 |     Office           |          0
    11-FEB-13 | 22-FEB-13 |     Office           |          1
    Now if column working place=Office and column mandatory=0
    the new column "price" has to calculate: (End-Start)* $25.00
    and if working place=Office and column mandatory=1
    the "price" column has to calculate: (End-Start)* $20.60
    else $0.00
    I tried it with the case statement but I didn't know how
    to calculate my values and display it to the virtual column "price".
    Something like
    case
    when Working_Place = 'Office' and Mandatory=1
         then ...
    else '0.00'
    end as PRICE
    Or is it not possible?
    Edited by: DB2000 on 12.03.2013 05:09

    Use CASE:
    select  start_dt,
            end_dt,
            working_place,
            mandatory,
            case
              when working_place = 'Office' and mandatory = 0 then (end_dt - start_dt) * 25
              when working_place = 'Office' and mandatory = 1 then (end_dt - start_dt) * 20.60
              else 0
            end price
      from  tbl
    START_DT  END_DT    WORKING_PLA  MANDATORY      PRICE
    01-JAN-13 11-JAN-13 Office               1        206
    14-JAN-13 25-JAN-13 Home Office          0          0
    04-MAR-13 15-MAR-13 Office               0        275
    11-FEB-13 22-FEB-13 Office               1      226.6
    SQL> SY.

  • Sub query with conditions

    Hi,
    Is it possible to run a sub query with conditions? I keep receiving an error 'Registration Data' -2006.
    For example, here is a simplified query which gives the error...
    SELECT T1.CardCode FROM
    SELECT T0.CardCode FROM OCRD T0 WHERE T0.CardCode = '[%0]'
    ) T1
    FOR BROWSE
    Thanks for any help,
    Robin

    SBO SQL-parser sometimes kidding. My solution is to use temptables/views/storedprocedures.
    It's faster then "unbugging" parser <b>:)</b>
    in your case that can be like the following:
    SELECT T0.CardCode INTO #temp FROM OCRD T0 WHERE T0.CardCode = N'[%0]'
    SELECT qq.CardCode FROM #temp qq FOR BROWSE
    BTW: registration data error is usially says us about %-argument reason

  • How can I create a query with web service data control?

    I need to create a query with web service data control, in WSDL, it's query operation, there is a parameter message with the possible query criteria and a return message contains the results. I googled, but cannot find anything on the query with web service. I cannot find a "Named Criteria" in web service data control like normal data control. In Shay's blog, I saw the topics on update with web service data control. How can I create a query with web service data control? Thanks.

    Hi,
    This might help
    *054.     Search form using ADF WS Data Control and Complex input types*
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/index-101235.html

  • Performance of APD with source as 'Query with conditions'

    Hi,
    I have a question regarding the performance of an APD query with conditions when it is run in the background.
    I have an infocube with 80 million records.I have a query to find Top 15 (Condition In query) Customers per territory.
    With the help of an APD Query (Source) i wanted to populate the details (customer category , etc) of the Top 15 Customers into a DSO (Target)
    Right now it takes 6 minutes to run the query in web.
    I wanted to know how feasible it is to use an APD (run in backgrnd) to dump the results of the BEx query (which has conditions Top 15) into DSO.
    Also , what other options do i have ?
    Appreciate your answers.
    Regards

    Thomas thanks for the response.  I have checked the file on the app server and found that the lines with more than 512 characters are being truncated after 512 characters.  Basis team is not aware of any such limits on the app server.  I am sure few on the forum would have extracted data to a file on the application server using APD.  Please note that the file extraction to the client workstation is working as expected (posts lines more than 512 characters).

  • WCF Service and Sharepoint Form library : How i can read a access a form libray and query a item from file name and read form xml in WCF service ?

    WCF Service and Sharepoint Form library : How i can read or access a form libray and query a item from file name and read form xml in WCF service ?
    Ahsan Ranjha

    Hi,
    In SharePoint 2013, we can take use of REST API or Client Object Model to access the SharePoint objects like Form Library.
    SharePoint 2013 REST API
    http://msdn.microsoft.com/en-us/library/office/dn450841(v=office.15).aspx
    http://blogs.technet.com/b/fromthefield/archive/2013/09/05/working-with-sharepoint-list-data-odata-rest-and-javascript.aspx
    SharePoint 2013 Client Object Model
    http://msdn.microsoft.com/en-us/library/office/fp179912(v=office.15).aspx
    http://msdn.microsoft.com/en-us/library/office/jj193041(v=office.15).aspx
    With the retrieved file, we can then use XmlDocument object to parse it and get the values you want:
    http://weblogs.asp.net/jimjackson/opening-and-reading-an-xml-file-in-a-document-library
    http://stackoverflow.com/questions/1968809/programatically-edit-infopath-form-fields
    Best regards
    Patrick Liang
    TechNet Community Support

  • Condition Specific or attach query with chose from list

    Hi All,
    I have developed a form with the header containing the Customer Code and Name and the Rows containing columns like SO Number, Item Code, Item Name and Quantity.
    The SO Number field has a chose from list and I want that this will show only the Open Sales orders for the customer selected in the header CUSTOMER CODE field of the form.
    Similarly The ITEM CODE choose from List will only show the items in that particular selected Sales Order in the first column of that row.
    This is very much being possible through formatted search attached. But I wish if this can be done by adding condition or query to the choose from list. Please help me in this regards with your suggestions.
    Please provide a sample code if any has already done something like this.
    Regards,
    Raj

    Hi,
    U can use a CFL with conditions. So when u tab out u can get only the required records.
    Check out the below threads for some samples for CFL conditions. Search the forum for more samples.
    CFL with conditions
    cfl conditions
    RE: CFL Conditions
    CFL Conditions and Edit Text
    Vasu Natari.

  • Query with variant from ABAP

    Hello!
    I need to execute a BW-query from an Abap-report.
    I tried it already with function module 'RRW3_GET_QUERY_VIEW_DATA' and with classes / objects 'CL_RSR_REQUEST' resp. 'CL_RSR_DATA', but:
    I want to use the query with a variant, which could be found in table RSRPARAMETRIZA.
    (Btw: even with a variant in table RSRVARIANTDIR  I don't get the results wanted...)
    Is there a direct way to call a BW-query with a variant from Abap?
    Alternatively: How do I get the variant-contents? Is there a 'universal' way to work with both kinds of variants? (RSRVARIANTDIR / RSRPARAMETRIZA) 
    Thanks in advance.

    Thanks for the link.
    Well, I already read that document and I followed the links to the former blogs on this subject.
    But this solution doesn't work for me: CL_RSR_QUERY_VARIABLES is unknown.
    I read the pdf and the function-module-code, but I still don't have an idea how to work with query- variants . The example-coding includes a line
    DATA: wf_variant TYPE variant .
    but that's not used, or is it?
    (I don't have a set of variables and conditions, but just a variant-name. The variant will be created by other people, who would start my report.)
    Greetings

  • SQL Report query with condition (multiple parameters) in apex item?

    Hello all,
    I have a little problem and can't find a solution.
    I need to create reports based on a SQL query or I.R. Nothing hard there.
    Then I need to add the WHERE clause dynamically with javascript from an Apex item.
    Again not very hard. I defined an Apex item, set my query like this "SELECT * FROM MYTAB WHERE COL1 = :P1_SEARCH" and then I call the page setting the P1_SEARCH value. For instance COL1 is rowid. It works fine.
    But here is my problem. Let's consider that P1_SEARCH will contain several rowids and that I don't know the number of those values,
    (no I won't create a lot of items and build a query with so many OR!), I would like sotheming like "SELECT * FROM MYTAB WHERE ROWID IN (:P1_SEARCH) with something like : ROWID1,ROWID2 in P1_SEARCH.
    I also tried : 'ROWID1,ROWID2' and 'ROWID1','ROWID2'
    but I can't get anything else than filter error. It works with IN with one value but as soon as there are two values or more, it seems than Apex can't read the string.
    How could I do that, please?
    Thanks for your help.
    Max

    mnoscars wrote:
    But here is my problem. Let's consider that P1_SEARCH will contain several rowids and that I don't know the number of those values,
    (no I won't create a lot of items and build a query with so many OR!), I would like sotheming like "SELECT * FROM MYTAB WHERE ROWID IN (:P1_SEARCH) with something like : ROWID1,ROWID2 in P1_SEARCH.
    I also tried : 'ROWID1,ROWID2' and 'ROWID1','ROWID2'
    but I can't get anything else than filter error. It works with IN with one value but as soon as there are two values or more, it seems than Apex can't read the string.For a standard report, see +{message:id=9609120}+
    For an IR&mdash;and improved security avoiding the risk of SQL Injection&mdash;use a <a href="http://download.oracle.com/docs/cd/E17556_01/doc/apirefs.40/e15519/apex_collection.htm#CACFAICJ">collection</a> containing the values in a column instead of a CSV list:
    {code}
    SELECT * FROM MYTAB WHERE ROWID IN (SELECT c001 FROM apex_collections WHERE collection_name = 'P1_SEARCH')
    {code}
    (Please close duplicate threads spawned by your original question.)

  • Set value in af:query with value from method

    hello all
    i have problem, when they want set value in af:query (inputText) with value from method, how to do that?
    anyone help..?
    thx
    agungdmt

    Hi,
    are you facing this issue when you try to show few values on right side (selected list) of shuttle component.
    what is your usecase exactly ?

  • Parametrized query with output from sql

    Hey all,
    has anyone figure out how to use the database connectivity toolset to perform a parameterized query with outputs (SQL)? From the other threads that i have read it would seem that this issue is not resolved. The error i get is:
    Error -2147467259 occurred at Cmd Execute.vi->getjobID.vi
    Possible reason(s):
    Exception occured in Microsoft OLE DB Provider for ODBC Drivers: [MySQL][ODBC 3.51 Driver][mysqld-5.0.50sp1a-enterprise-gpl-log]OUT or INOUT argument 3 for routine eln.lv_caperJob_create is not a variable or NEW pseudo-variable in BEFORE trigger in Rec Create - Command.vi->Cmd Execute.vi->getjobID.vi
    However, In Toad for mysql the following call works:
    set @outJobID=-999;
    set @outMsg="";
    call  lv_caperJob_create('TestJune30_2', '207', @outJobID, @outMsg);
    select @outJobID, @outMsg
    Attached is the LV code i am using. Thanks!
    Attachments:
    db code.JPG ‏50 KB

    Your first approach gave you an error because it took the ? parameter inside the '%?%' string and treated it as whole string as '%?%'. As you set the parameter, it did not understood where it need to insert the parameter.
    Your second approach is pretty much OK, only problem is you are trying to set the parameter with a string and aging creating the string while setting the parameter.
    The solution will be to create the whole string before setting the parameter and set the created String as parameter on the query something like this.
    String parameter = "%"+searchString+"%";
    Then set the parameter string to the query.
    Thanks

  • Missing Result Rows on Query with Conditions

    I have a query that has a condition to show only items over $2500.00.   We have a result row that shows for plant when the condtions is not on but once the condition is set that result row goes away.  Does anyone know how to get a result row to show up on reports with conditions?  Thank you.
    Caroline

    Hi Caroline,
    In BI 7.0, you goto do this in Query Designer.
    Select any of your characteristic in the designer and choose Display Properties to always display result.
    Then run the query.
    Assign Points if Helps !!
    Regards,
    Naveen Rao Kattela

  • BEx query with variant from ABAP

    Hello,
    I'm looking for possibility to start BEx query with variant (variant is created with tx RSRT) from ABAP. There are some funktion modules, which start queries (launch excel), for example RSAH_LAUNCH_EXCEL or RSSEM_QUERY_LAUNCH, but they are ending with short dump, when there are variables in the query. Is there any standard FM, which starts the query with variant or accepts parameters?
    regards,
    Krzysztof

    Hi,
    the short dump was my fault, I've passed query name instead of genuniid to the RSAH_LAUNCH_EXCEL.
    What I'm trying to do is to I'll start BEx query with parameters (I don't want to get selection-screen from the query, I need to fill it from ABAP).
    Here is my example, which is not working.
    DATA:
      lv_query(30) TYPE c,
      lv_genuniid  TYPE rsrrepdir-genuniid,
      ls_var       TYPE rrx_var,
      lt_var       TYPE TABLE OF rrx_var.
    lv_query = 'YB_MAKLER_DETAIL'.
    CALL FUNCTION 'CONVERSION_EXIT_GENID_INPUT'
      EXPORTING
        input  = lv_query
      IMPORTING
        output = lv_genuniid.
    IF lv_genuniid = ''.
      WRITE: / 'There is no Query', lv_query.
    ELSE.
      ls_var-vnam = 'YS_MKLE'.
      ls_var-sign = 'I'.
      ls_var-opt  = 'EQ'.
      ls_var-low  = '0000005100'.
      APPEND ls_var TO lt_var.
      ls_var-vnam = 'YS_VTGJ'.
      ls_var-sign = 'I'.
      ls_var-opt  = 'EQ'.
      ls_var-low  = '1999'.
      APPEND ls_var TO lt_var.
      CALL FUNCTION 'RSAH_LAUNCH_EXCEL'
        EXPORTING
          i_genuniid                       = lv_genuniid
          I_OBJVERS                        = 'A'
          i_hide_sapgui                    = 'X'
        TABLES
          I_T_VAR                          = lt_var.
    ENDIF.
    If parameter 'i_hide_sapgui' is empty, I'm getting empty selection-screen,
    If parameter 'i_hide_sapgui' equals 'X' I'm getting selection-screen filled with values, which were used last time manualy, not with values from the internal table 'lt_var'.
    Do you have any idea how to pass parameters to the query with this function module?
    Regards,
    Krzysztof

  • Query with 'different from' clause in Sqlite

    My question is very simple:
    How can I submit a query with a 'different from' clause into a table.
    In AIR, I would like to query :
    "select * from myTable where myField <> 'value' ";
    but it does'nt work !
    Nor
    "select * from myTable where myField != 'value' ";
    nor
    "select * from myTable where myField is not 'value' ";
    is it impossible to query with a 'different from' clause in Sqlite wih Adobe Air

    Hello,
    SQLite in AIR does support 'different from' and '<>' is the correct operator. Take the following emp table for example:
    id
    name
    age
    1
    A
    26
    2
    B
    30
    3
    C
    28
    If you want to query the records whose name isn't A. The following SQL is correct:
    select * from emp where name <> 'A'
    Thanks,
    Yang

  • Query with Tables from another Database

    Hi.
    I have a problem with a Query that executes a stored procedure that inserts data in a Table from another DataBase. The problem is when I try to execute a Query with the data related of that table using the user parameters of SBO ('[%0]'....'[%3]'). I use the following parameters for reference to the Table:
    "....FROM [-BDName-].[dbo].[-TableName-] T1..... "
    Any suggestions? Thanks a lot....
    (Suggestions in English or Spanish)

    None

Maybe you are looking for

  • "Import Failed" when trying to run a import (Integration) script from FDM

    Backgroud about the Issue : My source system for data is Oracle Orion and the Destination is HFM.Trying to import data fom orion to HFM through FDM via ODBC connectivity. Modified the "Integration Script Example" in fdm_admin guide and with this i am

  • Imovie 9 crashes almost ending the export. I can't find the problem.

    It hapens with all the export formats. Quicktime, itunes, idvd, etc. This is the report: Process:         iMovie [35131] Path:            /Applications/iMovie.app/Contents/MacOS/iMovie Identifier:      com.apple.iMovie8 Version:         8.0.6 (821) B

  • 11 -- 11,1 Upgrade: pkg://solaris/system/library signature problems?

    Hi all, I have a vanilla 11 11/11 lab system (x64, in VirtualBox) that I've tried to upgrade to 11.1: # uname -a SunOS alpha 5.11 11.0 i86pc i386 i86pc # pkg list entire NAME (PUBLISHER) VERSION IFO entire 0.5.11-0.175.0.0.0.2.0 i-- # pkg publisher P

  • Invalid characters (URGENT please)

    Hello, I have two independent systems where in one of the systems users maintain characters like (Á É Í Ó Ú Á É Í Ó Ú Ä Ë Ï Ö Ü….etc). I am not sure how many different type of characters users maintain but I want to populate all of these in the maste

  • Sys as sysdba/sysoper

    Hi there Can any body explain me, why SYS user should always connect to the database as SYSDBA/SYSOPER only? Why he cannot login without as a SYSDBA/SYSOPER. TIA Aqueel.