Driver table in select for all entries

anyone please let me what is driver table in select for all entries and when do we go for select for all entries

Here is something from help
FOR ALL ENTRIES WHERE
Syntax
... FOR ALL ENTRIES IN itab WHERE ... col operator itab-comp ...
Effect
If the addition FOR ALL ENTRIES is specified before the language element WHERE, then the components comp of the internal table itab can be used as operands when comparing with relational operators.
The internal table itab must have a structured line type and the component comp must be compatible with the column col.
The logical expression sql_cond of the WHERE condition can comprise various logical expressions by using AND and OR. However, if FOR ALL ENTRIES is specified, there must be at least one Comparison with a column of the internal table itab, which can be specified either statistically or dynamically (Release 6.40 and higher). In a statement with a SELECTstatement with FOR ALL ENTRIES, the addition ORDER BY can only be used with the addition PRIMARY KEY.
The whole logical expression sql_cond is evaluated for each individual line of the internal table itab. The resulting set of the SELECT statement is the union of the resulting sets from the individual evaluations. Duplicate lines are automatically removed from the resulting set. If the internal table itab is empty, the whole WHERE statement is ignored and all lines in the database are put in the resulting set.
Notes
In Release 6.10 and higher, the same internal table can be specified after FOR ALL ENTRIES and after INTO.
The addition FOR ALL ENTRIES is only possible before WHERE conditions of the SELECT statement.
Example
Exporting all flight data for a specified departure city. The relevant airlines and flight numbers are first put in an internal table entry_tab, which is evaluated in the WHERE condition of the subsquent SELECT statement.
PARAMETERS p_city TYPE spfli-cityfrom.
TYPES: BEGIN OF entry_tab_type,
         carrid TYPE spfli-carrid,
         connid TYPE spfli-connid,
       END OF entry_tab_type.
DATA: entry_tab   TYPE TABLE OF entry_tab_type,
      sflight_tab TYPE SORTED TABLE OF sflight
                       WITH UNIQUE KEY carrid connid fldate.
SELECT carrid connid
       FROM spfli
       INTO CORRESPONDING FIELDS OF TABLE entry_tab
       WHERE cityfrom = p_city.
SELECT carrid connid fldate
       FROM sflight
       INTO CORRESPONDING FIELDS OF TABLE sflight_tab
       FOR ALL ENTRIES IN entry_tab
       WHERE carrid = entry_tab-carrid AND
             connid = entry_tab-connid.
Regards,
Santosh

