Select query based on Simple Type field in JDT

Hello Experts,
We have a JDT table consisting of a field "CONSUMPTION_ID" which refers to a Simpletype.So at oracle level the datatype of the field shows as CLOB instead of String. I am unable to use this simple type field in the WHERE clause in my bean .
Following are the queries i have tried and the errors i have got executing them :
Query1 -  SELECT * FROM TEST_TABLE WHERE CONSUMPTION_ID <> 'RT'
Error - com.sap.sql.log.OpenSQLException: The SQL statement "SELECT * FROM "TEST_TABLE " WHERE "REF_MAT_DOC_NO" = ? AND "REF_MAT_DOC_YEAR" = ? AND "CONSUMPTION_ID" <> 'RT'" contains the semantics error[s]: - 1:84 - type check error: the expression >>"CONSUMPTION_ID"<< (CLOB) is not comparable and must not be used with "<>"
- 1:84 - type check error: the left hand side >>"CONSUMPTION_ID"<< (CLOB) and the right hand side >>'RT'<< (CHAR) of a comparison operator are not comparable
Query 2 - SELECT * FROM TEST_TABLE WHERE to_char(CONSUMPTION_ID) <> 'RT'
Error - com.sap.sql.log.OpenSQLException: The SQL statement "SELECT * FROM TEST_TABLE  WHERE REF_MAT_DOC_NO = ? AND REF_MAT_DOC_YEAR = ? AND to_char(CONSUMPTION_ID) <> 'RT'" contains the syntax error[s]: - 1:91 - SQL syntax error: the token "(" was not expected here
Please let me know if any one has used WHERE clause on fields which refer to a simpletype in JDT, or any other solution to the above problem
Regards,
Virag

Hello Experts,
We have a JDT table consisting of a field "CONSUMPTION_ID" which refers to a Simpletype.So at oracle level the datatype of the field shows as CLOB instead of String. I am unable to use this simple type field in the WHERE clause in my bean .
Following are the queries i have tried and the errors i have got executing them :
Query1 -  SELECT * FROM TEST_TABLE WHERE CONSUMPTION_ID <> 'RT'
Error - com.sap.sql.log.OpenSQLException: The SQL statement "SELECT * FROM "TEST_TABLE " WHERE "REF_MAT_DOC_NO" = ? AND "REF_MAT_DOC_YEAR" = ? AND "CONSUMPTION_ID" <> 'RT'" contains the semantics error[s]: - 1:84 - type check error: the expression >>"CONSUMPTION_ID"<< (CLOB) is not comparable and must not be used with "<>"
- 1:84 - type check error: the left hand side >>"CONSUMPTION_ID"<< (CLOB) and the right hand side >>'RT'<< (CHAR) of a comparison operator are not comparable
Query 2 - SELECT * FROM TEST_TABLE WHERE to_char(CONSUMPTION_ID) <> 'RT'
Error - com.sap.sql.log.OpenSQLException: The SQL statement "SELECT * FROM TEST_TABLE  WHERE REF_MAT_DOC_NO = ? AND REF_MAT_DOC_YEAR = ? AND to_char(CONSUMPTION_ID) <> 'RT'" contains the syntax error[s]: - 1:91 - SQL syntax error: the token "(" was not expected here
Please let me know if any one has used WHERE clause on fields which refer to a simpletype in JDT, or any other solution to the above problem
Regards,
Virag

