In Select query how to fetch values through multiple parameters  where conditon

Dear Experts,
I have one table(T) with 4 fields: f1, f2, f3, f4. In that based on f2, f3, f4 and parameter condition( f2 values) how to fetch f1 values. I have attached screen shot. What is the where condition in select query?
DATA: it_T type standard table of ty_T,
          wa_T type ty_T.
parameters: p_f2_1 type T-f3,
                  p_f2_2 type T-f3,
                  p_f2_3 type T-f3,
                  p_f2_4 type T-f4,
                  p_f2_5 type T-f4,
                  p_f2_6 type T-f4.
select f1  f2  f3  f4 from T into table it_T where ?
What is the where condition ?.
Regards,
Abbas.

Hi Syed,
Do all the parameters p_f2_1 ... p_f2_6 contain values for the same field f2? And do you need all the entries from the table T which contain f2 = any of the entered value? If yes, Then you can try the following where condition -
select f1  f2  f3  f4 from T into table it_T
  where f2 =  p_f2_1  OR
             f2 =  p_f2_2  OR
             f2 =  p_f2_3  OR
             f2 =  p_f2_4  OR
             f2 =  p_f2_5  OR
             f2 =  p_f2_6.
P.S: If any of the above parameters are optional as per your requirement it will be better to build a dynamic query and use it in the where condition.
Regards,
Rachna.