Similar Messages

  • If empty internal table in select for all entries what is the result?

    In select all entries statement , if empty internal table is there then  what is the result.

    Hello,
    If the table is empty then it will select all the records table....
    To aviod this u have check the body of the itab.
    If not itab[] is intial.
    select * ....
    endif.
    I useful reward.
    Vasanth

  • Usage of 'Select for all entries' for dynamic internal tables..

    Hi all,
    I have a situation where I need to use select for all entries for a dynamic internal table.
    select * from /BIC/AZHSD_O1500 into i_table for all entries in <b>Dynamic_table</b> where doc_number = <dynamic_table????????>
    here iam not knowing how to match the <dynamic_table????????> doc_number ?
    the dynamic_table contains the doc_number as one field.
    here dynaimc_table is the internal table which is dynamic.
    I have tried various options but couldnot find the solution.
    Please resolve.
    Sidhartha.

    data : i_dyn_where type char72 occurs 0.
    field-symbols : <fs> type table.
    assign itab[] to <fs>.
    i_dyn_where = 'docno = <fs>-docno'.
    append i_dyn_where.
    select *
    from   vbak
    into   table t_vbak
    for    all entries in <fs>
    where  (I_dyn_where).   "Populate this where condition dynamically too
    Hope this will solve ur prob.

  • Performance on Select Single&Write  AND Select*(For All Entries)&Read&Write

    Hi Experts,
    I got a code review problem & we are in a argument.
    I need the best performance code out of this two codes. I have tested this both on 5 & 1000 & 3000 & 100,000 & 180,000 records.
    But still, I just need a second opinion of experts.
    TYPES : BEGIN OF ty_account,
            saknr   TYPE   skat-saknr,
            END OF ty_account.
    DATA : g_txt50      TYPE skat-txt50.
    DATA : g_it_skat    TYPE TABLE OF skat,       g_wa_skat    LIKE LINE OF g_it_skat.
    DATA : g_it_account TYPE TABLE OF ty_account, g_wa_account LIKE LINE OF g_it_account.
    Code 1.
    SELECT saknr INTO TABLE g_it_account FROM skat.
    LOOP AT g_it_account INTO g_wa_account.
      SELECT SINGLE txt50 INTO g_txt50 FROM skat
        WHERE spras = 'E'
          AND ktopl = 'XXXX'
          AND saknr = g_wa_account-saknr.
      WRITE :/ g_wa_account-saknr, g_txt50.
      CLEAR : g_wa_account, g_txt50.
    ENDLOOP.
    Code 2.
    SELECT saknr INTO TABLE g_it_account FROM skat.
    SELECT * INTO TABLE g_it_skat FROM skat
      FOR ALL ENTRIES IN g_it_account
          WHERE spras = 'E'
            AND ktopl = 'XXXX'
            AND saknr = g_it_account-saknr.
    LOOP AT g_it_account INTO g_wa_account.
      READ TABLE g_it_skat INTO g_wa_skat WITH KEY saknr = g_wa_account-saknr.
      WRITE :/ g_wa_account-saknr, g_wa_skat-txt50.
      CLEAR : g_wa_account, g_wa_skat.
    ENDLOOP.
    Thanks & Regards,
    Dileep .C

    Hi Dilip.
    from you both the code I have found that you are selecting 2 diffrent fields.
    In Code 1.
    you are selecting SAKNR and then for these SAKNR you are selecting TXT50 from the same table.
    and in Code 2 you are selecting all the fields from SAKT table for all the values of SAKNR.
    I don't know whats your requirement.
    Better you declare a select option on screen and then fetch required fields from SAKT table for the values entered on screen for SAKNR.
    you only need TXT50 and SAKNR fields.
    so declare two types one for SAKNR and another for TXT50.
    Points to be remember.
    1. while using for all entries always check the for all entries table should not be blank.
    2. you will have to fetch all the key fields in table while applying for all entries,
        you can compare key fields with a constant which is greater than initial value.
    3. while reading the table sort the table by the field on which you are going to read it.
    try this:
    TYPES : BEGIN OF ty_account,
    saknr TYPE skat-saknr,
    END OF ty_account.
    TYPES : begin of T_txt50,
          saknr type saknr,
          txt50 type txt50,
    end of t_txt50.
    DATA: i_account type table of t_account,
          w_account type t_account,
          i_txt50 type table t_txt50,
          w_txt50 type t_txt50.
    select SAKNR from SKAT into table i_account.
    if sy-subrc = 0.
    sort i_account by saknr.
    select saknr txt50 from SKAT into table i_txt50
    for all entries in i_account
    where SAKNR = i_account-SAKNR
    here mention al the primary keys and compare them with their constants.
    endif.     
    Note; here you need to take care that, you will have to fetch all the key fields in table i_txt50.
    and compare those fields with there constants which should be greater than initial values.
    they should be in proper sequence.
    now for writing.
    loop at i_account into w_account.
    clear w_txt50.
    sort i_txt50 by saknr.
    read table i_txt50 into w_txt50 with key SAKNR = w_account-saknr
    if sy-subrc = 0.
    write: w_txt50-saknr, w-txt50-txt50.
    clear w_txt50, w_account.
    endif.
    endloop.
    Hope it wil clear your doubts.
    Thanks
    Lalit

  • Dynamic select for all entries?

    Hi!
    Is it possible to do a dynamic SELECT FOR ALL ENTRIES IN... command?
    sg. like:
      DATA:
        select_text TYPE string,
        from_text TYPE string,
        where_text TYPE string.
      SELECT FOR ALL ENTRIES IN <gt_table1> (select_text)
      into corresponding fields of table <gt_table2>
      FROM (from_text)
      WHERE (where_text).
    Thanks and Best Regards,
    Tamas

    Hi,
    you can use the Dynamic Selects for FOR ALL ENTRIES, but i think you may need to use the correct Internal table to match the tabel structure
    Regards
    Sudheer

  • Dynamic OpenSQL - SELECT FOR ALL ENTRIES ?

    Hi!
    Is it possible to do a dynamic SELECT FOR ALL ENTRIES IN... command?
    sg. like:
    DATA:
    select_text TYPE string,
    from_text TYPE string,
    where_text TYPE string.
    SELECT FOR ALL ENTRIES IN <gt_table1> (select_text)
    into corresponding fields of table <gt_table2>
    FROM (from_text)
    WHERE (where_text).
    Thanks and Best Regards,
    Tamas

    Hi
    INSERT INTO (SELECT department_id, department_name, location_id
       FROM departments WHERE location_id < 2000)
       VALUES (9999, 'Entertainment', 2500);
    Is this you are looking for ?
    Regards
    Vinod

  • Select for all entries

    Hi,
          I am new in abap reports. Now i want to know why we should use select for all entries in query. We can do retrieve directly by accessing the table in database dictionary.
          Experts please give me the reasons I want to know the concepts behind it.It will be better if you kindly explain this with help of code.
         With regards,
           Abir.

    HI
    GOOD
    SELECT
    Basic form
    SELECT result [target] FROM source [where] [GROUP BY fields] [ORDER BY order].
    Effect
    Retrieves an extract and/or a set of data from a database table or view (see Relational database ). SELECT belongs to the OPEN SQL command set.
    Each SELECT command consists of a series of clauses specifying different tasks:
    The SELECT result clause specifies
    whether the result of the selection is a table or a single record,
    which columns the result is meant to have and
    whether the result is allowed to include identical lines.
    The INTO target clause specifies the target area into which the selected data is to be read. If the target area is an internal table, the INTO clause specifies
    whether the selected data is to overwrite the contents of the internal table or
    whether the selected data is to be appended to the contents and
    whether the selected data is to be placed in the internal table all at once or in several packets.
    The INTO clause can also follow the FROM clause.
    You can omit the INTO clause. The system then makes the data available in the table work area (see TABLES ) dbtab . If the SELECT clause includes a "*", the command is processed like the identical SELECT * INTO dbtab FROM dbtab statement. If the SELECT clause contains a list a1 ... an , the command is executed like SELECT a1 ... an INTO CORRESPONDING FIELDS OF dbtab FROM dbtab .
    If the result of the selection is meant to be a table, the data is usually (for further information, see INTO -Klausel ) read line by line within a processing loop introduced by SELECT and concluded by ENDSELECT . For each line read, the processing passes through the loop once. If the result of the selection is meant to be a single record, the closing ENDSELECT is omitted.
    The FROM source clause the source (database table or view ) from which the data is to be selected. It also determines
    the type of client handling,
    the behavior for buffered tables and
    the maximum number of lines to be read.
    The WHERE where clause specifies the conditions which the result of the selection must satisfy. It thus determines the lines of the result table. Normally - i.e. unless a client field is specified in the WHERE clause - only data of the current client is selected. If you want to select across other clients, the FROM clause must include the addition ... CLIENT SPECIFIED .
    The GROUP-BY fields clause combines groups of lines together into single lines. A group is a set of lines which contain the same value for every database field in the GROUP BY clause.
    The ORDER-BY order clause stipulates how the lines of the result table are to be ordered.
    Each time the SELECT statement is executed, the system field SY-DBCNT contains the number of lines read so far. After ENDSELECT , SY-DBCNT contains the total number of lines read.
    The return code value is set as follows:
    SY-SUBRC = 0 At least one line was read.
    SY_SUBRC = 4 No lines were read.
    SY-SUBRC = 8 The search key was not fully qualified.
    (nur bei SELECT SINGLE ). The returned single record is any line of the solution set.
    Example
    Output the passenger list for the Lufthansa flight 0400 on 28.02.1995:
    TABLES SBOOK.
    SELECT * FROM SBOOK
      WHERE
        CARRID   = 'LH '      AND
        CONNID   = '0400'     AND
        FLDATE   = '19950228'
      ORDER BY PRIMARY KEY.
      WRITE: / SBOOK-BOOKID, SBOOK-CUSTOMID,   SBOOK-CUSTTYPE,
               SBOOK-SMOKER, SBOOK-LUGGWEIGHT, SBOOK-WUNIT,
               SBOOK-INVOICE.
    ENDSELECT.
    Note
    Performance
    In client/server environments, storing database tables in local buffers (see SAP buffering ) can save considerable amounts of time because the time required to make an access via the network is much more than that needed to access a locally buffered table.
    Notes
    A SELECT command on a table for which SAP buffering is defined in the ABAP/4 Dictionary is normally satisfied from the SAP buffer by bypassing the database. This does not apply with
    - SELECT SINGLE FOR UPDATE
    - SELECT DISTINCT in the SELECT clause ,
    - BYPASSING BUFFER in the FROM clause ,
    - ORDER BY f1 ... fn in the ORDER-BY clause ,
    - aggregate functions in the SELECT clause ,
    - when using IS [NOT] NULL WHERE condition ,
    or if the generic key part is not qualified in the WHERE-Bedingung for a generically buffered table.
    Authorization checks are not supported by the SELECT statement, so you must program these yourself.
    In dialog systems, the database system locking mechanism cannot always guarantee to synchronize the simultaneous access of several users to the same dataset. In many cases, it is therefore advisable to use the SAP locking mechanism .
    Changes to data in a database are only finalized after a database commit (see LUW ). Prior to this, any database update can be reversed by a database rollback (see Programming transactions ). At the lowest isolation level (see the section on the "uncommitted read" under Locking mechanism ), this can result in the dataset selected by the SELECT command not really being written to the database. While a program is selecting data, a second program can add, change or delete lines at the same time. Then, the changes made by the second program are reversed by rolling back the database system. The selection of the first program thus reflects only a very temporary state of the database. If such "phantom data" is not acceptable for a program, you must either use the SAP locking mechanism or at least set the isolation level of the database system to "committed read" (see Locking mechanism ).
    In a SELECT-ENDSELECT loop, the CONTINUE statement terminates the current loop pass prematurely and starts the next.
    If one of the statements in a SELECT ... ENDSELECT loop results in a database commit, the cursor belonging to the SELECT ... ENDSELECT loop is lost and the processing terminates with a runtime error. Since each screen change automatically generates a database commit, statements such as CALL SCREEN , CALL DIALOG , CALL TRANSACTION or MESSAGE are not allowed within a SELECT ... ENDSELECT loop.
    Related OPEN CURSOR , FETCH und CLOSE CURSOR
    GO THROUGH THIS LINK
    http://www.geocities.com/SiliconValley/Campus/6345/select.htm
    THANKS
    MRUTYUN

  • Use HR_READ_INFOTYPE or select (for all entries)

    Hi
    As I have understood the difference between FM HR_READ_INFOTYPE and a select directly from PA0001 (as example) is that the FM take the authorization into account. (please correct me if I am wrong).
    My problem is that I need to select from the infotype for a lot of pernr, so I would use this statement:
        SELECT * FROM pa0001 INTO CORRESPONDING FIELDS OF TABLE wt_pa0001
          FOR ALL ENTRIES IN wt_pernr
             WHERE pernr = wt_pernr-pernr
              AND begda LE pn-endda
              AND endda GE pn-begda.
    but then I don't get the authorization check.
    For the FM HR_READ_INFOTYPE I can't use the "FOR ALL ENTRIES".
    Can I do it in an easy way, or do need to do the select, and then use an authority check after the select from each infotype?

    Calling HR_READ_INFOTYPE or selecting directly from the tables may depend on how much data you are processing.  If you only need to retrieve a few records, you could process the PERNR records you need in a loop and call HR_READ_INFOTYPE for each.  If you're processing a larger number of records, check the authorization for the each table first and then do a SELECT for all entries.  Before you read, make sure that your "FOR ALL ENTRIES" table is not empty.  In order to make your code more generic, you may want to use function module HR_CHECK_AUTHORITY_INFTY to check the authorization for each infotype.  This is the FM that the HR_READ_INFOTYPE function module uses.
    .. Craig

  • Select FOR ALL ENTRIES statement cannot get duplicates entries

    Hi all,
    t_yxapy_fields consist of
    inty  field
    0001 kostl
    0002 perid
    0008 ansal
    0008 preas
    0008 trfst
    The following is the code for me to transfer the contents of t_yxapy_fields into t_pa_fields.
    SELECT dbtab
          FROM t777d
          INTO TABLE t_pa_fields
          FOR ALL ENTRIES IN t_yxapy_fields
          WHERE infty = t_yxapy_fields-infty.
    And t_pa_fields just ended up with
    field   infty
    pa0001
    pa0002
    pa0008
    Question:The first table have 3 similar infotype 0008 but the result table only have one pa0008. I need to filled up acordingly as what table 1 have. I need another 2 pa0008 in my 2nd table. What is wrng with my Select for all entries statement here?
    Edited by: Siong Chao on Mar 27, 2010 10:35 AM

    This has nothing to do with duplicates in t777d.
    Correct, I failed to recognize that table t777d has only infty as key as pointed out by Aby. Thus in your particular case my comment was misleading. In general though FOR ALL ENTRIES removes all duplicate rows from your result set.
    If you want the other 2 values just loop t_yxapy_fields this table and read t_pa_fields and if record found add the other values to t_pa_fields table. --> will trigger performance tuning issue
    I'm pretty sure if you'd code this, you won't run into any performance issues, so follow Aby's recipe. To be more concrete, here's what I'd do: Define a mapping table t777d_tab, which holds the translation from infty to dbtab:
    types:
      begin of T_T777D_VIEW,
        INFTY type T777D-INFTY,
        DBTAB type T777D-DBTAB,
      end of T_T777D_VIEW.
    data:
      T777D_TAB type hashed table of T_T777D_VIEW with unique key INFTY.
    Fill table t_pa_fields, typed using t_t777d_tab from above, from table t777d. Then loop over your table t_yxapy_fields (I'd use [LOOP AT ... ASSIGNING|http://help.sap.com/abapdocu_70/en/ABAPLOOP_AT_ITAB_RESULT.htm] instead of LOOP AT ... INTO) and for each entry get the corresponding DBTAB value from t777d_tab (again use the [READ TABLE ... ASSIGNING|http://help.sap.com/abapdocu_70/en/ABAPREAD_TABLE_OUTDESC.htm] variant) and build your result table t_pa_fields.
    Anyhow, I suspect that even with less optimal coding (e.g. using just standard table for lookup of DBTAB values) you'd not see much of an performance impact, because it seems that your internal tables are most likely rather small...
    Cheers, harald

  • Select -- for all entries.. fetching Duplicates

    Hi,
    Im using a Select- for all entries structure. Actually Select will supress the Duplicates .But i have a table which has 20000 entries , but my select --for all entries fetching around 56000 records..!
    Any idea/ anybody have Experience this kind of Problem..?
    If i sort the internal table would it resolve the proble..? Because its not happening in all cases.. but for few cases only its extracting duplicates.. other times..its supressing the duplicates.
    Appreciate any advise.

    Hi,
    Just check the table is not initial and then write select statement.
    if not internaltable1[] is initial.
    select field into table internaltable2 for all entries in internaltable1 where field1 = internaltable1-field1.
    endif.
    *Then sort the internaltable2
    sort internaltable2 by field.
    delete adjacent dulpcates from internaltable2 comparing field.
    Hope this helps.
    Regards,
    J.Jayanthi

  • Inner join and select for all entries with respect to performance

    Hi Friends,
    I just want to know which is more efficient with respect to performance the Inner join or select for all entries?which is more efficient? and how? can you explain me in detail ?
    Regards,
    Dinesh

    INNER JOIN->
    The data that can be selected with a view depends primarily on whether the view implements an inner join or an outer join. With an inner join, you only get the records of the cross-product for which there is an entry in all tables used in the view. With an outer join, records are also selected for which there is no entry in some of the tables used in the view.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21ec77446011d189700000e8322d00/content.htm
    FOR ALL ENTRIES->
    Outer join can be created using this addition to the where clause in a select statement. It speeds up the performance tremendously, but the cons of using this variation are listed below
    Duplicates are automatically removed from the resulting data set. Hence care should be taken that the unique key of the detail line items should be given in the select statement.
    If the table on which the For All Entries IN clause is based is empty, all rows are selected into the destination table. Hence it is advisable to check before-hand that the first table is not empty.
    If the table on which the For All Entries IN clause is based is very large, the performance will go down instead of improving. Hence attempt should be made to keep the table size to a moderate level.
    Not Recommended
    Loop at int_cntry.
    Select single * from zfligh into int_fligh
    where cntry = int_cntry-cntry.
    Append int_fligh.
    Endloop.
    Recommended
    Select * from zfligh appending table int_fligh
    For all entries in int_cntry
    Where cntry = int_cntry-cntry.

  • Regarding SELECT FOR ALL ENTRIES AND DELETE ADJACENT DUPLICATES

    Hi,
    i got few doubts.....
        1) Is it necessary to DELETE ADJACENT DUPLICATES when we perform a SELECT FOR ALL ENTRIES ? because for all entries itself eliminates the duplicate entries?
       2) Wat Sy-subrc returns after a SELECT FOR ALL ENTRIES statement?
       I found some code where these are used
               SORT ITAB[] BY NEWKO[].
              DELETE ADJACENT DUPLICATES FORM ITAB[].
      SELECT buknr
                   kunnr
    FORM KNB1
        into table ITAB_KNB1
      FOR ALL ENTRIES IN ITAB
        where kunnr eq itab-newko.
    Regards.
    Maehsh.

    Hi Mahesh,
    To be more specific, first you should delete "adjacent duplicates" using the sorting key ( here : NEWKO ), if Itab contains other fields.
    SORT ITAB[] BY NEWKO[].
    DELETE ADJACENT DUPLICATES FORM ITAB COMPARING NEWKO.
    You can delete or not the duplicates, but, you must know that if you don't delete them in the Itab, you will retrieve them in the ITAB_KNB1.
    Concerning the return code, it works like for the "SELECT"  ( 0 = entries found / 4 = no entrie found )
    => One more thing, it's better check :
    Check not ITab[] is initial
    because, if the Itab is empty, you'll retrieve all the record of KNB1 !
    Hope this helps,
    Erwan.
    Message was edited by:
            Erwan LE BRUN

  • Regarding select for all entries

    Hi all,
    I want to use select for all entries....
    because i have to club 3 tablese and get the data.
    I can go for inner joins but i cant use because of performmance issues.
    so can anybody help me regarding this.
    thanks and regards,
    giri.

    do this way............
    types: begin of gt_vbrk,
            vbeln type vbrk-vbeln,
            fkart type vbrk-fkart,
            knumv type vbrk-knumv,
            bukrs type vbrk-bukrs,
            waerk type vbrk-waerk,
            netwr type vbrk-netwr,
            end of gt_vbrk,
            begin of gt_vbrp,
            vbeln type vbrp-vbeln,
            posnr type vbrp-posnr,
            fkimg type vbrp-fkimg,
            meins type vbrp-meins,
            gsber type vbrp-gsber,
            netwr type vbrp-netwr,
            aubel type vbrp-aubel,
            aupos type vbrp-aupos,
            end of gt_vbrp,
            begin of gt_vbak,
            vbeln type vbak-vbeln,
            augru type vbak-augru,
            vkgrp type vbak-vkgrp,
            gsber type vbak-gsber,
            end of gt_vbak,
            begin of gt_vbap,
            vbeln type vbap-vbeln,
            posnr type vbap-posnr,
            matnr type vbap-matnr,
            netwr type vbap-netwr,
            end of gt_vbap,
    data : git_vbrk type standard table of gt_vbrk,
          git_vbrp type standard table of gt_vbrp,
          git_vbak type standard table of gt_vbak,
          git_fcode type table of gt_fcode,
          git_vbap type table of gt_vbap.
    data : wa_vbrk type gt_vbrk,
          wa_vbrp type gt_vbrp,
          wa_vbak type gt_vbak,
          wa_fcode type gt_fcode,
          wa_vbap type gt_vbap.
    select  vbeln
              fkart
              knumv
              bukrs
              waerk
              netwr
        from vbrk into table git_vbrk
        where vbeln in s_vbeln.
      if sy-subrc eq 0.
        sort git_vbrk by vbeln.
      endif.
    if not git_vbrk[] is initial.
    clear git_vbrp[].
      select  vbeln
              posnr
              fkimg
              meins
              gsber
              netwr
              aubel
              aupos
         from vbrp into table git_vbrp
         for all entries in git_vbrk
         where vbeln = git_vbrk-vbeln.
      if sy-subrc eq 0.
        sort git_vbrp by vbeln.
      endif.
    select  vbeln
              augru
              vkgrp
              gsber
        from vbak into table git_vbak
        for all entries in git_vbrp
        where vbeln = git_vbrp-aubel.
      if sy-subrc eq 0.
        sort git_vbak by vbeln.
      endif.
    reward points if helpful............

  • Inner join and select for all entries with respect to performance in SAP

    Hi Friends,
    I just want to know which is more efficient with respect to performance the Inner join or select for all entries?which is more efficient?
    Regards,
    Dinesh

    I did some testing a while ago and found that a JOIN is usually a bit more efficient than FOR ALL ENTRIES. This wasn't always the case though, so the best thing to do is to write it both ways and see which is faster.
    Rob

  • LIKE in SELECT FOR ALL ENTRIES

    Hello all,
    select * from mara
                into corresponding fields of tabel itab_mara
                for all entries in table itab
                where matnr LIKE itab-matnr.
    for my requirement, I want to use the above statement. because in ITAB, i have MATNR with only 10 digit.
    But the problem is system does not allow this syntax.
    Do you have an idea which will avoid any other SELECT s and get away with it.
    Thanks.

    Hi
    Select Statements    contd…For All Entries
    •     The for all entries creates a where clause, where all the entries in the driver table are combined with OR. If the number of entries in the driver table is larger than rsdb/max_blocking_factor, several similar SQL statements are executed to limit the length of the WHERE clause.
         The plus
    •     Large amount of data
    •     Mixing processing and reading of data
    •     Fast internal reprocessing of data
    •     Fast
         The Minus
    •     Difficult to program/understand
    •     Memory could be critical (use FREE or PACKAGE size)
    Points to be must considered FOR ALL ENTRIES
    •     Check that data is present in the driver table
    •     Sorting the driver table
    •     Removing duplicates from the driver table
    Consider the following piece of extract
    Loop at int_cntry.
           Select single * from zfligh into int_fligh
    where cntry = int_cntry-cntry.
    Append int_fligh.
    Endloop.
    The above mentioned can be more optimized by using the following code.
    Sort int_cntry by cntry.
    Delete adjacent duplicates from int_cntry.
    If NOT int_cntry[] is INITIAL.
                Select * from zfligh appending table int_fligh
                For all entries in int_cntry
                Where cntry = int_cntry-cntry.
    Endif.

Maybe you are looking for