One select using dynamic statements....

Hello ,
I am using for all entries. I want to combine all in one because currently I have to write two select statements based on condition for internal table not empty.
IF IT_WIID[] IS NOT INITIAL.
SELECT * FROM zcust into CORRESPONDING FIELDS OF TABLE i_t01_dup
         FOR ALL ENTRIES IN IT__WIID
         WHERE WI_ID = IT_WIID-WI_D
         AND RECNO IN TRECNO.
ESLE.
SELECT * FROM zcust into CORRESPONDING FIELDS OF TABLE i_t01_dup
         WHERE RECNO IN TRECNO.
ENDIF.
Regards,
Jainam.
Edited by: Jainam Shah on Mar 5, 2010 8:31 PM

OK, I wrote a test program myself which proves my theory. I can't believe I am resorting to a p***ing contest instead of going home for the weekend.
First count SE16 records on DD02L by specifying 'A' for AS4LOCAL field and note down the count.
Then, try this program:
REPORT y_sk_test .
PARAMETERS: p_itabfl TYPE c AS CHECKBOX DEFAULT 'X',
            p_as4lcl TYPE dd02l-tabclass DEFAULT 'A'.
DATA: t_dd02l TYPE STANDARD TABLE OF dd02l INITIAL SIZE 0 WITH HEADER LINE,
      t_itab  TYPE STANDARD TABLE OF dd02l INITIAL SIZE 0 WITH HEADER LINE.
IF p_itabfl = 'X'.
  t_itab-tabname = 'T000'.
  APPEND t_itab.
ENDIF.
SELECT *
INTO   TABLE t_dd02l
FROM   dd02l
FOR ALL ENTRIES IN t_itab
WHERE  tabname = t_itab-tabname
  AND  as4local = p_as4lcl.
DESCRIBE TABLE t_dd02l LINES sy-tfill.
WRITE: / 'Number of rows selected:', sy-tfill.
If you uncheck the checkbox, the count matches the SE16 count and I didn't have to use the IF ELSE block.