Similar Messages

  • SELECT QUERY  BASED ON SECONDARY INDEX

    Hi all,
    CAN ANYONE TELL ME HOW TO WRITE SELECT QUERY BASED ON SECONDARY INDEX.
    IN WHAT WAY DOES IT IMPROVE PERFORMANCE.
    i KNOW WHEN CREATING SECONDARY INDEX I NEED TO GIVE AN INDEX NO -iT SHOULD BE ANY NUMBER RIGHT?
    I HAVE TO LIST ALL PRIMARY KEYS FIRST AND THEN THE FIELD FOR WHICH I AM CREATING SECONDARY INDEX RIGHT?
    LETS SAY I HAVE 2 PRIMARY KEYS AND I WANT TO CREATE SEONDARY INDEX FOR 2 FIELDS THEN
    I NEED TO CREATE A SEPERTE SECONDARY INDEX FOR EACH ONE OF THOSE FIELDS OR ONE SHOULD BE ENOUGH
    pLS LET ME KNOW IF IAM WRONG

    HI,
    If you cannot use the primary index to determine the result set because, for example, none of the primary index fields occur in the WHERE or HAVINGclauses, the system searches through the entire table (full table scan). For this case, you can create secondary indexes, which can restrict the number of table entries searched to form the result set.
    You create secondary indexes using the ABAP Dictionary. There you can create its columns and define it as UNIQUE. However, you should not create secondary indexes to cover all possible combinations of fields.
    Only create one if you select data by fields that are not contained in another index, and the performance is very poor. Furthermore, you should only create secondary indexes for database tables from which you mainly read, since indexes have to be updated each time the database table is changed. <b>As a rule, secondary indexes should not contain more than four fields</b>, <b>and you should not have more than five indexes for a single database table</b>.
    <b>What to Keep in Mind for Secondary Indexes:</b>
    http://help.sap.com/saphelp_nw04s/helpdata/en/cf/21eb2d446011d189700000e8322d00/content.htm
    http://www.sap-img.com/abap/quick-note-on-design-of-secondary-database-indexes-and-logical-databases.htm
    Regards
    Sudheer

  • Select query based LOV for tabular form attributes

    Hi HTMLDB Team,
    Congrats u all for the new release of HTMLDB in htmldb.oracle.com.
    I badly need a solution of the below problem.
    Say , i have table called user_col_comments now i want to display the table_name ,column_name and comments in a tabular form.I displayed only one row for the tabular form.Now i create a select query based LOV for attribute table_name where i got all table_name in drop down list.
    Point is that after selecting any data from drop down table list i want to get the corresponding fields to be populated in column_name attributes.How can i wrote the select query based LOV for the attibute column_name.
    I wrote it as 'select column_name d,column_name r from user_col_comments where table_name=:TABLE_NAME Its not working?
    Similarly i want same thing to display for comments after matching both table_name and column_name.
    Any solution to get rid of those problem will be highly appreciable...
    If u need my htmldb.oracle.com userid and password to solve the problem i will sure let u email it.
    Cheers,
    Eman

    hi rchalton,
    can u plz little bit more clearer .I know hopefully u can imagine the problem and may u guide me thru proper way.....One think i understand that there must be multiple process and submit but "only when..." that u have said i cant understand that part........
    U are welcome to give me proper solution.....
    Thanks for the reply ....atleast one can pay hid to me.....
    Cheers,
    Eman

  • Select query based on userinput

    Hi Folks...
    I posted this in another forum, but no reply,so I am posting it here too. I am trying to make a select query based on a user input. Earlier I was having probelms making a select query and printing out the result in the stack trace,with the advice given, I managed to solve that. I am now modifying that code to make a query based on user input, however it's not working, following is the code:
    String userId = request.getRemoteUser();  String sql = "SELECT hoursused FROM sysuser WHERE iduser = ?";    try      {        Connection connection = dataSource.getConnection();        PreparedStatement preparedStatement = connection.prepareStatement(sql);        preparedStatement.setString(1, userId);                ResultSet srs = preparedStatement.executeQuery(sql);                            while(srs.next()) {                          String hoursused = srs.getString("hoursused");                          System.out.println("The hours used are " + hoursused);    }                  }    catch (SQLException e)      {    e.printStackTrace();    }        } 
    stack trace seems to suggest I may have a probelm with this statement:
    "SELECT hoursused FROM sysuser WHERE iduser = ?"; 
    I am not sure how to rectify this, I hope someone can advise, thanks.

    Hi jschell..
    Thanks for responding, I appreciate it. The problem has been solved. No 'sysuser' is not a reserved word in Mysql. Based on the advice given in another forum and also from this site, I managed to solve the problem. I only made one change. This:
    ResultSet srs = preparedStatement.executeQuery(sql);     was changed to this:
    ResultSet srs = preparedStatement.executeQuery();  Thanks.

  • Select Query Based on date condition

    Hi ,
    Is it Possible.
    i want to run select query based on date condition.
    Eg...
    if the date between 01-jan-01 and 01-jan-05 then
    select * from table1;
    if the date between 02-jan-05 and 01-jan-08 then
    select * from table2;
    Becaz i have data in 2 diffrent tables , based on the date condition i wnt to run the select statement to diffrent tables.
    i dont want plsql here Just SQL needed.
    thanks,
    -R
    Edited by: infant_raj on May 5, 2009 11:48 PM

    Helo Kanish,
    this is not the one i was asking..
    wht i mean was .
    i use bind variable to get date while running the select statement , once i get the date then i want to choose any one of the table to run select query.
    EG..
    select col1,col2 from table1 where date between only if 01-jan-01 and 01-jan-05;
    select col1,col2 from table2 where date between only if 02-jan-05 and 01-jan-08;
    Run any one of the two . not all
    thanks,
    _raj                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Problem with select range for a character type field. Kindly Help! Urgent!

    Hi Experts,
        I have to write a report to pull data from a table BUT000 for a selected range of  BPEXT field values in selection screen.
        In the table BUT000, the BPEXT field is type char. Now what is happening is that if the user gives a range in selection screen from 1000 to 1010 the query pulls all the records where teh forst character starts from 1.
    For example if the table has
        BPEXT
        1
        10
        100
        101
        1000
        1001
        1002
        1005
        1010
        20
        200
        2000
    Then my query pulls
       BPEXT
        101
        1000
        1001
        1002
        1005
        1010
       Instead it should pull only
       BPEXT
        1000
        1001
        1002
        1005
        1010
        My guess this is because the BPEXT field is of CHAR type instead of numeric.
        What shall i do to solve this problem? Kindly help please!   
    Thanks
    Gopal
    Message was edited by:
            gopalkrishna baliga

    Hi Chakradhar,
        How to find the conversion exit for BPEXT field?
        How to use the conversion exit in a select query in my ABAP report? Any sample code will be really helpfull.
       Please help!
    Thanks
    Gopal

  • Select query based on joining of tables from different database is taking too long

    Hi Team,
    Select query on table with millions of records is taking very long time. It took 50mins, the below query is joining on multiple table from two databases DB1.dbo.Table1 contains 100 million records and also Table3 and Table4 (of different database) might
    contain close to 1million records.
    Select T1.*
    From DB1.dbo.Table1 T1
    Join DB1.dbo.Table2 T2 on RTRIM(T1.Col3) = RTRIM(T2.Col3)
    Join Table4 CA on RTRIM(T1.Col1) + T2.Col2 = CA.Col1
    Join Table3 U on CA.Col2 = U.Col2 AND RTRIM(T2.Col2) = U.Col3
    Where U.Col4 NOT IN ('A1', 'A2', 'A3', 'A4', 'A5', 'A6','A7','A8','A9')
    And (T1.flg IS NULL OR T1.flg = 'N')
    And LTRIM(RTRIM(T2.Col2)) NOT IN ('B1','B2')
    How can i improve the performance of this query. Actual thing is update the data in Db1.dbo.table1 based on the conditions but if the select is taking close to 1hr then update will take hours together. Indexes already implemented on all the tables.
    Thanks,
    Eshwar.
    Please don't forget to Marked as Answer if my post solved your problem and use Vote As Helpful if a post was useful. It will helpful to other users.

    Thanks.
    Join Table4 CA on RTRIM(T1.Col1) + T2.Col2 = CA.Col1
    This join is not working with spaces if Rtrim is not used.
    Thanks! Eshwar.
    Please don't forget to Marked as Answer if my post solved your problem and use Vote As Helpful if a post was useful. It will helpful to other users.

  • Select query for char data type

    Hi Gurus,
         I am trying to fetch records from Z table.
    Below the select query.
    lv_low = '0900001' 
    lv_high = '0900002'
    select matnr sernr into table lt_sernr
    from   zsd_upd_deldoc
    where  sernr >= lv_low and sernr <= lv_high.
    but out put shows
    9000010
    9000011
    900002
    900001
    9000010
    9000019
    9000019
    9000018
    9000017
    9000014
    9000018
    9000017
    Expecting O/P
    900001
    900002
    Regards
    Vinayak Sapkal

    tables: zsd_upd_deldoc.
    data: begin of lt_table occurs 0,
    sign(1),
    option(2),
    low(18),
    high(18),
    end of lt_table.
    DATA: ls_doc_id_range LIKE LINE OF lt_table.
    FIELD-SYMBOLS: <fs> LIKE LINE OF lt_table.
      ls_doc_id_range-sign = 'I'.
      ls_doc_id_range-option = 'BT'.
      ls_doc_id_range-low = lv_low.
      ls_doc_id_range-high = lv_high.
      INSERT ls_doc_id_range INTO TABLE lt_table.
    select matnr sernr into table lt_sernr
    from   zsd_upd_deldoc
    where  sernr >= lv_low and sernr <= lv_high.
      select matnr sernr into table lt_sernr
      from   zsd_upd_deldoc
      where  sernr in lt_table.
      loop at lt_sernr assigning <fs_sernr>.
        write: / <fs_sernr>-sernr.
      endloop.
    O/P
    9000010
    9000011
    900002
    900001
    9000010
    9000019
    9000019
    9000018
    9000017
    9000014
    9000018
    9000017
    Regards
    Vinayak Sapkal

  • COPA account based extractor (Bill type field FKART) missing

    Hello Experts,
    I am new to COPA and currently working on account based COPA DataSource on ECC 6.0 & BI 7.0.
    I have created the DataSource in KEB0 for account based by selecting the appropriate operating concern. One of the field requirements for me is to have billing doc type but it is not available in KEB0 or in RSA6.
    When checked in KEA0 billing type (FKART) is available as display fixed fields.
    Main menu -> extras -> display fixed fields.
    Could you please let me know how to get this part of my DataSource?
    Does enhancing the DataSource is only the solution?
    Highly appreciate your help.
    Best Regards
    VJ

    Hi Vijay!
    If your current scenario does not present you with the standard extractor from the source system, perhaps you should try to create a generic datasource for your business requirements.

  • Selecting records based on value of field

    I have a table test with 10,000 records in it and 50 columns.
    I have to select those rows which contain values as "Sales Dum" in their field
    For table with small number of colums i did this
    SELECT * FROM tbl_website_dtl WHERE created_by like '%Sales%'
    or website_name like '%Sales%' or website_code like '%sales%';But should i do for table containing 50 columns.

    Hi,
    Use this procedure,
    CREATE OR REPLACE PACKAGE "GLOBALPKG" AUTHID CURRENT_USER AS
    TYPE RCT1 IS REF CURSOR;
    END GLOBALPKG;
    CREATE OR REPLACE PROCEDURE PL_SEARCH(IN_TABLE_NAME IN VARCHAR2,IN_SEARCH_STRING IN VARCHAR2,RC1 OUT GLOBALPKG.RCT1)
    IS
    V_MESSAGE VARCHAR2(255);
    V_STMT VARCHAR2(2000):='SELECT * FROM '||IN_TABLE_NAME||' WHERE ';
    BEGIN
    FOR R1 IN (SELECT * FROM user_tab_cols WHERE TABLE_NAME=IN_TABLE_NAME AND CHARACTER_SET_NAME='CHAR_CS')
    LOOP
    V_STMT:=V_STMT||' '||R1.COLUMN_NAME||' like ''%'||IN_SEARCH_STRING||'%'' AND ';
    END LOOP;
    V_STMT:=V_STMT||' 1=1';
    OPEN RC1 FOR V_STMT;
    EXCEPTION
    WHEN OTHERS THEN
    V_MESSAGE:=SUBSTR(SQLERRM,1,255);
    OPEN RC1 FOR SELECT V_MESSAGE FROM DUAL;
    END;

  • Want to select query based on sample data.

    My Oracle Version
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    I am creating inventory valuation report using FIFO method . here sample data .
    create table tranx(
    TRXTYPE     varchar2(10) ,ITEM_CODE varchar2(10),     RATE number,qty number
    insert into tranx values('IN'     ,'14042014',     457.2     ,10);
    insert into tranx values('OUT','14042014',     0,          10);
    insert into tranx  values('IN','14042014',     458.1,     35);
    insert into  tranx values('OUT','14042014',     0,          11);
    insert into  tranx values('OUT','14042014',     0,          6);
    insert into  tranx values('IN','     14042014',     457.2     ,10);
    insert into tranx  values('OUT','     14042014',     0,          3);
    insert into tranx  values('OUT','     14042014',     0,          4);
    insert into tranx  values('IN','     14042014',     457.2,     20);
    insert into tranx  values('OUT','     14042014',     0,          5);
    insert into tranx  values('OUT','     14042014',     0,          9);
    insert into tranx  values('OUT','     14042014',     0,          8);
    current output
    TRXTYPE     ITEM_CODE     RATE      QTY
    IN     14042014     457.2     10
    OUT     14042014     0          10
    IN     14042014     458.1     35
    OUT     14042014     0          11
    OUT     14042014     0          6
    IN     14042014     457.2     10
    OUT     14042014     0          3
    OUT     14042014     0          4
    IN     14042014     457.2     20
    OUT     14042014     0          5
    OUT     14042014     0          9
    OUT     14042014     0          8above data populate based on first in first out . but out rate is not comes from that query. suppose fist 10 qty are OUT its rate same as IN. but when qty start out from 35 rate will be 458.1 till all 35 qty will not out. like out qty 11,6,3,4,5,9 now total are 38 .
    when qty 9 will out the rate are 6 qty rate 458.1 and other 3 out rate of 457.2 means total value of 9 out qty value is 4120.20 .
    Now 35 qty is completed and after that rate will continue with 457.2 till 10 qty not completed.
    I think you understand my detail if not please tell me .
    thanks
    i am waiting your reply.

    As SomeoneElse mentioned, there is no row order in relational tables, so you can't tell which row is first and which is next unless ORDER BY is used. So I added column SEQ to your table:
    SQL> select  *
      2    from  tranx
      3  /
    TRXTYPE    ITEM_CODE        RATE        QTY        SEQ
    IN         14042014        457.2         10          1
    OUT        14042014            0         10          2
    IN         14042014        458.1         35          3
    OUT        14042014            0         11          4
    OUT        14042014            0          6          5
    IN         14042014        457.2         10          6
    OUT        14042014            0          3          7
    OUT        14042014            0          4          8
    IN         14042014        457.2         20          9
    OUT        14042014            0          5         10
    OUT        14042014            0          9         11
    TRXTYPE    ITEM_CODE        RATE        QTY        SEQ
    OUT        14042014            0          8         12
    12 rows selected.
    SQL> Now it can be solved. Your task requires either hierarchical or recursive solution. Below is recursive solution using MODEL:
    with t as (
               select  tranx.*,
                       case trxtype
                         when 'IN' then row_number() over(partition by item_code,trxtype order by seq)
                         else 0
                       end rn_in,
                       case trxtype
                         when 'OUT' then row_number() over(partition by item_code,trxtype order by seq)
                         else 0
                       end rn_out,
                       count(case trxtype when 'OUT' then 1 end) over(partition by item_code) cnt_out
                 from  tranx
    select  trxtype,
            item_code,
            rate,
            qty
      from  t
      model
        partition by(item_code)
        dimension by(rn_in,rn_out)
        measures(trxtype,rate,qty,qty qty_remainder,cnt_out,1 current_in,seq)
        rules iterate(10) until(iteration_number + 1 = cnt_out[0,1])
         rate[0,iteration_number + 1]          = rate[current_in[1,0],0],
         qty_remainder[0,iteration_number + 1] = case sign(qty_remainder[0,cv() - 1])
                                                   when 1 then qty_remainder[0,cv() - 1] - qty[0,cv()]
                                                   else qty[current_in[1,0],0] - qty[0,cv()] + nvl(qty_remainder[0,cv() - 1],0)
                                                 end,
         current_in[1,0]                       = case sign(qty_remainder[0,iteration_number + 1])
                                                   when 1 then current_in[1,0]
                                                   else current_in[1,0] + 1
                                                 end
      order by seq
    TRXTYPE    ITEM_CODE        RATE        QTY
    IN         14042014        457.2         10
    OUT        14042014        457.2         10
    IN         14042014        458.1         35
    OUT        14042014        458.1         11
    OUT        14042014        458.1          6
    IN         14042014        457.2         10
    OUT        14042014        458.1          3
    OUT        14042014        458.1          4
    IN         14042014        457.2         20
    OUT        14042014        458.1          5
    OUT        14042014        458.1          9
    TRXTYPE    ITEM_CODE        RATE        QTY
    OUT        14042014        457.2          8
    12 rows selected.
    SQL> SY.

  • Select option for a character type field

    Hi all as per my requirement i have a selection for a data type char40
    Hence in my wddoinit method i used the following code to generate the select options in WD
    create a range table that consists of this new data element
      LT_RANGE_TABLE = WD_THIS->M_HANDLER->CREATE_RANGE_TABLE( I_TYPENAME = 'CHAR40' ).
    add a new field to the selection
      WD_THIS->M_HANDLER->ADD_SELECTION_FIELD( I_ID = 'CHAR40'
      IT_RESULT = LT_RANGE_TABLE I_READ_ONLY = READ_ONLY I_NO_INTERVALS = 'X').
    The select option is properly displayed but "char" word is infront of the selection fields.
    I want to remove this char word.
    Can someone please advice me on this ?

    Hi
    Modify the Add_selection_field call to add descrption for the field.
    if you dont want anything pass space.
    * add a new field to the selection
    WD_THIS->M_HANDLER->ADD_SELECTION_FIELD(
    I_ID = 'CHAR40'
    IT_RESULT = LT_RANGE_TABLE
    I_READ_ONLY = READ_ONLY
    I_NO_INTERVALS = 'X'
    I_DESCRIPTION     = '   '                    " whatever you pass here will come as a label to the field or we can say
                                                             " inplace of CHAR
    thanks
    sarbjeet singh

  • Using select query to insert into a field

    Hi,
    I am working with a jdbc-to-jdbc scenario, in which on source side iam geting data from 2 tables t1 & t2 and inserting this data into two tables tb1 & tb2 on target side.A field in tb2 has to be inserted with a value which is equal to the number of records inserted into the table tb1 i.e with the number equal to 'how many records from the table t1 has been retrieved inorder to insert into table tb1'.
    Can anybody please suggest me.....
    Thanks & Regards,
    Radhika.

    consider ur strucutre
    <Data>
    <id> 1 </id> 0..1
    <id> 2 </id>
    <id> 3 </id>
    <id> 4 </id>
    </Data>
    here i meant context to <id>. Mapping id > count > target will give the nunmber of records in Data i.e. 4
    note: here u have change the context of <id> to <data>
    Message was edited by:
            Prabhu  S

  • How to create a Type Object with Dynamic select query columns in a Function

    Hi Every One,
    I'm trying to figure out how to write a piplined function that executes a dynamic select query and construct a Type Object in order to assigned it to the pipe row.
    I have tried by
    SELECT a.DB_QUERY INTO actual_query FROM mytable a WHERE a.country_code = 'US';
    c :=DBMS_SQL.OPEN_CURSOR;
    DBMS_SQL.PARSE(c,actual_query,DBMS_SQL.NATIVE);
    l_status := DBMS_SQL.EXECUTE(c);
    DBMS_SQL.DESCRIBE_COLUMNS(c, col_cnt, rec_tab);
    FOR j in 1..col_cnt LOOP
    DBMS_SQL.DEFINE_COLUMN(c,j,v_val,2000);
    END LOOP;
    FOR j in 1..col_cnt LOOP
    DBMS_SQL.COLUMN_VALUE(c,j,v_val);
    END LOOP;
    But got stuck, how to iterate the values and assign to a Type Object from the cursor. Can any one guide me how to do the process.
    Thanks,
    mallikj2

    Hi Justin,
    First of thanks for your reply, and coming to my requirement, I need to report the list of items which are there in the dynamic select statement what am getting from the DB. The select statement number of columns may vary in my example for different countries the select item columns count is different. For US its '15', for UK it may be 10 ...like so, and some of the column value might be a combination or calculation part of other table columns (The select query contains more than one table in the from clause).
    In order to execute the dynamic select statement and return the result i choose to write a function which will parse the cursor for dynamic query and then iterate the values and construct a Type Object and append it to the pipe row.
    Am relatively very new for these sort of things, welcome in case of any suggestions to make it simple (Instead of the function what i thought to work with) also a sample narrating the new procedure will be appreciated.
    Thanks in Advance,
    mallikj2.

  • 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.

Maybe you are looking for

  • PDF stuck in my Camera Roll!

    I didn't even know such a thing was possible, but it is. Here's how it happened. In his column yesterday, Andy Ihnatko said that it was easy to move PDFs into iBooks: "if the Mail app sees a PDF as a file attachment, it can send the file directly int

  • Scatter Plot Option

    In many cases a scatter plot is necessary to evaluate measured data. A direct option to select a scatter plot chart in the 2D-axes Dialogbox would improve the usability of Diadem VIEW a lot.

  • Regarding Netting

    Hi, I am writing a custom program that will be attached to the transaction O3B7 (Netting Document Creation). This Output type will be attached to my program in NACE Transaction. I wish to know the standard program that I can refer to for designing my

  • PM Notification archiving -clarification -reg

    HI, While planning for PM notifications archiving , io the preprocessing step  of the tcode SARA , we dont find any reference date . We need to archive notification which are changed before two years we can take the details from QMEL like table  and

  • Creating Multi-use hierarchy or display of profit centers

    Good evening! I am trying to create a per unit report by profit center for my system.  I have multi acute care facilities that all use the same first four digits for their profit centers.  My report currently has multiple columns of data by profit ce