Offset operation in select statements where clause

dear experts,
    if i use offset operation in select query , syntactically giving
    me a warning message.
    how to avoid warning message
    without using another internal table populated with  only  jtab+0(10).  
   ex:
          select field1 field2
                    into table   itab
                    from ztable1
                    for all entries in jtab
                    where field =  jtab+0(10).
thanks in advance.

No need to populate another internal table...
when populating jtab from database select ur field twice
structure for jtab..
types: begin of ty_jtab,
          field type ...
          field1 type char10,
        end of ty_jtab.
populate the field twice..
   select ...
             field
             field
into table jtab
Now u can use the field field1 in the next select
select field1 field2
into table itab
from ztable1
for all entries in jtab
where field = jtab-field1.

Similar Messages

  • Select Statement -- Where Clause Execution Order

    What is the order of execution of the "AND" and "OR" in the WHERE clause of a Select statement?
    Are the "AND"'s executed from the top down, left to right? Is it the same for the "OR"'s execution?
    Thanks for any help...

    Not clear why you care. There is an order in which the optimizer parses the SQL (which may change from ver to ver), but this is a fairly quick operation. The order in which tables are visited and predicates evaluated is dependent on what the op[timizer does with the SQL.
    Ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Cp  operator in select statement

    Hi i am getting error when i write the below select statement, could any one please let me know, how to use  CP operator in select statement
    my code was
    SELECT lifnr name1 FROM lfa1 INTO CORRESPONDING
            FIELDS OF TABLE lt_lfa1 
            WHERE lifnr CP lv_lifnr AND
                  name1 CP  lv_name1.
    Thanks
    Srini
    Message was edited by: Manish Kumar <spoonfeeding, thread locked by moderator>
    Message was edited by: Manish Kumar

    either you have select-options with lifnr and name and use them in the below query as
    SELECT lifnr name1 FROM lfa1 INTO CORRESPONDING
            FIELDS OF TABLE lt_lfa1 
            WHERE lifnr in s_lifnr AND
                  name1 in s_name1.
    else you need to declare internal tables with structure as below..
    DATA: begin of ls_user1,
        sign type c,
        option(2) type c,
        low(90) type c,
        high(90) type c,
       end of ls_user1.
    data: lt_lifnr like ls_user1 occurs 0,
             lt_name1 like ls_user1 occurs 0.
    and then populate these as
    ls_user1-sign = 'I'.
    ls_user1-option = 'CP'.
    ls_user1-low = '*'.  populate with whatever pattern you want
    APPEND ls_user1 TO lt_lifnr
    similarly do it for NAME1 and use them in the query.

  • Operation in Select Statement

    Hi,
    In an ABAP select statement, how to do operations on two columns of a dictionary transparent table(say division or multiplication on two column values) ?
    Reward points will be awarded .
    TIA
    Regards,
    Anindita

    hi,
    see the below link
    i hope it will useful for u .
    http://help.sap.com/saphelp_nw04/helpdata/en/62/10a423384746e8bf5f15ccdd36e8b1/content.htm
    SELECT AVG(salary) FROM employees
    SELECT COUNT(*) FROM employees
    SELECT COUNT(DISTINCT employee_name) FROM employees
    SELECT employee_name, salary + benefit
                   FROM employees
                   WHERE salary < 0.8 *
                      ( SELECT MAX( salary ) FROM employees )
    Arithmetic Expressions. For all employees that have a salary not exceeding 80% of the salary of the maximum salary of all employees, this query returns the name of the employee and the sum of its salary and its benefit.
    reward if its useful
    Edited by: p541399 on Feb 28, 2008 5:49 PM

  • SELECT with WHERE clause for MSAccess from JDBC

    Hi,
    I am new user of MSAccess.I am getting exception: Invalid user type when i was trying the following code:
    String name1=nameTextfield.getText().trim();
    String query="SELECT ID from Suppliers WHERE name=name1;"
    Statement stmt=con.createStatement();
    ResultSet rs=stmt.executeQuery(query);
    while(rs.next())
    String id1=rs.getInt(1);
    System.out.println(id1);
    nameTextField is JTextField in my GUI.
    ID id auto field in table Suppliers.
    I am using MSAccess 97.
    I came to know that the JDBC SQL queries will be different for Access.
    Any body help me how to write SELECT statement?
    Thanks in advance,
    Sai Ram

    name or ID might be reserved words in access. Either change the name of the column or put [] around them. Also, you ar looking for a record where fields name and name1 are equal. You probably don't have a name1 field.
    String name1=nameTextfield.getText().trim();
    String query="SELECT [ID] from Suppliers WHERE [name]='"+name1+"';"
    Pay attention to the single and double quotes I have.

  • Select statment - where clause

    Hello experts,
    I want to write a select statment,
    e.g.
    select * from pa0001 where ename like '%Rahul%'.
    so this stamemt will give me all DB rows in which ename contains Rahul but i also want rows those are having rahul or rAhul or raHul or RAhul or RAHul or RaHul like wise....
    can u plz help me on this ???

    Hi
    Find the below code which may be useful for your requirement
    ranges:r_sel for lfa1-name1.
    data:v_name(5) type c value 'laxmi'.
    data:len type i,
    v_num type i,
    v_num1 type i,
    v_num2 type i,
    v_name1(5) type c,
    v_name2(5) type c,
    v_name_final(7) type c,
    v_char type c.
    len = strlen( v_name ).
    clear:v_name1,v_name2,v_name_final,v_num,v_num1,v_num2.
    v_num1 = len.
    do len times.
      v_num1 = v_num1 - 1.
      v_char = v_name+v_num(1).
      v_num2 = v_num.
      v_num = v_num + 1.
      if v_num1 is initial.
        clear:v_name1.
      else.
        v_name1 = v_name+v_num(v_num1).
      endif.
      if v_num2 is not initial.
        v_name2 = v_name+0(v_num2).
      endif.
      translate v_char to upper case.
      concatenate '' v_name2 v_char v_name1 '' into v_name_final.
      r_sel-option =  'CP'.
      r_sel-sign = 'I'.
      r_sel-low = v_name_final.
      clear:r_sel-high.
      append r_sel.
      translate v_char to lower case.
      concatenate '' v_name2 v_char v_name1 '' into v_name_final.
      r_sel-option =  'CP'.
      r_sel-sign = 'I'.
      r_sel-low = v_name_final.
      clear:r_sel-high.
      append r_sel.
    enddo.
    Use range parameter in your select statement.
    Regards
    Sripal

  • Select and where clause

    Hi
    I want to write a select statement and in where condition
    1.I want to retrieve the fields which contains a string 'ABAP'
    2.I want to retreive the fields which is equal to space.
    eg;
    SELECT FLD1 FLD2 FLD3 FROM TABLE1 WHERE
       WHERE
       fld1 contains string 'ABAP'
    and fld2 is equal to space.

    Hi
    Yes you can, but you should use the language in the selection on MAKT:
    SELECT MARA~MATNR
    MAKT~MAKTX
    MCH1~CHARG
    MCH1~VFDAT INTO CORRESPONDING FIELDS OF TABLE GT_MATERIALS
    FROM MARA
    INNER JOIN MAKT
    ON MARAMATNR = MAKTMATNR
    INNER JOIN MCH1
    ON MAKTMATNR = MCH1MATNR
    INNER JOIN MVKE
    ON MVKEMATNR = MAKTMATNR
    WHERE MARA~MTART = 'ZDRU'
    AND MARA~LVORM = SPACE
    <b>  AND MAKT~MAKTG LIKE '%DISCONTINUE%'
      AND MAKT~SPRAS  = SY-LANGU "or EN</b>
    AND MVKE~VKORG = 'PUSA'
    AND MVKE~VTWEG = 'SPART'
    AND MVKE~MVGR4 = 92
    AND MCH1~CHARG IN S_CHARG.
    Max

  • Select avoiding where clause

    Hello,
    I am using JPA in my app and I am confused because of a select that is returning data as I didn't have anything in my where clause.
    Select A (with problems):
    Query q = em.createQuery(
    " Select distinct p "+
    " From Subgrupo sub,"+
    " UsuarioSubgrupo usb," +
    " Usuario u, "+
    " Grupo g, "+
    " Projeto p "+
    " where "+
    " sub.cdGrupo = g.cdGrupo and "+
    " g.cdProje = p.cdProje and "+
    " g.stAdmin = 1 and " +
    " sub.cdSubgr = usb.cdSubgr and " +
    " usb.cdUsuar = u.cdUsuar and " +
    " u.cdUsuar = 1"
    Select B (almost OK):
    Query q = em.createQuery(
    " Select p.dsProje "+ // the only difference
    " From Subgrupo sub,"+
    " UsuarioSubgrupo usb," +
    " Usuario u, "+
    " Grupo g, "+
    " Projeto p "+
    " where "+
    " sub.cdGrupo = g.cdGrupo and "+
    " g.cdProje = p.cdProje and "+
    " g.stAdmin = 1 and " +
    " sub.cdSubgr = usb.cdSubgr and " +
    " usb.cdUsuar = u.cdUsuar and " +
    " u.cdUsuar = 1"
    In the second select, I've got the rows according with where clause and I cannot understand how the fact of selecting an objetc Projeto (p) (select A) can make such a "mess" avoiding the rules of the where clause.
    Could someone give me a help about this problem?
    I'll be glad with any help!!
    []'s
    Alex
    !_Let's share ideas_!

    Hi,
    The issue is I am getting differents results from selects A and B and both have the same where clause.
    I have done this:
    Query q = em.createQuery(
    " SELECT NEW entity.Projeto (p.dsProje, p.cdProje) "+
    " From Subgrupo sub, "+
    " UsuarioSubgrupo usb," +
    " Usuario u, "+
    " Grupo g, "+
    " Projeto p "+
    " where sub.cdGrupo = g.cdGrupo "+
    " and g.cdProje = p.cdProje "+
    " and g.stAdmin = 1 "+
    " and sub.cdSubgr = usb.cdSubgr "+
    " and usb.cdUsuar = u.cdUsuar "+
    " and u.cdUsuar = " + cdUsuar
    I am getting what I need, but the reason why a simple select p does not work I don't know.
    This select is not generate by TopLink.
    Cheers!

  • PL/SQL: how to use in parameter in select sql where clause

    Hi
    in a procedure, I need to apply 'in parameter' in 'where clause' along with other table fields. Purpose is to create dynamic select querry with multiple conditions.
    select count(*) from table xx
    where y_code=2008 and v_type in ('SI', 'TI', 'DI') ;
    my requirement is replace 'and v_type in ('SI', 'TI', 'DI')' with in parameter. pls note in paramter may contain null value.
    Regards

    ... e.g. why on earth do you want to pass in a string to be appended to the WHERE clause of an SQL.I second that and I strongly advice NOT to do it. If you really want to do it, then come back and show us, how you would prevent SQL injection. This approach is too dangerous (and too complex) IMHO.
    Do it straight forward as in the article of Tom Kyte (link in the post of BluShadow above)

  • Avoid repeating same logic in 'select' and 'where' clauses?

    I'll preface by saying I'm self-taught and have only been fiddling with SQL for a couple of months, so forgive me if this is a dumb question. I have a query written to pull out customers who are configured to have their products stored at the wrong warehouse, according to the first 3 digits of the zip code. Here is an extremely simplified version of a query I'm trying to run:
    select custno, custbuy_zip_cd, custbuy_prim_ship_loc_cd as Warehouse,
    case when substr(custbuy_zip_cd,1,3) in ('839','848') then '20'
    when substr(custbuy_zip_cd,1,3) in ('590','591') then '33'
    end as StdWhse
    from customers
    where case when substr(custbuy_zip_cd,1,3) in ('839','848') then '20'
    when substr(custbuy_zip_cd,1,3) in ('590','591') then '33'
    end <> custbuy_prim_ship_loc_cd
    or (case when substr(custbuy_zip_cd,1,3) in ('839','848') then '20'
    when substr(custbuy_zip_cd,1,3) in ('590','591') then '33'
    end is not null and custbuy_prim_ship_loc_cd is null)
    Now, the query works, but it seems overly convoluted and feels like there must be a way to make it simpler and faster. I'm using the same 'case when' 3 times. Originally, I had thought I could use the aliases from the 'select' clause in the 'where' clause, which would simplify things:
    select custno, custbuy_prim_ship_loc_cd as Warehouse,
    case when substr(custbuy_zip_cd,1,3) in ('839','848') then '20'
    when substr(custbuy_zip_cd,1,3) in ('590','591') then '33'
    end as StdWhse
    from customers
    where StdWhse <> custbuy_prim_ship_loc_cd
    or (StdWhse is not null and custbuy_prim_ship_loc_cd is null)
    I then found out that that caused 'invalid identifier' errors. My first attempt at a solution was to use a subquery in the 'from' clause, but that ran the 'case when' on every single customer instead of the small subset, so it wound up taking much longer even though it looked neater. Any tips on how to clean up that first query to make it run faster?
    this is Oracle 11i, I believe. As a side note, I don't have write access to the database.

    Thanks for all the tips so far - still going through them. You all respond fast! Sorry about using double angle brackets for != and not using code tags, I'll make sure to format my posts properly going forward. I think the double angle brackets messed up the appearance of my original queries a little. Here's how I probably should have pasted my first query in my first post:
    select custno, custbuy_zip_cd, custbuy_prim_ship_loc_cd as Warehouse,
        case when substr(custbuy_zip_cd,1,3) in ('839','848') then '20'
            when substr(custbuy_zip_cd,1,3) in ('590','591') then '33'
        end as StdWhse
    from customers
    where case when substr(custbuy_zip_cd,1,3) in ('839','848') then '20'
            when substr(custbuy_zip_cd,1,3) in ('590','591') then '33'
        end != custbuy_prim_ship_loc_cd
        or (case when substr(custbuy_zip_cd,1,3) in ('839','848') then '20'
            when substr(custbuy_zip_cd,1,3) in ('590','591') then '33'
        end is not null and custbuy_prim_ship_loc_cd is null)The almost unanimous opinion seems to be that I should use a subquery in one way or another, but the problem remains that the only significant logic to narrow down the results is the logic that matches the 'case when' results (which are what the warehouse number should be, based on the zip code) to the current warehouse number. Therefore, it seems like any subquery is going to return my entire list of 600k customers, and take a much longer time than my original (messy) query. At least it has in the test runs I created based on
    Satyaki's and Peter's examples. The query based on my original example takes about 2.5 minutes, and the subquery examples take about 5+ even though they look cleaner.
    to clarify what the query is trying to accomplish, I want it to pull any records where the warehouse number does not equal the correct warehouse number based on zip code (or if the warehouse number is null when it shouldn't be).
    I'll try to create some sample data and sample results. Customers table:
    custno   custbuy_zip_cd  custbuy_prim_ship_loc_cd
    1        59024           20
    2        59024           33desired results:
    custno   custbuy_zip_cd   warehouse   StdWhse
    1        59024            20          33If I could create a table to hold the standard warehouses to join on, the whole thing would be much easier. The full version of the query really has hundreds of zip code prefixes and 5 different warehouses and each account has 4 alternate warehouses as well. However, I'm stuck with read only access so everything has to go right in the query. It wouldn't be the end of the world to just stick with my original query since it's not like it takes hours, and I'll only be running it weekly. I just wanted to make sure there wasn't some other solution that wasn't just cleaner but was also faster.

  • Regarding Select without Where clause

    Hi
    we have below code for F4HELP on invoice input field.
    you can see Select statement used without Where condition to fetch records from Ztable.
    and deleting the duplicating records.
    SCI error says,"Large table : it has no where condition. /No field of a table index in WHERE condition.
    Is this potential problem?
    How to handle this generally? does where condtion is must to use in Select statement.?
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_ZIVCNO-LOW.
    * Search help setting of uFF62Invoice numberuFF63
      PERFORM F_F4HELP_RSTYP CHANGING S_ZIVCNO-LOW.
    FORM F_F4HELP_RSTYP  CHANGING C_V_INVCNO TYPE ZGTSDE_ZIVCNO."Invoice number
      DATA:
    *   Work area for Return the selected value
        WL_F4RETURN  TYPE DDSHRETVAL,
    *   Internal table for Return the selected value
        TL_F4RETURN  TYPE STANDARD TABLE OF DDSHRETVAL,
    *   Internal table for Processing result
        TL_INVOICE   TYPE TABLE OF TYP_INVOICE.
      SELECT ZIVCNO
      FROM   ZGTSDT01
      INTO   TABLE TL_INVOICE.
      CHECK TL_INVOICE[] IS NOT INITIAL.
      DELETE ADJACENT DUPLICATES FROM TL_INVOICE.
    *  Search help is started
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          RETFIELD        = CG_FIELD_INVCNO   " Packing No
          VALUE_ORG       = CG_VALUE_S       " Value return
        TABLES
          VALUE_TAB       = TL_INVOICE       " Table of values
          RETURN_TAB      = TL_F4RETURN      " Return the selected value
        EXCEPTIONS
          PARAMETER_ERROR = 1
          NO_VALUES_FOUND = 2
          OTHERS          = 3.

    Since your F4 help on your selection-screen is independent, create a custom search help as suggested by Keshav.
    As a suggestion Instead of,
    SELECT ZIVCNO
      FROM   ZGTSDT01
      INTO   TABLE TL_INVOICE.
      CHECK TL_INVOICE[] IS NOT INITIAL.
      DELETE ADJACENT DUPLICATES FROM TL_INVOICE.
    use,
    SELECT DISTINCT(ZIVCNO)
      FROM   ZGTSDT01
      INTO   TABLE TL_INVOICE.
    BR,
    Suhas

  • Dynamic page with multiple select in where clause

    Hi,
    I have a dynamic page and in the where-clause, i have a bind variable. In a report i use for instance
    and rtrim((to_char(date_time5,'DAY'))) IN :v_day
    That works ok in a report. But it does not work in a dynamic page.
    what code is needed to work with a multiple select box on the customize screen for a dynamic page?
    Thanks.

    Hi.
    I have a dynamic page, with a bind variable :v_day. On the customization screen the user can select one or more days of the week, or all days. I use this also in a report and then it works ok. In the where clause i use:
    and rtrim((to_char(date_time,'DAY'))) IN :v_day
    Date_time is a tablecolumn (date).
    When i add this line in the select script from the dynamic page, i get error:
    : ORA-06550: line 1, column 2443:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    The symbol "(" was substituted for "" to continue.
    ORA-06550: line 1, column 2606:
    PLS-00103: Encountered the symbol ";" when expecting one of the following:
    . ( ) , * @ % & - + / at mod rem <an exponent (**)> and or ||
    The symbol ")" was substituted for ";" to continue.
    ORA-06550: line 1, column 3236:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    The symbol (WWV-11230)
    Critical Error in wwerr_api_error.get_errors! SQL Error Message: ORA-06502: PL/SQL: numeric or value error: character string buffer too small (WWV-)
    Thanks.

  • Mysql select statement where = works and LIKE fails

    I am using Flash Builder 4. On the server side I use php and mysql. I created a php dataservice using FB4. My plan had been to allow users to enter a search term and query the database using a "LIKE" statement. FB4 created the php code that I simply modified changing the parameter name. The input parameter is a string.
    public function getT_caseByID($searchTerm) {
    $stmt = mysqli_prepare($this->connection, "SELECT * FROM $this->tablename WHERE (title = ?)");
    $this->throwExceptionOnError();
    mysqli_stmt_bind_param($stmt, 'i', $searchTerm);
    $this->throwExceptionOnError();
    mysqli_stmt_execute($stmt);
    $this->throwExceptionOnError();
    mysqli_stmt_bind_result($stmt, $row->idt_case, $row->title, $row->id_author, $row->comments);
    if(mysqli_stmt_fetch($stmt)) {
          return $row;
    } else {
          return null;
    A look at FB4 shows this code returns data.
    This code works fine but if I make the below change it fails, even when I use the wildcard %. the only change is "=" to "LIKE".
    public function getT_caseByID($searchTerm) {
    $stmt = mysqli_prepare($this->connection, "SELECT * FROM $this->tablename WHERE (title LIKE ?)");
    $this->throwExceptionOnError();
    mysqli_stmt_bind_param($stmt, 'i', $searchTerm);
    $this->throwExceptionOnError();
    mysqli_stmt_execute($stmt);
    $this->throwExceptionOnError();
    mysqli_stmt_bind_result($stmt, $row->idt_case, $row->title, $row->id_author, $row->comments);
    if(mysqli_stmt_fetch($stmt)) {
         return $row;
    } else {
         return null;
    A look into FB4 shows "void".
    Any help would be appreciated. I am using localhost on Apache Server on a development computer with Windows XP.

    correctio0n on the select statement
    select statement code*********
    select
        apspnr astspr aobjnr apspid
        bpsphi bposid
        caufnr cpspel
        dinact dstat
        eudate eusnam eutime "estat
       F~TXT04
        g~estat
        G~TXT04
        into corresponding fields of table itobj
        from proj as a
        inner join prps as b on apspnr = bpsphi
        inner join aufk as c on bpspnr = cpspel
        inner join jest as d on cobjnr = dobjnr
        inner join jcds as e on dobjnr = eobjnr
                             and dstat = estat
        inner join tj02t as f on estat = fistat
        inner join tj30t as g on astspr = gstsma
        for all entries in itparm
        where  apspid = itparm-pspid "or estat = itparm-psy )
        or  bposid = itparm-posid "or estat = itparm-wsy )
        or  caufnr = itparm-aufnr "or estat = itparm-nsy  )
        and ( dinact  'X' or einact  'X')
        and fspras = 'E' and gspras = 'E'.

  • How to use OracleParameter whith the IN Operator of select statement

    Hi,
    I am having problems using the OracleParameter when used in a query with a IN operator.
    Following Example:
    oraCommand.Parameters.Add(":List", strMylist ); //or Array???
    The SQL command:
    SELECT * FROM XXX WHERE XXX.YYY IN (:List);
    What datatype must the value of :List be?
    regards
    Stefan

    Let's use a collection of User Defined Types (UDT's).
    First create a table with 1 million rows:
    create table employees (id number(10) not null primary key, name varchar2(100) );
    insert into employees
    select level l, 'MyName'||to_char(level)
    from dual connect by level <= 1e6;
    1000000 rows created
    commit;
    exec dbms_stats.gather_schema_stats(USER, cascade=>TRUE);No we turn to the C# code:
    Let's select employees with id's 3 and 4.
    Collection type MDSYS.SDO_ELEM_INFO_ARRAY is used because if we use this already predefined Oracle type we don't have to define our own Oracle type. You can fill collection MDSYS.SDO_ELEM_INFO_ARRAY with max 1048576 numbers.
    using Oracle.DataAccess.Client;
    using Oracle.DataAccess.Types;
        [OracleCustomTypeMappingAttribute("MDSYS.SDO_ELEM_INFO_ARRAY")]
        public class NumberArrayFactory : IOracleArrayTypeFactory
          public Array CreateArray(int numElems)
            return new Decimal[numElems];
          public Array CreateStatusArray(int numElems)
            return null;
        private void Test()
          OracleConnectionStringBuilder b = new OracleConnectionStringBuilder();
          b.UserID = "sna";
          b.Password = "sna";
          b.DataSource = "ora11";
          using (OracleConnection conn = new OracleConnection(b.ToString()))
            conn.Open();
            using (OracleCommand comm = conn.CreateCommand())
              comm.CommandText =
                  @" select  /*+ cardinality(tab 10) */ *  " +
                  @" from employees, table(:1) tab " +
                  @" where employees.id = tab.column_value";
              OracleParameter p = new OracleParameter();
              p.OracleDbType = OracleDbType.Array;
              p.Direction = ParameterDirection.Input;
              p.UdtTypeName = "MDSYS.SDO_ELEM_INFO_ARRAY";
              p.Value = new Decimal[] { 3, 4 };
              comm.Parameters.Add(p);
              int numPersons = 0;
              using (OracleDataReader reader = comm.ExecuteReader())
                while (reader.Read())
                  MessageBox.Show("Name " + reader[1].ToString());
                  numPersons++;
              conn.Close();
        }The index on employees.id isn't used when one omits hint /*+ cardinality(tab 10) */. This index is created by Oracle because id is the primary key column.
    Edited by: wateenmooiedag on Dec 30, 2009 2:45 AM

  • Select statement - Where Condition not possible

    Hi,
    I am trying to extract data from sap standard table CFX_COL.I want extract based on a field which is of type string.I can see that in the table but when I code below I am getting error.Any other alterantives?
    REPORT x.
    TABLES:proj.
    DATA: it_proj TYPE STANDARD TABLE OF proj.
    DATA:wa_proj TYPE  proj.
    DATA: it_cfol TYPE STANDARD TABLE OF CFX_COL.
    DATA:wa_cfol TYPE  CFX_COL.
    data:v_name type STRING.
    PARAMETERS: p_pspid LIKE proj-pspid.
    SELECT * FROM proj INTO CORRESPONDING FIELDS OF TABLE it_proj
    WHERE pspid = p_pspid.
    READ TABLE it_proj INTO wa_proj INDEX 1.
    concatenate wa_proj-pspid '-' wa_proj-post1 into v_name.
    select * from CFX_COL into CORRESPONDING FIELDS OF TABLE it_cfol
    where name in v_name.
    Error:The Field "NAME"  is a long string , so it cannot be used in WHERE, ON or HAVING conditions.
    Rgds
    Vara

    Hi Vara.
    Select will not work if you are trying to search based on the name field as in the table  CFX_COL it has data type String which basically is not content but a reference to a storage area and internally it is stored in a different format not searchable. Even , if you try to find the number of entries in the table you can not put any value in this field as it will not be available for input as it doesn't contain any value.
    STRING: Character string with variable length This data type can only be used in types (data elements, structures, table types) and domains. In the Dictionary a length can be specified for this type (at least 256 characters). It may be used in database tables, however, only with restrictions. For a description of them refer to the documentation of the ABAP statement 'STRING' . In ABAP, this type is implemented as a reference to a storage area of variable size. As default for the output length 132 characters are proposed. You cannot attach search helps to components of this type.
    http://help.sap.com/saphelp_40b/helpdata/en/cf/21f2e5446011d189700000e8322d00/content.htm
    Regards
    Apoorva

Maybe you are looking for