Similar Messages

  • Related to using dynamic statements

    Hi,
    Just when defining cursors, are there any other ways, by which we can use any dynamic statements? Such as depending on different conditions, we want to have different 'where' clauses.
    Thks & Rgds,
    HuaMin

    For a straight in-line cursor which is what I think you are requiring, the closest thing I can think of would be something like....
    PROCEDURE myproc(p_x IN NUMBER := NULL, p_y IN NUMBER := NULL, p_z IN NUMBER := NULL) IS
    CURSOR cur_mycursor
      SELECT a,b,c,d
      FROM   mytable
      WHERE  x = NVL(p_x, x)
      AND    y = NVL(p_y, y)
      AND    z = NVL(p_z, z);Obviously this is a basic example showing how you can restrict the query on just the values you supply, but you could adapt for more complex things.

  • Resultset from a batch select using prepared statement

    Hi,
    Is it possible to add results of batch execute of select statements and retrieve the result set ..
    I am running select statement in a batch mode setting in value for a column.I add this to a prepared batch.
    I would like to get the reults as a batch and spin through the result set like a r.next(). Is this possible ?
    I have given the code below
    sql = "select ordervalue , orderdate from discreet_orders "+
    "where order_no = ? ";
    dbObject.prepareStatement(sql);
    dbObject.prepareStatement(sql);
    for (int i=0; i < orderNoVect.size(); i++) {
    dbObject.setString(1,(String)scnV.elementAt(i));
    dbObject.addBatchPrepared();
    r = dbObject.execPrepared();
    dbObject.clearBatchPrepared();
    I would like to do a r.getNext() process the values form the resultset.
    Is this possible ? If not is there an other way to do it ?
    Thanks
    Arnold

    Olek wrote:
    hi
    Is there a way do a batch update using prepared statement?
    I don't want to insert every row in a single query...
    regards,
    OlekPossibly the confusion here stems from the existence of two addBatch methods in PreparedStatement.
    addBatch(String sql)inherited from Statement adds a new query to the batch of SQL statements for the statement. However you don't want to use this with PreparedStatements Instead you want
    addBatch()which adds the current set of parameters to the prepared statements batch of commands.
    In this scenario you prepare your query (insert statement) and then call setXXX(x,y) for each parameter and then addBatch for each tuple. Then call executeBatch to execute all the queries based on your batched parameters.
    If this didn't answer your question I don't know what your question is exactly. I would add that you probably want to set a "reasonable" size on your batches and break them into smaller batches as is reasonable. Mainly because the implementation of batched PreparedStatements widely varies depending on the database and driver, thus there are certainly scenarios where given enough batched parameters you could have various unpleasant things visited upon your program. Like terminal slowness, running out of memory, etc.

  • How to get the Multiplied value between measure and a dimension base on user selection using dynamically

    Hi Experts,
    We had developed a cube with the Measures and Dimensions.
    I had a requirment as the measures should be muliplied by the currency value of different countries and get me the results.
    For Example.
    In SSRS report, the user will select "EUR" then the measures should multiply with the EUR based value for the particular month and get the result in the SSRS report. If the user select any other currency value, that should multiply with the measure
    value and get the result in SSRS report.
    How to do that in SSAS Cube.
    Thanks
    Shashi

    Hi ,
    If I understand your requirement  correctly , then you need currency Conversion.
    you can refer this links.
    http://consultingblogs.emc.com/christianwade/archive/2006/08/24/Currency-Conversion-in-Analysis-Services-2005.aspx
    http://www.ssas-info.com/analysis-services-faq/27-mdx/244-how-change-currency-symbol-based-on-selected-currency-dimension-member
    http://social.technet.microsoft.com/wiki/contents/articles/18672.currency-conversion-in-ssas-2012-multidimensional-tabular.aspx
    May I know , You Require all this using MDX and SSRS Parameter ?
    Thanks

  • JDBC - one select using different servers...

    hi
    I have an AS400 table and SQL server table and need do a JOIN in a select, I did this:
    SELECT GNORP.COORG, GNORG.ORDES, GNORP.CPAIS, GNPAI.PADES, GNORP.ORV01 FROM ((GNORP GNORP LEFT OUTER JOIN GNORG GNORG ON GNORP.COORG = GNORG.COORG) LEFT OUTER JOIN SERVIDOR_CBL.GN_3_0.dbo.GNPAI GNPAI ON GNORP.CPAIS = GNPAI.COPAI) ORDER BY GNORP.COORG, GNORP.CPAIS
    in this case "SERVIDOR_CBL.GN_3_0.dbo.GNPAI" I said the serverName.BDName.Owner.TableName
    But give me an error... Anyone know how can I do this??
    Thanks in advance...

    Of course, give me this error:
    java.sql.SQLException: [SQL0114] La base de datos
    relacional GN_3_0 no coincide con el servidor actual
    You didn't provide the Java code that produced that error.
    In this case, it's pretty straightforward to guess what that means in Enlgish, but in general, you'll have a better chance of getting help if you translate variable names, error messages, etc. to English, simply because that's the primary language spoken on these forums.
    (There are of course people who speak other languages here, so if your English is really awful, you might be better off posting in your native lanaguage and hoping that somebody who speaks that language will answer. That doesn't seem to be the case with you though.)
    I trying to execute the select by JDBC this way
    because I read this in forums to do by this way, so I
    can�t do it and I think here may be there are someone
    which had this problem....
    Did you read the posts about why this isn't a JDBC issue?
    Have you explicitly set something up on one of those two servers to allow it to present the other one as if it were all part of one big "virtual" server?
    If so, you might want to look it docs or user groups for that product, as your problem is probably related more to the details of that product than to JDBC.
    If not, then you're wasting your time even trying to do this with JDBC.

  • Alternative to using dynamic variable / NOW () in Content FILTER

    Good morning all,
    Could someone suggest an alternative to using NOW () in the WHERE clause of LTS? Using ExpirationDate>NOW() works, but unfortunately, this request can't be cached (because reports using dynamic statements using NOW () and TODATE () don't get cached).
    I've identified a possible solution - creating a variable that would use first day of current month with this Initialization block:
    SELECT LAST_DAY (ADD_MONTHS (CAST(SUBSTR(SYSDATE,1,10) AS DATE), -1))+1 FROM TIMEDIM_TABLE WHERE CAST(SUBSTR(SYSDATE,1,10) AS DATE)=CALENDAR_DATEAs a result the variable is showing: TIMESTAMP '2009-05-01 00:00:00' in Default Initializer field. This seems to be working - I'm just not sure why not all he reports get cached.
    My question is - is this valid way for this and is there a better way to accomplish this?

    Hy Wildmight,
    Here an article :
    Why a Query is Not Added to the Cache ?
    http://gerardnico.com/wiki/dat/obiee/bi_server/cache/obiee_bi_server_why_no_cache
    If you use a repository variable, the cache work and the entry will be deleted next time you update it.
    Success
    Nico

  • Help with dynamic statement returning values into collection

    Hi All
    I am trying to use dynamic statement to return values into a collection using the returning clause. However, I get an ORA-00933 error. Here is a simple setup:
    create table t(
        pk number,
        id_batch varchar2(30),
        date_created date,
        constraint t_pk primary key ( pk )
    create or replace type num_ntt is table of number;
    create or replace type vc2_ntt is table of varchar2(30);
    create or replace
    package pkg
    as
      type rec is record(
          pk        num_ntt,    
          id_batch  vc2_ntt
      procedure p(
          p_count in number,
          p_rt    out nocopy rec
    end pkg;
    create or replace
    package body pkg
    as
      procedure p(
          p_count in number,
          p_rt    out nocopy rec
      is
      begin
          execute immediate '
          insert into t
          select level, ''x'' || level, sysdate
          from   dual
          connect by level <= :p_count
          returning pk, id_batch into :pk, :id_batch'
          using p_count returning bulk collect into p_rt.pk, p_rt.id_batch;
      end p;
    end pkg;
    declare
      r  pkg.rec;
    begin
      pkg.p( 5, r );
    end;
    /

    sanjeevchauhan wrote:
    but I am working with dynamic statement and returning multiple fields into a collection.And using an INSERT...SELECT statement combined with a RETURNING INTO clause still does not work. Whether it's dynamic SQL or not: it doesn't work. The link describes a workaround.
    By the way, I don't see why you are using dynamic SQL here. Static SQL will do just fine. And so you can literally copy Adrian's setup.
    Regards,
    Rob.

  • How to join THREE different tables into internal table using one select statement .

    How to join THREE different tables into internal table using one select statement .
    Hi experts,
    I would like to request your guidance in solving the problem of joining the data from three different database tables into one internal table
    Scenario:
    Database tables:
    SPFLI
    SFLIGHT
    SBOOK.
    Table Fields:
    SPFLI - CARRID CONNID COUNTRYFR CITYFRM COUNTRYTO CITYTO
    SFLIGHT - CARRID CONNID FLDATE SEATSMAX SEATSOCC SEATSMAX_C
    SEATSOCC_C SEATSMAX_F SEATSOCC_F
    SBOOK - CARRID CONNID CLASS
    MY INTERNAL TABLE IS IT_XX.
    Your help much appreciated.
    Thanks in advance.
    Pawan.

    Hi Pawan,
    please check below codes. hope it can help you.
    TYPES: BEGIN OF ty_xx,
            carrid     TYPE spfli-carrid   ,
            connid     TYPE spfli-connid   ,
            countryfr  TYPE spfli-countryfr,
            cityfrom   TYPE spfli-cityfrom  ,
            countryto  TYPE spfli-countryto,
            cityto     TYPE spfli-cityto   ,
            fldate     TYPE sflight-fldate ,
            seatsmax   TYPE sflight-seatsmax ,
            seatsocc   TYPE sflight-seatsocc ,
            seatsmax_b TYPE sflight-seatsmax_b,
            seatsocc_b TYPE sflight-seatsocc_b,
            seatsmax_f TYPE sflight-seatsmax_f,
            seatsocc_f TYPE sflight-seatsocc_f,
            class      TYPE sbook-class,
          END OF ty_xx,
          t_xx TYPE STANDARD TABLE OF ty_xx.
    DATA: it_xx TYPE t_xx.
    SELECT spfli~carrid
           spfli~connid
           spfli~countryfr
           spfli~cityfrom
           spfli~countryto
           spfli~cityto
           sflight~fldate
           sflight~seatsmax
           sflight~seatsocc
           sflight~seatsmax_b
           sflight~seatsocc_b
           sflight~seatsmax_f
           sflight~seatsocc_f
           sbook~class
      INTO TABLE it_xx
      FROM spfli INNER JOIN sflight
      ON spfli~carrid = sflight~carrid
      AND spfli~connid = sflight~connid
      INNER JOIN sbook
      ON spfli~carrid = sbook~carrid
      AND spfli~connid = sbook~connid.
    Thanks,
    Yawa

  • Insert into using a select and dynamic sql

    Hi,
    I've got hopefully easy question. I have a procedure that updates 3 tables with 3 different update statements. The procedure goes through and updates through ranges I pass in. I am hoping to create another table which will pass in those updates as an insert statement and append the data on to the existing data.
    I am thinking of using dynamic sql, but I am sure there is an easy way to do it using PL/SQL as well. I have pasted the procedure below, and what I'm thinking would be a good way to do it. Below I have pasted my procedure and the bottom is the insert statement I want to use. I am faily sure I can do it using dynamic SQL, but I am not familiar with the syntax.
    CREATE OR REPLACE PROCEDURE ACTIVATE_PHONE_CARDS (min_login in VARCHAR2, max_login in VARCHAR2, vperc in VARCHAR2) IS
    BEGIN
    UPDATE service_t SET status = 10100
    WHERE poid_id0 in
    (SELECT poid_id0 FROM service_t
    WHERE poid_type='/service/telephony'
    AND login >= min_login AND login <= max_login);
    DBMS_OUTPUT.put_line( 'Service Status:' || sql%rowcount);
    UPDATE account_t SET status = 10100
    WHERE poid_id0 IN
    (SELECT account_obj_id0 FROM service_t
    WHERE poid_type = '/service/telephony'
    AND login >= min_login AND login <= max_login);
    DBMS_OUTPUT.put_line( 'Account Status:' || sql%rowcount);
    UPDATE account_nameinfo_t SET title=Initcap(vperc)
    WHERE obj_id0 IN
    (SELECT account_obj_id0 FROM service_t
    WHERE poid_type='/service/telephony'
    AND login >=min_login AND login <= max_login);
    DBMS_OUTPUT.put_line('Job Title:' || sql%rowcount);
    INSERT INTO phone_card_activation values which = 'select a.status, s.status, s.login, to_char(d.sysdate,DD-MON-YYYY), ani.title
    from account_t a, service_t s, account_nameinfo_t ani, dual d
    where service_t.login between service_t.min_login and service_t.max_login
    and ani.for_key=a.pri_key
    and s.for_key=a.pri_key;'
    END;
    Thanks for any advice, and have a good weekend.
    Geordie

    Correct my if I am wrong but aren't these equal?
    UPDATE service_t SET status = 10100
    WHERE poid_id0 in
    (SELECT poid_id0 FROM service_t
    WHERE poid_type='/service/telephony'
    AND login >= min_login AND login <= max_login);
    (update all the records where there id is in the sub-query that meet the WHERE Clause)
    AND
    UPDATE service_t SET status = 10100
    WHERE poid_type='/service/telephony'
    AND login >= min_login AND login <= max_login);
    (update all the records that meet the WHERE Clause)
    This should equate to the same record set, in which case the second update would be quicker without the sub-query.

  • Error on a Dynamic Select using Pro*C

    I am a new user on Pro*C and I am facing an error for which I could not find a solution in the Pro*C/C++ Programmer’s Guide. The problem occurs when I do a dynamic SELECT to retrieve sequence of numbers (from 0 to 10) from a very simple table in a database.
    The program is retrieving the following sequence: {705, 961, 1217, 1473, 1729, 1985, 2241, 2497, 2753, 3009} rather than the sequence {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}.
    It’s very interesting to notice that the retrieved sequence, in hexadecimal, is equal to {2C1, 3C1, 4C1, 5C1, 6C1, 7C1, 8C1, 9C1, AC1, BC1}.
    I am quite sure that I'm missing a small detailed here and I would appreciate
    any help. Please find below the code that I am using.
    Thanks a lot!
    #include <string>
    #include <iostream>
    using namespace std;
    #include <sqlca.h>
    #include <sqlcpr.h>
    EXEC SQL BEGIN DECLARE SECTION;
    VARCHAR username[30];
    VARCHAR password[30];
    VARCHAR db_name [30];
    VARCHAR dns_name[30];
    EXEC SQL END DECLARE SECTION;
    void SQL_Error ( void )
    char msg[200];
    size_t buf_len = sizeof ( msg );
    size_t msg_len;
    sqlglm( msg, &buf_len, &msg_len );
    if ( msg_len > buf_len )
    msg_len = buf_len;
    cout << msg << endl;
    bool OpenDBConnection( char uname, char pword, char dns, char dbname )
    // Assign the database identifications to the ORACLE variables
    username.len = (unsigned short) strlen ( strcpy( (char *) username.arr, uname ) );
    password.len = (unsigned short) strlen ( strcpy( (char *) password.arr, pword ) );
    dns_name.len = (unsigned short) strlen ( strcpy( (char *) dns_name.arr, dns ) );
    db_name.len = (unsigned short) strlen ( strcpy( (char *) db_name.arr , dbname ) );
    /* Register sql_error() as the error handler */
    EXEC SQL WHENEVER SQLERROR goto err;
    /* Connect to the non default database */
    EXEC SQL CONNECT :username IDENTIFIED BY :password AT :db_name USING :dns_name;
    return ( true );
    err:
    SQL_Error();
    return ( false );
    ** Select the database using a dynamic method
    long SelectIDRecord ( void )
    EXEC SQL BEGIN DECLARE SECTION;
    // Define the dynamic statement
    char dyn_statement[4000];
    // Define the bind variables
    long db_id = 0;
    long db_id_type = 2; /* NUMBER */
    long db_id_len = 10;
    EXEC SQL END DECLARE SECTION;
    // Initialize the dynamic statement
    memset ( dyn_statement, 0, sizeof( dyn_statement ) );
    strcpy ( dyn_statement, "SELECT ID FROM TEST_DB ORDER BY ID" );
    EXEC SQL AT :db_name PREPARE s1 FROM :dyn_statement;
    // Declare and initialize the output descriptor
    EXEC SQL ALLOCATE DESCRIPTOR 'out';
    EXEC SQL AT :db_name DESCRIBE OUTPUT s1 USING DESCRIPTOR 'out';
    EXEC SQL SET DESCRIPTOR 'out' value 1 TYPE = :db_id_type,
    LENGTH = :db_id_len, DATA = :db_id;
    // Declare and open the cursor
    EXEC SQL AT :db_name DECLARE test_db_cursor CURSOR FOR s1;
    EXEC SQL AT :db_name OPEN test_db_cursor;
    EXEC SQL WHENEVER NOT FOUND DO BREAK;
    long nRec = 0;
    while ( true )
    EXEC SQL AT :db_name FETCH test_db_cursor INTO DESCRIPTOR 'out';
    EXEC SQL GET DESCRIPTOR 'out' VALUE 1 :db_id = DATA;
    nRec++;
    cout << "ID = " << (long) db_id << endl;
    // Close the cursor
    EXEC SQL AT :db_name CLOSE test_db_cursor;
    EXEC SQL DEALLOCATE DESCRIPTOR 'out';
    return ( nRec );
    err:
    SQL_Error();
    return ( 0 );
    int main ()
    char *uname  = "test";
    char *pword  = "test";
    char *dns    = "test_db";
    char *dbname = "test";
    OpenDBConnection ( uname, pword, dns, dbname );
    long nRec = SelectIDRecord ();
    }

    No need to specify the length if the data type is number and pointing to Long.
    You can directly map the values using INTO clause.

  • Delete statement that uses a sub-select with the statement in the cursor

    Hi all,
    How to write write a delete statement that uses a sub-select with the statement in the cursor?
    CURSOR excluded_dates IS         
           SELECT TO_TIMESTAMP(report_parameter_value, in_date_format_mask)
          INTO my_current_date_time
          FROM report_parameters
         WHERE report_parameters.report_parameter_id    = in_report_parameter_id
           AND report_parameters.report_parameter_group = 'DATE_TIME'
           AND report_parameters.report_parameter_name  = 'EXCLUDED_DATE';
    OPEN excluded_dates;
      LOOP
        FETCH excluded_dates INTO my_excluded_date;
        EXIT WHEN excluded_dates%NOTFOUND;
        DELETE FROM edr_rpt_tmp_inclusion_table
        WHERE TO_CHAR(date_time, 'mm/dd/yyyy') = TO_CHAR(my_excluded_date, 'mm/dd/yyyy');
      END LOOP;
      CLOSE excluded_dates;Thanks

    Hi,
    In such case I think is better to create a view an perform the delete using it. Example (using HR schema):
    Connected to Oracle Database 10g Express Edition Release 10.2.0.1.0
    Connected as hr
    SQL> create or replace view v_employees as select * from employees where first_name like 'J%';
    View created
    SQL> select * from v_employees;
    EMPLOYEE_ID FIRST_NAME           LAST_NAME                 EMAIL                     PHONE_NUMBER         HIRE_DATE   JOB_ID         SALARY COMMISSION_PCT MANAGER_ID DEPARTMENT_ID
            110 John                 Chen                      JCHEN                     515.124.4269         28/09/1997  FI_ACCOUNT    8200,00                       108           100
            112 Jose Manuel          Urman                     JMURMAN                   515.124.4469         07/03/1998  FI_ACCOUNT    7800,00                       108           100
            125 Julia                Nayer                     JNAYER                    650.124.1214         16/07/1997  ST_CLERK      3200,00                       120            50
            127 James                Landry                    JLANDRY                   650.124.1334         14/01/1999  ST_CLERK      2400,00                       120            50
            131 James                Marlow                    JAMRLOW                   650.124.7234         16/02/1997  ST_CLERK      2500,00                       121            50
            133 Jason                Mallin                    JMALLIN                   650.127.1934         14/06/1996  ST_CLERK      3300,00                       122            50
            139 John                 Seo                       JSEO                      650.121.2019         12/02/1998  ST_CLERK      2700,00                       123            50
            140 Joshua               Patel                     JPATEL                    650.121.1834         06/04/1998  ST_CLERK      2500,00                       123            50
            145 John                 Russell                   JRUSSEL                   011.44.1344.429268   01/10/1996  SA_MAN       14000,00           0,40        100            80
            156 Janette              King                      JKING                     011.44.1345.429268   30/01/1996  SA_REP       10000,00           0,35        146            80
            176 Jonathon             Taylor                    JTAYLOR                   011.44.1644.429265   24/03/1998  SA_REP        8600,00           0,20        149            80
            177 Jack                 Livingston                JLIVINGS                  011.44.1644.429264   23/04/1998  SA_REP        8400,00           0,20        149            80
            181 Jean                 Fleaur                    JFLEAUR                   650.507.9877         23/02/1998  SH_CLERK      3100,00                       120            50
            186 Julia                Dellinger                 JDELLING                  650.509.3876         24/06/1998  SH_CLERK      3400,00                       121            50
            189 Jennifer             Dilly                     JDILLY                    650.505.2876         13/08/1997  SH_CLERK      3600,00                       122            50
            200 Jennifer             Whalen                    JWHALEN                   515.123.4444         17/09/1987  AD_ASST       4400,00                       101            10
    16 rows selected
    SQL> delete from v_employees where hire_date >= to_date('01/06/1998', 'dd/mm/yyyy');
    2 rows deleted
    SQL> regards,

  • Can I use a select and update statement in a single jsp file?

    I want to update the BUY table everytime I would add a SELL transaction.....I want to minus the stocks that I sold to those that Ive bought before.....
    note: I used a seperate table in BUY and SELL transaction
    After I Have added a transaction, I want to update the buy table. This is my problem, can I used both SELECT and UPDATE statement at the same time in a single jsp file for example like this:
    select * from test, test1;
    update test
    set total_shares=total_shares-Stotal;
    where stock_code=Scode AND name_broker=Sbroker;
    Can i have both of these statements in the same jsp file in oder to update the buy table?
    Or can anyone suggest how can process that update?THANKS!
    --------------------

    Can i have both of these statements in the same jsp file in oder to update the buy table?Yes. But wouldn't it have been easier just to try it?

  • Why we use Tables statement in case of using SELECT-OPTIONS:

    hi all,
    Why we use Tables statement in case of using the following coding in an ABAP program ...
    tables: vbak.
    SELECT-OPTIONS: s1 for vbak-vbeln.
    here if we dont provide the tables statement why it does not work ????
    pls answwer ....???

    Hi
    This statement is not allowed in classes and declares a data object table_wa as a table work area whose data type is adopted from the identically named structured data type table_wa from the ABAP Dictionary. table_wa must be defined as a flat structure in the ABAP Dictionary. You can specify database tables or Views for table_wa.
    Work table areas declared with TABLES are interface work areas and should only be declared in the global declaration section of a program for the following purpose:
    reward if usefull
    The statement TABLES is required for exchanging data between screen fields that were defined in a program screen when transferring from the ABAP Dictionary and the ABAP program. For the screen event PBO, the content of the table work area is transferred to identically named screen fields; for PAI, the system adopts the data from identically named screen fields.
    In executable programs, flat table work areas can be used for adopting data that were provided for the event GET table_wa from a linked logical database. TABLES is synonymous with the statement NODES for this purpose.
    Work table areas declared with TABLES behave like the data declared with the addition COMMON PART, meaning the data are used by the programs of a program group.
    Table work areas declared with TABLES can be declared in subroutines and
    function modules. However, this is not recommended. A table work area declared in a procedure is not local but belongs to the context of a framework program. The table work area can be viewed starting from the declaration in the framework program and lives as long as the framework program. In contrast to normal program-global data, the content of the table work areas declared in subroutines and function modules is stored temporarily when these subroutines and function modules are called. Value assignments that were made during runtime of the procedure are preserved until the procedure is completed. When exiting the procedure, the table work areas are filled with the contents that they contained when the procedure was called. Table work areas declared in procedures behave like global data to which the statement LOCAL is applied in the procedure.
    The form TABLES * is obsolete.

  • How to use dynamic select query which queries from 3 different table.

    Hi All,
    I am new to Toplink, i would like to use a named query to select some of the columns from 3 different tables with dynamic where clause.
    I have used the following lines. Please tell me how to get code for the dynamic where clause.
    First try :
    Vector objPersons = (Vector)session.executeQuery("findPersonByGlobalID",Person.class,vQueryArguments);
    The above method is not returning the vector or collection.
    Second Try:
    ReadAllQuery query = new ReadAllQuery(Person.class);
    query.useCollectionClass(LinkedList.class);
    LinkedList person = (LinkedList) session.executeQuery(query);
    The second try is returning the collection but, this fetches all the record from the table.
    1. How to query for range of records?
    2. How to query from multiple tables for some range. How to use dynamic range values ?
    Please reply with your answers or some pointers would help.
    Thanks and Regards,
    Vijay.B

    Hi,
    Did you try using a SQLCall ? It might be able to satisfy you requirements .. :-
    Employee employee = (Employee) session.executeSelectingCall(
        new SQLCall("SELECT * FROM EMPLOYEE WHERE EMP_ID = 44")
    );You can get more information here :-
    http://www.oracle.com/technology/products/ias/toplink/doc/1013/MAIN/_html/qrybas004.htm
    Regards,
    Sandeep

  • Drill Down reports must be selected using precisely one ledger

    hi all,
    whenever i am trying to execute the report from FGI4(report painter), this error message is coming:-
    Drill Down reports must be selected using precisely one ledger
    can you please help me with solution?
    indranil

    Hi,
    Please give ledger in the selection as 0l or 0f or press F4 & select there.If you are creating your own report then you must assign characterstic ledger to your report.On that basis system will fetch data.
    points if found useful.
    regards,
    Abhijit

Maybe you are looking for