"SELECTION" as parameter for query

Hi,
I have 3 select boxes on my jsp page box1=region, box2=country based on selection in box1 and box3=what is in database based on selection in box1. My question is, is there a way to grab the selection from box1 and put it into the where clause of a sql statement???
Thanks!

you never mentioned that you tried anything, never mentioned any errors, etc. that you may have encountered. I know this works cause I've done it myself, so if you'd like to try again in perhaps explaining yourself, feel free.
sorry that I obviously bothered you.You ignorant plea for help bothered me, but I don't mind helping if someone makes some effort on their part. Was I supposed to read your mind and know that you already tried something? Should I have started a remote desktop session and simply pointed out the error in your code?

Similar Messages

  • How to select entered parameter for report?

    I developed a report in SSRS 2008R2 with several parameters. But now when the use selects the Supervisor from this query, it automatically changes to a different supervisor!
    Select Distinct
    Null As [supervisor_id],
    '-All-' As [supervisor_name],
    0 as sort
    UNION ALL
    select distinct
    supervisor_id,
    staff_name as [supervisor_name],
    1 as sort
    from staff_view v WITH (NOLOCK)
    where staff_id not in ('07BBA230-CA6E-402E-AEAF-FF1CB48AA41A','6394C3A3-5402-4578-BBF1-31FFCDD4EB90')
    Order By sort, [supervisor_name]
    In my report I have a SupervisorID parameter which uses supervisor_id as the value and supervisor_name as the label. (This is the Text datatype).
    I also tried running this as a text query instead of store proc, but this exhibited the same behavior. I also broke down this view into the source tables with the same behavior:
    select distinct
    supervisor_id,
    [supervisor_name] = evolv_cs.dbo.FormatName(people_rv.last_name,people_rv.first_name,people_rv.middle_name) +
    Case When IsNull(staff_rv.end_date, '12/31/2100') < GetDate() Then
    ' (Ended: ' + Convert(Varchar(10), staff_rv.end_date,101) + ')'
    Else '' End,
    1 as sort
    FROM
    staff_rv with (nolock)
    INNER JOIN people_rv with (nolock) ON staff_rv.people_id = people_rv.people_id
    INNER JOIN agency_rv with (nolock) ON staff_rv.agency_id = agency_rv.agency_id
    where supervisor_id is not null and
    staff_id not in ('07BBA230-CA6E-402E-AEAF-FF1CB48AA41A','6394C3A3-5402-4578-BBF1-31FFCDD4EB90')
    Order By sort, [supervisor_name]
    I'm not sure what else to try?
    Also, the code for FormatName is:
    ALTER FUNCTION [dbo].[FormatName](@last [nvarchar](4000), @first [nvarchar](4000), @middle [nvarchar](4000))RETURNS [nvarchar](100) WITH EXECUTE AS CALLERAS EXTERNAL NAME [EvolvSQLCLR].[UserDefinedFunctions].[FormatName]
    Ryan D

    Hi ironryan,
    Thank you for your question.  
    I am trying to involve someone more familiar with this topic for a further look at this issue. Sometime delay might be expected from the job transferring. Your patience is greatly appreciated.  
    Thank you for your understanding and support. 
    Best Regards,
    Simon Hou

  • Parameter for Query to prevent automatic execution when broadcast to portal

    When our users open a Portal folder the first query is automatically executing.   We are using a PCD Subfolder structure.   Does anyone know of a parameter that can be set that requires the user to select the query to execute.  
    See structure below
    Finance
        AR
         Query 1

    Hi,
    regarding how to call "bindings.ViewCriteriaQuery.processQuery" from Java code. You create a method binding in JSF and execute it.
    http://thepeninsulasedge.com/frank_nimphius/2007/10/29/jsf-12-invoking-a-method-binding-programmatically-in-java-to-add-pre-post-triggers/
    Frank

  • How send parameter in prerender() function for query

    Sir I use requestbean for sending data to next page
    Because want use this parameter in query
    I get data as per this parameter
    But when I call next page not pass parameter value to next page and query use blank parameter
    I write code in prerender()
    See my code
    public void prerender() {
    try {
    getSessionBean1().getTripRowSet().setObject( 1, parameter1..getValue());
    tripDataProvider.refresh();
    } catch (Exception e) {
    error("Cannot switch to person " + &#8220;no record &#8220;);
    log("Cannot switch to person " + &#8220;no record , e);
    Please give me idea how I send my parameter in prerender() function for query
    Thank&#8217;s
    aamir

    sir i try SessionBean but same as result
    sir you see my full problem
    I use studio creator
    I create two page first for sending data to other page such as user login page
    I add property in SessionBean, RequestBean and bind to data with my user name textfield
    and in next page I bind to data with other textfield
    after this I try to use this textfield use in
    public void prerender() {  
    try {
    getSessionBean1().getChartofaccRowSet().setObject(1, textfield1.getValue());
    chartofaccDataProvider.refresh();
    } catch (Exception e) {
    error("Cannot switch to person " + �noooo�t);
    log("Cannot switch to person " + �noooo�, e);
    In this line I use that textfiled that bind to data form login page
    getSessionBean1().getChartofaccRowSet().setObject(1, textfield1.getValue());
    but sir this public void prerender() {   function t not get textfield1 value in this function textfield give me null value
    but when page complete run then show value in textfield
    it mean this public void prerender() { function run befor  SessionBean, RequestBean and not get SessionBean, RequestBean value
    please give me idea how I pass value in public void prerender() { function form other page and I use this value in query
    such as example
    getSessionBean1().getChartofaccRowSet().setObject(1, textfield1.getValue());
    this is my sessionbean query
    SELECT ALL FNET.CHARTOFACC.PARENT,
    FNET.CHARTOFACC.CHILD,
    FNET.CHARTOFACC.ACCID,
    FNET.CHARTOFACC.TITLE,
    FNET.CHARTOFACC.CAMPID,
    FNET.CHARTOFACC.ACTIVE,
    FNET.CHARTOFACC.FSTATUS,
    FNET.CHARTOFACC.COMHEADID,
    FNET.CHARTOFACC.FIX_VARIABLE,
    FNET.CHARTOFACC.VARI_PER
    FROM FNET.CHARTOFACC
    WHERE FNET.CHARTOFACC.CAMPID = ?
    please give me idea
    thank�s
    aamir
    SELECT ALL FNET.CHARTOFACC.PARENT,
    FNET.CHARTOFACC.CHILD,
    FNET.CHARTOFACC.ACCID,
    FNET.CHARTOFACC.TITLE,
    FNET.CHARTOFACC.CAMPID,
    FNET.CHARTOFACC.ACTIVE,
    FNET.CHARTOFACC.FSTATUS,
    FNET.CHARTOFACC.COMHEADID,
    FNET.CHARTOFACC.FIX_VARIABLE,
    FNET.CHARTOFACC.VARI_PER
    FROM FNET.CHARTOFACC
    WHERE FNET.CHARTOFACC.CAMPID = ?

  • Parameter for Multiple Selection

    Hi Experts,
    How I have to programming my Parameters, that I can select more than one value?
    Parameter: user type .....
    I want to select User "Test" and User "Mike".
    Regards,
    Mike

    You should convert your Parameter to Select-option to be able to select more than one value.
    Like:
    TABLES: USR02.
    SELECT-OPTIONS: S_USER FOR USR02-BNAME.
    Make sure than you change your select query.
    Like:
    WHERE USER IN S_USER
    Regards,
    Naimesh Patel

  • XSQL query output as parameter for next xsql query

    Hi,
    Is it possible to use the output of one xsql query as input parameter for the next xsql query in the same file. I am trying to retreive an id from the query and use it in the next one. I cannot combine all the queries into one, since I intend to make the first query a database function that returns the id I am looking for. I am looking for something like this
    <xsql:query>
    select '1000' as myid
    from dual
    </xsql:query>
    <xsql:query>
    select add1,ro1
    from table1
    where id = {@myid}
    </xsql>
    I need the id returned by the first query to be used in the second one. Eventually my first query will be a stored procedure that validates the users rights and on sucess return the following tag <myid> 1000 <myid>.
    Please let me know , how I can achieve my goal of validating a user's priveleges and then executing the second query.
    Thanks
    Padmaja

    Hi ,
    Thanks for the response.This works if the first query is a select .
    If the first query was a call to a db procedure that returned the <myid>100<myid> would this still work?
    <xsql:set-page-param name="myid">
    <xsql:include-owa>
    xyz;
    </xsql:include-owa>
    </xsql:set-page-param>
    <xsql:include-param name="myid"/>
    <xsql:query>
    select name from mytable where id={@myid}
    </xsql:query>
    I have to use include-owa as the db procedure xyz does some cookie validations and then returns an id based on that. The procedure xyz returns an xml tag of form <myid>100<myid>
    This does not work as the value of myid is not available to the second query.
    Thanks
    Padmaja

  • F4 help for a selection screen parameter with filename created dynamically

    Hi All,
              I have a requirement where in an F4 help should be present for a selection screen parameter. After selecting the filepath and clicking OK button on the Dialog, the filename should be dynamically get created in the selection screen parameter field. For example:
    if the path is D:\DOCS then at the end of DOCS the filename should automatically get populated.
    Like below string:
    D:\DOCS\new.txt
    Is there any function module or method which does this kind of activity.
    Thanks in advance,
    Deepak

    this code will help:
    FORM get_filename  CHANGING p_filename.
      DATA      : lv_filename  TYPE string,
                  lv_rc TYPE i,
                  li_filetable TYPE filetable.
      CONSTANTS : lc_fname TYPE string VALUE 'ZRPP4000.XLS',
                  lc_fpath TYPE string VALUE 'C:\',
                  lc_extn TYPE string VALUE 'XLS'.
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        EXPORTING
          default_filename        = lc_fname
          initial_directory       = lc_fpath
          default_extension       = lc_extn
        CHANGING
          file_table              = li_filetable
          rc                      = lv_rc
        EXCEPTIONS
          file_open_dialog_failed = 1
          cntl_error              = 2
          error_no_gui            = 3
          not_supported_by_gui    = 4
          OTHERS                  = 5.
    IF  sy-subrc = 0 .
        READ TABLE li_filetable INTO lv_filename INDEX 1.
        IF sy-subrc = 0.
          p_filename = lv_filename.
        ENDIF.
      ENDIF.
      REFRESH li_filetable.
      CLEAR:lv_filename.
    ENDFORM.                    "get_filename
    " p_filename is selection screen parameter

  • How to create own Selection Parameter for ME2M list

    Dear Sir,
    We use ME2m tcode for getting list related to Purchase Order . We have been told that we can create our own "SELECTION PARAMETER" for ths report . Kindly guide us as what steps need to be done for this pl .
    With Thanks and Regards
    Sonia Mittal

    you can also set a variant for the existing / default ME2M screen
    fill all the required entries then click on GOTO >>Variants >Save as Variant
    next time when you run T code ME2M, you can select the variant and run the t code
    hope this will help you

  • How to use offset for select-option parameter ?

    Hi experts
    could anybody please let me know how to use offset for select-option parameter. i can able to use offset for table fields, variabiles and all , but don't know how to use for parameters.
    following is my code
    SELECT-OPTIONS: s_prctr  FOR vbsegs-prctr OBLIGATORY.
    here "prctr"  length is 10.
    i'm using two tables  1. vbsegd-bupla
                                    2. vbsegs-prctr
    here prctr+6(4) = bupla.
    "Bupla" length is 4
    SELECT belnr gjahr bukrs bupla sgtxt buzei FROM vbsegd INTO CORRESPONDING FIELDS OF TABLE it_vbsegd FOR ALL ENTRIES IN it_vbkpf
                                                                 WHERE belnr = it_vbkpf-belnr
                                                                   AND gjahr = it_vbkpf-gjahr
                                                                   AND bukrs = it_vbkpf-bukrs
                                                                   AND bupla IN s_prctr.  
    the above statement is not working as prctr and bupla lenths are different. here i want to use offset.
    SELECT belnr gjahr bukrs prctr sgtxt buzei FROM vbsegs INTO CORRESPONDING FIELDS OF TABLE it_vbsegs FOR ALL ENTRIES IN it_vbkpf
                                                                WHERE belnr = it_vbkpf-belnr
                                                                  AND gjahr = it_vbkpf-gjahr
                                                                  AND bukrs = it_vbkpf-bukrs
                                                                  AND prctr IN s_prctr.
    this is working as prctr and s_prctr lengths are equal.
    could anybody please help me out in this.
    Thanks in advance.
    regards
    satish

    Below code will work for you.
    SELECT-OPTIONS: s_prctr  FOR vbsegs-prctr OBLIGATORY.
    RANGES: s_bupla FOR vbsegd-bupla.
    s_bupla[] = s_prctr[].
    DELETE ADJACENT DUPLICATES FROM s_bupla.
    SELECT belnr gjahr bukrs bupla sgtxt buzei FROM vbsegd INTO CORRESPONDING FIELDS OF TABLE it_vbsegd FOR ALL ENTRIES IN it_vbkpf
                                                                  WHERE belnr = it_vbkpf-belnr
                                                                    AND gjahr = it_vbkpf-gjahr
                                                                    AND bukrs = it_vbkpf-bukrs
                                                                    AND bupla IN s_bupla.

  • Set Parameter for Select Option & Customized field

    Hi All,
    I had 2 questions here:
    1. This field in the report is a customized field and did not have any parameter.
        Is there any way to set the parameter for such fields?
    2. This field is a select option in the report.
        How can i set the parameter for the select option with lower and higher range?

    >
    Sally Teo wrote:
    > Hi All,
    >
    > I had 2 questions here:
    >
    > 1. This field in the report is a customized field and did not have any parameter.
    >     Is there any way to set the parameter for such fields?
    ----> plz ref ur prev.Post.
    >
    > 2. This field is a select option in the report.
    >     How can i set the parameter for the select option with lower and higher range?--->
    i dont think its possible to give High/low values to them, better to write small BDC to pass the data.
    regards
    Prabhu

  • Alias for parameter in query

    Hi,
    I'm new on SAP B1, and I try to generate a query with its manager.
    It's a beautiful tool.
    When I run my query, I need to ask a parameter to user.
    When SAP asks the parameter to user, it uses the database filed's name, but I'd like to use a my alias, so to help user.
    For example at least "Code" I'd like tu use my "Insert the item code".
    I'm sorry for my bad english, and I hope my question is clear.
    Thanks.

    Hi,
    Welcome you post on the forum.
    Your English is not bad at all. By default, B1 will use the database filed's name for query parameter. If you want to use alias, Crystal Report or XL Report is necessary.
    Thanks,
    Gordon

  • Disable selection parameter in Query

    Hi,
    I would like to disable selection parameter in query.
    I add below coding in SQ02 "at selection-screen output" but it cannot work. Any solution besides use variant to disable it?
    loop at screen.
      if screen-name = 'pa_date'.
        screen-input = '0'.
        modify screen.
      endif.
    endloop.
    Thanks.

    Hello Winnie,
       Yes you can. Try this one:
    <><><><><><><><><><><><><><><><><><><><><><><><><><><>
    Parameters: aram1  like mara-matnr.
    AT SELECTION-SCREEN OUTPUT.
      loop at screen.
        if screen-name eq 'PARAM1'.
          screen-input = 0.
          modify screen.
        endif.
      endloop.
    <><><><><><><><><><><><><><><><><><><><><><><><><><><>
    Happy coding!

  • Bex 2004s - Disabling Selection Sreen of a Query for the purpose of Views

    Hi,
    Is there possibility in Bex 2004s, where in we can disable Selection Sreen of a Query for the purpose of creating multiple Views.
    Thanks
    Praveen

    Hi,
    There is no posibility to disable the selection secren if there are any variables defined on a query. it can be done on the web applications side by inserting the command VARIABLESCREEN=" ". in this also it is only possible if there are no mandatory variables defined on the query.
    thanks

  • Not getting Selection(Prompt) option for the WebI Query.

    Hello Experts,
    I built WebI query for the custom query of SAP BI.I am not getting an selection or prompt for the WebI Query even though there is a selection in BI Query.If i develop WebI report for the standard query of the Bex i am getting selction options.
    Please suggest how can i do this.
    Thanks in Advance,
    Shiva Kumar G.C

    Hi Shiva,
    Where in the Query Designer are the selections defined?
    Selections defined under Characteristic Restrictions should show up when you run the webi report.
    Additional selections created under Default Values won't show running a webi report (that is just an additional filter on the data retrieved from the data warehouse).
    Regards,
    Harry

  • Select SUM in FOR ALL ENTRIES Select Query

    Hi ,
            I am using for all entries select statment ,can any one guide me how can i use SUM in the select statment with for all entries .
    Regards,
    Veera

    Hi,
    THis is  not possible using for all entries.
    Thanks,
    Sriram Ponna.

Maybe you are looking for