Similar Messages

  • Selection screen / how to clear values in screen parameters parameters

    Hello ,
    I am developing report . It is simple one with standard screen 1000  ( Not Dynpro ).
    On the screen I have several parameters and select options . When I run program , display list
    and press the "Back" Button from tool bar  ,entered values still remain in screen parameters.
    I  code I did 'clear' of parameters  , so after pressing "back" button and before selection screen
    is displayed the parameters show up as initial ( empty ) but once selection screen is displayed
    the values are in parameters again .
    Can you advice how I can clean up the values from  screen parameters  .
    Thank you

    Hi,
    Try the below code....
    DATA: executed TYPE n.
    SELECT-OPTIONS : selop1 FOR sy-datum.
    INITIALIZATION.
    executed = 1.
    AT SELECTION-SCREEN OUTPUT.
      BREAK-POINT.
      IF executed = 1.
        executed = 0.
        REFRESH: selop1.
        CLEAR : selop1.
      ENDIF.
    Regards
    Arbind

  • How to bind values for input parameters from an adf table?

    Hi,
    The version I am using is
    Jdev TP4 11.1.1.0.0
    I need to know how to bind values for input parameters to methods.
    I have created an af:table and I have a button created using a method which is outside the af:table. This method needs to take input parameter values from the column values in the table.
    When I have an adf form instead of the table the binding works.
    Any help?
    Thanks.

    Hi Balaji,
    you need to bind you table to a backing bean and call a method in the backing bean when you hit the button. In the method you get the selected row from the table and have access to the columns of it. Then call the the method with the parameters.
    To bind the table to a bean select the properties of the table, go to behavior section and look for the advanced section 'Binding' property.
    Select the small down arrow at the right side and click edit. In the dialog select or create a bean and property for the table.
    Go to the button properties, look for 'Action', again select the small down arrow and click 'Edit'. Select the bean which holds the table property and create a method for the button.
    The method look like    public void bearbeitenQuelle(ActionEvent actionEvent)
            // Add event code here...
            RichTable lTable = getYourTable();
            Object lData = lTable.getSelectedRowData();
            FacesCtrlHierNodeBinding lNB = (FacesCtrlHierNodeBinding) lData;
            YourViewRow lRow = (YourViewRow ) lNB.getCurrentRow();
        }Hope the get you started
    Timo

  • Variable has SELECT query how to execute it

    hi all
         question may be odd one but guide me on that.
    requirement is as ,  i have a BAPI which have a STRING type INPUT parameter let P1,  P1 contain a SELECT query as its value.
      now i want to execute the select query which P1 contain in my BAPI , how i can do it.
    e.g.
         P1 = 'Select single * from MARA .'  
    now  either i have extract the P1 OR have to do something to get this query executed .
    please guide me.

    Hi
    We can use the FM
    Earlier WS_QUERY was there but it is obsolete. we need to check for the new one.
    Or try  to use the FM
    GUI_EXEC to run it.
    Thanks & Regards,
    Chandralekha.

  • Calling procedure in another procedure, how to fetch values

    I have couple of procedure in a package and I am trying to call procedurea in procedureb.
    TYPE T_CURSOR IS REF CURSOR;
    PROCEDURE ProcedureA (acct IN number, o_cur OUT T_CURSOR)
    AS
    BEGIN
          Open o_cur for
           SELECT A, B, C, D, E, F FROM DEMO;
    END ProcedureA
    PROCEDURE ProcedureB (param1 IN number, param2 IN number)
    AS
    get_cursor                 T_CURSOR;
    BEGIN
    ProcedureA(111, get_cursor);
    END;How to fetch ProcedureA values in ProcedureB? And also I want to get only columns A and B in ProcedureB.

    >
    How to fetch ProcedureA values in ProcedureB?
    >
    Try something like this
    TYPE rectype IS RECORD (colA  demo.a%TYPE, colB demo.b%TYPE    );
         rec1  rectype;
    LOOP
      FETCH get_cursor   INTO rec1;
      EXIT WHEN get_cursor%NOTFOUND;
            DBMS_OUTPUT.PUT_LINE(rec1.colA);
         END LOOP;
           DBMS_OUTPUT.PUT_LINE('end test');

  • MDO select query: how to control sort order using parameter

    Hi experts, is there a way of controling the sort order of an MDO select query using some parameter?
    I was thinking about using some statement like CASE [Param.1] WHEN 'abc' THEN [ORDER_NO]...END in sort section of the query but it is not working.
    Of course I colud go for various select queries...but I am wondering if it can be done using only one?
    Any ideas?
    Thanks for any help

    Hi Marco,
    Yes this can be achieved dynamically using SortExpr under dynamic link assignment in MDOAction block if you are using a transaction to call it.
    Please check below thread:
    Re: MDO Query Action Block In MII Transaction
    Or else, this [Param.1] thing should work as well provided it doesn't get the logic part in it, just pass the columns names separated by comma. Haven't tried it though, will check it for you.
    Best Regards,
    Swaroop

  • How to sum values from multiple lines in a DataTable?

    I have a Lookout program which uses a DataTable to allow users to write basic programs (relay on/off times, which relays change state, and pause times).  The DataTable cursor position changes to advance from one program stage to another.  
    What I would like to do is sum up the times from all the various stages.  Can anyone suggest how I might iterate through the DataTable using Lookout alone?  
    Thanks,
    Dave 

    I have tried to make 'loops' similar to that one but Lookout shows a message that iterations or loops for a variable are not allowed.
    You can use a sequencer but there are 2 inconvenients:
    1.- For a fast computer every step of the sequencer cannot be faster than 0.1 - 0.2 seconds. If you have many iteraciones, it will take some time.
    2.- The sequencer object has a maximimum of 100 steps.
    Ryan S. Here are questions for you:
    1.- Is there a way to add in the lks file statements and or functions using existing variables? What can be done and what not?
    2.- Is there a way to insert comments in the lks file?
    Thanks in advance.
    Rudy Lopez

  • How to set values of a parameterized message in ADF Faces?

    Hi all,
    i've got the following problem: I want to set the values of a parameterized message before i add the message to the FacesContext.
    Contents of the message resource bundle:
    testPage.successMsg.create=The device {0} was created successfully!
    Code within backing bean method:
    String message = getStringFromBundle("testPage.successMsg.create");
    FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(message));
    In Struts/ADF UIX the following code did the job:
    protected void setUIXInfoMessage(HttpServletRequest request, String key, Object[] args)
    MessageData msgs = new MessageData();
    MessageResources mr = this.getResources(request);
    String msg = "";
    if (mr != null)
    msg = mr.getMessage(request.getLocale(), key, args);
    msgs.addMessage(null, msg, null, UIConstants.MESSAGE_TYPE_INFO);
    request.setAttribute(UIX_MESSAGE_KEY, msgs);
    Can anyone help me with this problem? I have searched a lot in the Oracle ADF Development Guide and within forum, but did not find any solution.
    Another interesting thing is, how to set the parameters from jspx-Code.
    How can i achieve the same results in ADF Faces corresponding to the following UIX-Code:
    <boundAttribute name="title">
    <messageFormat format="${nls['deleteTip.confirmation']}">
    <dataObject source="${bindings.TipName}"/>
    </messageFormat>
    </boundAttribute>
    Resource Bundle:
    deleteTip.confirmation=Do you really want to delete the tip {0}?
    Another question:
    What are the corresponding elements in ADF Faces corresponding to <concat> and <if> in UIX or what possibilites exist in ADF Faces to dynamically concatenate strings depending on certain conditions?
    I know, these are many questions. I am familiar with UIX, but now i have to start developing applications with ADF Faces and there are some things i don't find corresponding equivalents.
    Thanks in advance!
    Regards,
    Stefan

    Hi,
    SRDemo shows you how to do this declratively
    <h:outputFormat value="#{res['srcreate.confirmPanel.message']}"
    escape="false" id="nextButton">
    <f:param value="#{requestScope.SRDEMO_CREATED_SVRID}"/>
    </h:outputFormat>
    where the <f:param ...> element sets the value of the variable
    To programmatically access internationalized strings, SRDemo uses
    private static ResourceBundle getBundle() {
    FacesContext ctx = getFacesContext();
    UIViewRoot uiRoot = ctx.getViewRoot();
    Locale locale = uiRoot.getLocale();
    ClassLoader ldr = Thread.currentThread().getContextClassLoader();
    return ResourceBundle.getBundle(ctx.getApplication().getMessageBundle(),
    locale, ldr);
    public static String getStringFromBundle(String key) {
    ResourceBundle bundle = getBundle();
    return getStringSafely(bundle, key, null);
    You take it from there and put it to a FacesMessage, If it uses parameters I guess you will have to parse the string
    Frank

  • How to create VO with multiple dynamic where clauses on select with UNION?

    I am trying to implement the View Object for the UNION query that looks like this:
         select a,b,c...
              from t1,t2,...
              where dynamic_where_clause1     
         union all
         select a,b,c,...
              from t11,t12, ...
              where dynamic_where_clause2
    There are up to 60 input parameters that are used to generate dynamic where clauses. They are actually created by calling PL SQL function.
    So far, I was not able to assign both where clauses to the view object. Is there a workable solution for this problem, besides resorting to programmatic View Object?
    I understand that recommended way with UNIONs is to wrap both queries into a parent select:
    select * from (
         select a,b,c...
              from t1,t2,...
              where ... -- table relationship joints
         union all
         select a,b,c,...
              from t11,t12, ...
              where ... -- table relationship joints
    ) QRSLT
         where dynamic_where_clause
    Unfortunately this approach doesn't work here, since individual selects are producing unmanageable amount of data and resulting query takes forever to complete.

    I afraid I would not have any real benefits from using VO if I replace the entire query with every request. Actually, the performance may suffer.
    I solved the problem by creating a POJO Data Control and invoking the custom select query from java. Not sure if it is the best approach to the problem, but implementation time is limited and it works.
    Actually, this is not the first time I see the need to implement VO with complicated SQL like select with unions and dynamic pieces. It would be nice to find a solution and not resort to workarounds.
    Edited by: viksicom on Aug 2, 2012 8:48 AM

  • Query - How to output data to multiple Excel tabs?

    Hello,
    I have a quick question. Is it possible to build an ABAP query to send output data to multiple tabs in an Excel spreadsheet? I know this can be done at a single (first) tab level, but I am not sure if outputting data to multiple tabs is possible.
    For example, the address data for the different European countries should be directed to different tabs such as U.K., France, Germany, etc based on the country of residence.
    I appreciate your help with this.
    Thanks!

    Hi
    I think it is possible
    You define a common internal table with the address fields  and  based on the Language condition this table will be populated
    call the fun module to donwload to excel in a PERFORM using this Internal table and Language as paramter
    so that based on the language selection/condition the internal table will be filled from the data and that data will be passed to the fun module and downloaded to the file name given .
    pass the different file names to the fun module along with the PERFORM statement, so that different files will be created based on language
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • How to fetch values between two days of a month

    Hi,
    I have fetch the values which are greater inserted on or after of 16th day of one and any month.
    I am trying with following query for a month of dec :
    select *
    from tablename
    where SUBSTR(TO_DATE(TO_CHAR(colname, 'DD-MON'),'DDMM'),1,6) >= '16-Dec'
    and SUBSTR(TO_DATE(TO_CHAR(colname, 'DD-MON'),'DDMM'),1,6) < '31-Dec'
    but its not giving me the desired result.
    I have to pick the resultset of everyyear.
    Please help me in this matter.

    Thanks a lot guys!!
    My problem is solved.That's good news, but be aware that the solutions presented are not all good:
    SQL> select * from tablename order by colname
      2  /
    COLNAME
    23-12-2005 11:03:12
    28-12-2005 11:03:12
    02-01-2006 11:03:12
    13-11-2006 11:03:12
    13-12-2006 11:03:12
    23-12-2006 11:03:12
    24-12-2006 11:03:12
    25-12-2006 11:03:12
    31-12-2006 11:03:12
    9 rijen zijn geselecteerd.
    SQL> select colname
      2    from tablename
      3   where to_date(to_char(colname,'ddmm') || '2006','ddmmyyyy')
      4         between to_date('16122006','ddmmyyyy')
      5             and to_date('01012007','ddmmyyyy') - 1/24/60/60
      6  /
    COLNAME
    23-12-2006 11:03:12
    24-12-2006 11:03:12
    25-12-2006 11:03:12
    31-12-2006 11:03:12
    23-12-2005 11:03:12
    28-12-2005 11:03:12
    6 rijen zijn geselecteerd.
    SQL> remark Mohana's solution
    SQL> select *
      2  from tablename
      3  where TO_CHAR(colname, 'DD-MON') >= '16-DEC'
      4  and TO_CHAR(colname, 'DD-MON') < '31-DEC'
      5  /
    COLNAME
    23-12-2006 11:03:12
    24-12-2006 11:03:12
    25-12-2006 11:03:12
    23-12-2005 11:03:12
    28-12-2005 11:03:12
    5 rijen zijn geselecteerd.
    SQL> remark user503699's solution
    SQL> select *
      2  from tablename
      3  where TO_CHAR(colname, 'MON') = 'DEC'
      4  and ( TO_NUMBER(TO_CHAR(colname, 'DD')) >= 16
      5  and TO_NUMBER(TO_CHAR(colname, 'DD')) <= 31 )
      6  /
    COLNAME
    23-12-2006 11:03:12
    24-12-2006 11:03:12
    25-12-2006 11:03:12
    31-12-2006 11:03:12
    23-12-2005 11:03:12
    28-12-2005 11:03:12
    6 rijen zijn geselecteerd.
    SQL> remark Rup's solution
    SQL> select *
      2  from tablename
      3  where TO_CHAR(colname, 'DD-MON-yyyy') >= to_date('16-DEC','dd-mon')
      4  and TO_CHAR(colname, 'DD-MON-yyyy') < to_date('31-DEC','dd-MON')
      5  /
    COLNAME
    23-12-2006 11:03:12
    24-12-2006 11:03:12
    25-12-2006 11:03:12
    3 rijen zijn geselecteerd.So use user503699's solution or mine ;-)
    Hope this helps.
    Regards,
    Rob.

  • How to fetch values at runtime in field exit function module

    Hi all,
    I am creating a field exit for delivery date in Purchase requisition.
    For that I need to capture Delivery Date and Sale Order entered in purchase requisition and pass this to Function module and validate this data.
    I am using import and export parameters but it is giving runtime error.
    please tell me how to solve it.
    Regards,
    Sunny

    Hi,
    There are other ways to access the purchase requisition related values..that is using field symbols..
    pls check the below mentioned link:
    Re: Pricing Routine : Can we get the VBAP Data in this pricing routine.(VOFM)
    Identify the similar data fields for requisition.
    Hope this wil help..
    Sumit

  • SELECT Query to get the Values in Case insensitive Format

    Hi ,
    This is hari,
    I want to select the user name in a table ex: username="HARI" or username='Hari' or username="HaRi" like this
    If i wrote the query like
    select username from userdb where username="Hari";
    it is displaying the records which only matches "Hari" only .
    can anybody help me out on this query asap please....
    the query should return all the results
    which matches any of the following strings as inputs "HARI" or "HaRi" or "hAri" or the like.
    Awaiting for Response,
    Thanks & Regards
    Hari

    Another solution is setting NLS_SORT to CI - case insensitive (or whatever_your_language_is_CI) and NLS_COMP to ANSI:
    SQL> with t as (
      2             select 'HARI' name from dual union all
      3             select 'Hari' name from dual union all
      4             select 'HaRi' name from dual
      5            )
      6  select  *
      7    from  t
      8    where name = 'hArI'
      9  /
    no rows selected
    SQL> alter session set nls_sort = binary_ci
      2  /
    Session altered.
    SQL> alter session set nls_comp=ansi
      2  /
    Session altered.
    SQL> with t as (
      2             select 'HARI' name from dual union all
      3             select 'Hari' name from dual union all
      4             select 'HaRi' name from dual
      5            )
      6  select  *
      7    from  t
      8    where name = 'hArI'
      9  /
    NAME
    HARI
    Hari
    HaRi
    SQL> SY.

  • From SharePoint Content Database, Using SQL-Server Query how to fetch the 'Document GUID' based on 'Content Type'

    I want to get all the documents based on content type using SQL Server Query. I know that, querying the content database without using API is not advisable, but still i want to perform this action through SQL Server Query. Can someone assist ?

    You're right, it's not advisable, may result in corruption of your databases and might impact performance and stability. But assuming you're happy to do that then it is possible.
    Before you go down that route, have you considered using something more safe like PowerShell? I've seen a script exactly like the one you describe and it would take far less time to do it through PS than it would through SQL.

  • PAAPINVW -- how to fetch values for invoice line level details

    My requirement is such that we define one of our account segments at invoice line dff's while creating the invoice against a project. So the ccid would need to driven from this invoice line dff, to be complete and valid.
    Project Supplier Invoice Account Generator (PAAPINVW) has already defined attributes for Invoice Header DFF's and Invoice Distribution level DFF's; but Invoice line level DFF's have not been defined.
    Also there are no attributes that would help me query the invoice line to fetch these details.
    Working on this workflow in R12. Has anyone tried to fetch any sort of details from invoice lines, using any existing attributes in PAAPINVW; or has anyone done something in accordance to this??
    Looking for suggestions.. have anyone faced a similar situation before??

    Hi user;
    Pelase check below note cause and solution part please,which at least can gives u some ideas
    Projects Supplier Invoice Account Generation Error: APP-SQLAP-97734: The System Cannot Generate Distributions [ID 823787.1]Regard
    Regard
    Helios

Maybe you are looking for

  • Payment with clearing in Cash journal

    Hi all 1.Is there any way to make payment with clearing of vendor payment through cash jounal? 2.Is there any way to deduct TDS while making advance payment to vendor through cash journal? Regards Prakash.

  • Garageband versus Audacity - when to use which?

    I've had iLife for a number of years now but I've generally found Audacity has met all my recording needs - mostly recording and editing stuff off the radio, or recording my own amateurish music-making live, i.e. without using tracks. Lately, however

  • How to Compile Servlet Java Files

    hello ... i am a beginner at JSPs and java servlets ... i have been searchin' hopelessly for the past couple of days. Could someone please guide me on how to compile source files for servlets ... namely how can i include the packages javax.servlet.*

  • Desktop Software won't download device updates?

    Hi, I recently bought a BB Torch and would like to add more language supports via the Desktop Software (ver. 6). However, the installer won't go past the back up phase as the update window immediately closes upon entering the 'downloading device soft

  • DIR creation in easyDMS through template

    Hi, Is there anyway to create DIR in easyDMS through template. Thanks. Anirudh,