For all entries against Ranges

Hi,
I have a question regarding a Select query where I have to select some data and then store it in table and refer it for the 2nd Select.
eg: Select from table 1
      into itab1.
    select from table 2
   into itab2
   for all entries in itab1.
My question is should I use a Range for the 1st select instead of an itab.The itab1 will be containing max 50 records.
The problem with for all entries is that I cannot use 'UP TO ROWS' as it only deletes extra entries at application level and not database level. I will be selecting 1000 rows even if I want only 100 rows.
Please let me know ur views

From a performance perspective ranges perform better than FOR ALL ENTRIES however the number of records you can use in your range is limited. You will get a run time dump if your range size increases beyond the allowable. If you are very confident that you have not more than 50 entries in your range, I would recommend that you use the range instead of FOR ALL ENTRIES.
An even better option would be to use a join of two tables. If you can provide specifics I could help you further.

Similar Messages

  • For all Enteries in & Ranges Performance Problem

    Is there any soln of For all enteries in & Ranges as
    If i use for all enteries in my report, it becomes slow .
    and if i use Ranges , if no. of record exceeds system will throw dump.
    Since long i couldnt find any good soln for this problem , can anyone guide me
    how to solve this problem.
    Thanks

    Hi All
    I am pasting down query for more expert optimzation comments of the current probs
    SELECT zsd_weigh_bridg1~weight_no zsd_weigh_bridg1~challn_no
               likp~vbeln AS likp_vbeln likp~lfdat
               lips~vgbel
               vbfa~vbeln AS vbfa_vbeln vbfa~vbtyp_n
               mkpf~budat
    *         vtfa~vbeln AS vtfa_vbeln
               ekko~knumv AS ekko_knumv
               ekpo~inco1 ekpo~werks
               APPENDING CORRESPONDING FIELDS OF TABLE lit_in
          FROM zsd_weigh_bridg1
               INNER JOIN likp ON likp~traid = zsd_weigh_bridg1~weight_no
               INNER JOIN lips ON lips~vbeln = likp~vbeln
               INNER JOIN vbfa ON vbfa~vbelv = likp~vbeln
               LEFT OUTER JOIN mkpf ON mkpf~mblnr = vbfa~vbeln
               LEFT OUTER JOIN vtfa ON vtfa~vbelv = vbfa~vbeln
               INNER JOIN ekko ON ekko~ebeln = lips~vgbel
               INNER JOIN ekpo ON ekpo~ebeln = ekko~ebeln
    *           FOR ALL ENTRIES IN git_bridge
          WHERE zsd_weigh_bridg1~weight_no  in r_weight." git_bridge-weight_no ." r_weight.
      ENDIF.
      lit_in_tmp[] = lit_in[].
      DELETE lit_in_tmp  WHERE vbtyp_n NE '8'.
      IF lit_in_tmp[] IS NOT INITIAL.
        SELECT mandt knumv kposn vbeln netwr netpr INTO TABLE lit_vfsi
          FROM vfsi FOR ALL ENTRIES IN lit_in
         WHERE vbeln EQ lit_in-likp_vbeln.
        SELECT mandt tknum vbelv posnv vbtyp_v vbeln posnn vbtyp_n
               INTO TABLE lit_vtfa
          FROM vtfa FOR ALL ENTRIES IN lit_in
         WHERE vbelv EQ lit_in-vbfa_vbeln.
        IF lit_vtfa[] IS NOT INITIAL.
          SELECT mandt fknum fkpos knumv
            FROM vfkp INTO CORRESPONDING FIELDS OF TABLE lit_vfkp
                 FOR ALL ENTRIES IN lit_vtfa
           WHERE fknum EQ lit_vtfa-vbeln.
        ENDIF.
      ENDIF.

  • Facin problems in the 'Select... for all entries'

    I am facing problem with this piece of code, please share ur thoughts on it. I have specified the inputs.
    I am extracting the open items from the BSIS table for specified 3 account number.
    Inputs to the prg:
    field     No. of values
    r_bukrs       1
    r_hkont      2
    r_blart     6
    r_budat  date range of 1 yr
    r_bldat  nil
    v_tosdef contain 1 account number
    " In each FI document posted, one line will have the 'v_tosdef' account number and one account from the 'r_hkont' values."
    So will this query efficient.
      SELECT bukrs
             hkont
             gjahr
             belnr
             budat
             bldat
             xblnr
             blart
             shkzg
             dmbtr
        FROM bsis
        INTO TABLE i_bsis
       WHERE bukrs IN r_bukrs                    " Company code
         AND hkont =  v_tosdef                  " Account number
         AND budat IN r_budat                    " Posting date
         AND bldat IN r_bldat                    " Document date
         AND blart IN r_blart.                   " Document type
      IF sy-subrc <> 0.
        MESSAGE i003.
        STOP.
      ENDIF.
    *@ Collecting the BELNR & GJAHR From the extracted records
      li_bsis[] = i_bsis[].
      SORT li_bsis BY bukrs gjahr belnr.
      DELETE ADJACENT
      DUPLICATES FROM li_bsis
            COMPARING bukrs gjahr belnr.
      IF NOT li_bsis[] IS INITIAL.
        SELECT bukrs
               hkont
               gjahr
               belnr
               budat
               bldat
               xblnr
               blart
               shkzg
               dmbtr
          FROM bsis
    APPENDING TABLE i_bsis
           FOR ALL ENTRIES IN li_bsis
         WHERE bukrs = li_bsis-bukrs               " Company code
           AND hkont IN r_hkont                    " Account number
           AND gjahr =  li_bsis-gjahr              " Fiscal year
           AND belnr =  li_bsis-belnr.             " Document num
    BSIS table size around 86GB
    primary index size aroung 33GB
    and the index quality is 54%
    the CBO shows less cost, but the actual runs takes too much disk read's / bgets..
    Message was edited by:
            Sandy

    Hi Sandy,
    You indicated the size of the tables and index, what is the total number of records in your BSIS?
    In your range tables, make sure they are postive formed.
    Ex. r_bukrs :  I EQ '1001', and not I NE '1000'.
    You should consider coding your statements to check for input for bldat, code it with r_bldat and then another set without. It should be better performance to not have empty where conditions. So two routines, Selects with bldat and without.
    Don't know if you have a Basis person to help analyze the performance, but you should look at the indexes in BSIS. You may have several indexes that contain some of your input fields but they may be spread across several indexes or there may be none. But say you have 5 indexes and it happens that just one of your parameters are in each of those indexes. Well, it can only use one index so while you think you are providing alot of parameters to help performance only one field is being used to access the index. What you need to do then is to find an index that has the most fields in your where clause and see if you can add to that, so long it's not an SAP index. If it's a z index consider adding additional fields to it, or consider creating a new index.
    You can at least analyze the first Select in your DEV client. Run a trace, ST05 and then execute your code. It will show you which index it has used if any.
    Also, look at the query values it is passing to the database. You said you get 6 M records on the first Select. This just seem like a lot of records, which is for just one account number (v_tosdef) along with the other parameters. I'm wondering if there's a problem with your input data. With 6M in your first table, your FOR ALL ENTRIES statement will be executed 1.2 million times. Tyically the database interface breaks down your Select-For All entries statement into 5 records per query. Again, run ST05 and you will see this.
    In SE16, on your BSIS table, what is your count of records if you enter only the account number?
    As a test, you might want to try entering all your parameters in SE16, run ST05 to trace the SQL to see what it is doing. You may have to kill your SE16 session or it may time out on you. You can stop your ST05 trace before your SE16 finishes and it will still show how SAP is going after the data and what index it used.
    Let me know if this helped any.
    Regards,
    Filler

  • FOR ALL ENTRIES IN with two tables

    Hi Guy's,
    I have two int. tables, gt_likp, gt_lips.
    I need to use "FOR ALL ENTRIES IN" with this two tables.
      SELECT matnr
             vkorg
             vtweg
             ypcogsl
        FROM mvke
        INTO TABLE gt_mvke
    <b>    "FOR ALL ENTRIES IN gt_likp gt_lips"</b>
        WHERE matnr = gwa_liefpos_tab-matnr
        AND vkorg = gt_likp-vkorg
        AND vtweg = gt_lips-vtweg.
    How to do this?
    Please Help.
    Thanks in Advance.

    Hi,
    Fill gt_likp-vkorg values in a range(r_vkorg). Use gt_lips in FOR ALL ENTRIES.
    Basically you can use only 1 internal table with FOR ALL ENTRIES statement.
    SELECT matnr
    vkorg
    vtweg
    ypcogsl
    FROM mvke
    INTO TABLE gt_mvke
    FOR ALL ENTRIES IN gt_lips
    WHERE matnr = gwa_liefpos_tab-matnr
    AND       vkorg in r_vkorg
    AND       vtweg = gt_lips-vtweg.
    - SRao

  • Develop alv using for all entries

    Develop an Sales Document ALV Report .   
         Select the mentioned field from two tables using FOR ALL ENTRIES , display the output in ALV Format.
    Table Name 1     KNA1     General Data in Customer Master
    Fields     KUNNR     
         LAND1     
         ERDAT     
         NAME1     
         ORT01     
         PSTLZ
    Table Name 2     VBAK     Sales Document: Header Data
    Fields     VBELN     
         AUDAT     
         VBTYP     
         TRVOG     
         AUART     
    ALV O / P Format Fields     KUNNR     from KNA1 Table
         LAND1     from KNA1 Table
         ERDAT     from KNA1 Table
         NAME1     from KNA1 Table
         ORT01     from KNA1 Table
         PSTLZ     from KNA1 Table
         VBELN     from VBAK Table
         AUDAT     from VBAK Table
         VBTYP     from VBAK Table
         TRVOG     from VBAK Table
         AUART     from VBAK Table
    Moderator Message: This is not a training forum. Please refrain from using it as one.
    Edited by: kishan P on Jun 6, 2011 2:23 PM

    FOA is for passing one internal table to select statement..
    Press F1 on it, it will give you the details.
    if you really want to pass more than one tables, you can use range tables.. just similar to what we do in case of select-options..
    as in
    select x y z from dbtab
                         where x in s_x
                                  y in s_y.
    hope you understand..

  • Populating Empty Fields for Existing Internal Table Using For All Entries

    I have an internal table called itab_extract that populates without any issues in SELECT A and SELECT B below. Trying to avoid looping, I am using select DB table 'for all entries' in itab_extract. I want the empty fields in itab_extract to populate from the values in the database. However, about 200,000 entries are being appended to the table, and, the values that existed for the already populated fields in itab_extract are gone, and the new fields are populated.
    I've played with the syntax and cannot seem to get it to work. My next option is a time consuming loop.
    How should the for all entries syntax look to accomplish filling the empty fields in the itab?   Thank-You
    *read ekko
        select ebeln lifnr aedat bsart from ekko                                                     *SELECT A*
               into  CORRESPONDING FIELDS OF TABLE me->itab_extract
               where aedat in r_aedat.
        select ebeln lifnr aedat BSART from ekko                                                  *SELECT B*
               appending CORRESPONDING FIELDS OF TABLE me->itab_extract
               where aedat in S_DATE2 AND
                     BSART IN S_BSART.
          select ebelp werks matnr                                                                           *SELECT C*
            into CORRESPONDING FIELDS OF TABLE itab_extract
            from ekpo
            FOR ALL ENTRIES IN itab_extract
            where ebeln = itab_extract-ebeln.

    Hi Tom,
               This SQL statement will be time consuming, Do not use a loop.
    There are two options.
    1. Select EKKO and EKPO details based on standard SAP view. (You can type EKKO in se11 view to find the correct view).
        also use one range table populate r_aedat and s_date2 in the same. So you where condition will have r_newrange and   
        s_bsart. Also do not use into corresponding fields, it is not a good idea. It will increase your performance. Maintain the proper 
        sequence (Based on database structure of EKKO and EKPO)
    2. If you are keen to use for all entries, then first select ekko then after your sy-subrc check get the data from EKPO.
    Should be like this.
    select ebeln bsart aedat lifnr from ekko into table gt_ekko where aedat in r_newrange and bsart in s_bsart.
    if sy-subrc eq 0.
    sort gt_ekko by ebeln ascending.
    select ebeln ebelp werks matnr  into table gt_ekpo for all entries in gt_ekko where ebeln eq gt_ekko-ebeln.
    endif.
    Hope it helps,
    Best Regards,
    Tapodipta Khan.

  • Usage of FOR ALL ENTRIES in SELECT query

    Hi All,
    While writing SELECT query using FOR ALL ENTRIES, in the WHERE condition can we use IN operator on a range table?
    Will this work out.
    Thanks,
    Anil Kumar

    HI,
    Yes you can use the in operator.
    SELECT *
      FROM MARC
      INTO TAB:E i_mARC
        FOR ALL ENTRIES IN I_MARA
      WHERE MATNR EQ I_MARA_MATNR
        AND WERKS IN S_WERKS.

  • Group by with for all entries

    Hi,
       SELECT  max( VBELN ) VGBEL VGPOS POSNR FKIMG VRKME NTGEW  MATNR ARKTX  WERKS MVGR3
           FROM VBRP
           INTO TABLE T_INVIT
           FOR ALL ENTRIES IN T_INVHD
           WHERE  VBELN = T_INVHD-VBELN
           AND    SPART = T_INVHD-SPART
           AND    werks IN swerks
           AND    mvgr3 IN smvgr3
           group by  VBELN VGBEL VGPOS POSNR FKIMG VRKME NTGEW  MATNR ARKTX  WERKS MVGR3.
    i want to (max) invoice no against a delivery i.e vgbel but in this query i am getting error that with for all entries only count *  is allowed.
    regards
    Fozia

    Hi Do this way..
    IF NOT T_INVHD[] is initial.
    LOOP AT T_INVHD
    SELECT max( VBELN ) VGBEL VGPOS POSNR FKIMG VRKME NTGEW MATNR ARKTX WERKS MVGR3
    FROM VBRP
    INTO T_INVIT
    WHERE VBELN = T_INVHD-VBELN
    AND SPART = T_INVHD-SPART
    AND werks IN swerks
    AND mvgr3 IN smvgr3
    group by VGBEL VGPOS POSNR FKIMG VRKME NTGEW MATNR ARKTX WERKS MVGR3.
    IF SY-SUBRC = 0.
    APPEND T_INVIT.
    CLEAR T_INVIT
    ENDIF.
    endselect.
    endloop.
    endif.
    EVEN NO EFFECT ON PERFORMANCE
    RGDS
    RAJESH

  • Problem with FOR ALL ENTRIES statement

    Hi all
    please find the problem in the select statement.
    SELECT vbbe~vbeln
             vbap~vstel
             marc~dispo
             vbbe~matnr
             vbbe~kunnr
             vbbe~werks
             vbbe~mbdat
             vbbe~omeng
      INTO TABLE l_t_dvbeln
      FROM vbbe
      INNER JOIN vbak
      ON
      vbbe~vbeln = vbak~vbeln
      inner join vbap
      on
      vbbe~vbeln = vbap~vbeln and
      vbbe~matnr = vbap~matnr
      inner join marc
      on
      vbbe~matnr = marc~matnr and
      vbbe~werks = marc~werks
      FOR ALL entries IN g_t_stock
      WHERE vbbe~matnr = g_t_stock-matnr
      AND   vbbe~werks = g_t_stock-werks
      AND   vbak~vkorg = g_t_stock-vkorg
      AND   vbak~vtweg = g_t_stock-vtweg
      AND   vbbe~kunnr = g_t_stock-kunnr
      AND   vbbe~mbdat IN r_mbdat.
    g_t_stock is having only one record i.e.,
    g_t_stock-vstel = 'DF01'.
    g_t_stock-dispo = 'DEI'.
    g_t_stock-matnr = '00100833'.
    g_t_stock-maktx = 'SAC (300X400)'.
    g_t_stock-kunnr = '0000600431'.
    g_t_stock-werks = 'PF71'.
    g_t_stock-labst = '7727'.
    g_t_stock-vkorg = 'SF71'.
    g_t_stock-vtweg = 'IC'.
    and r_mbdat has the date range as
    r_mbdat-sign = I
    r_mbdat-option = BT
    r_mbdat-low = 15.05.2008
    r_mbdat-high =  08.06.2008
    In vbak vbap & marc tables i have only one record as per the above selection criteria.
    in VBBE table i have 7 records which satisfies the above criteria. But the select staement retrieves only 5 records.
    if we remove for all entries and hardcode the values in the select statement then it retrieves all 7 records.
    can anybody help me.
    what is the reason it is showing only 5 records.

    Hi all
    actually it has to retrieve the following records
    VBELN      MATNR    KUNNR WERKS  MBDAT    LABST
    30001417     00100833     600431  PF71   15.05.2008   20.000
    30001417     00100833     600431  PF71   15.05.2008   20.000
    30001417     00100833     600431  PF71   22.05.2008   5.000
    30001417     00100833     600431  PF71   22.05.2008   7.000
    30001417     00100833     600431  PF71   27.05.2008  10.000
    30001417     00100833     600431  PF71   27.05.2008  10.000
    30001417     00100833     600431  PF71   29.05.2008  10.000
    But it is retrieving only 5 records as below
    VBELN      MATNR    KUNNR WERKS  MBDAT    LABST
    30001417     00100833     600431  PF71   15.05.2008   20.000
    30001417     00100833     600431  PF71   22.05.2008   5.000
    30001417     00100833     600431  PF71   22.05.2008   7.000
    30001417     00100833     600431  PF71   27.05.2008  10.000
    30001417     00100833     600431  PF71   29.05.2008  10.000
    Please give the reason

  • Problem with FOR ALL ENTRIES IN

    This is my simple source code.
    TABLES: stpo.
    DATA:  t_stpo      LIKE  stpo  OCCURS 0 WITH HEADER LINE,
    t_stpo_itm      LIKE  stpo  OCCURS 0 WITH HEADER LINE,
    t_stpo-stlnr = '00000058'.
    t_stpo-stlkn = '00000003'.
    append t_stpo.
    t_stpo-stlnr = '00000058'.
    t_stpo-stlkn = '00000007'.
    append t_stpo.
    SELECT * FROM stpo INTO TABLE t_stpo_itm
    FOR ALL ENTRIES IN t_stpo
    WHERE stlnr =  t_stpo-stlnr        " BOM No.
      AND stlkn <> t_stpo-stlkn.       " BOM item node number
    The output from this source including BOM item node number 00000003, 00000007 but at SQL stlkn <> t_stpo-stlkn doesn't effected.
    Could Anyone please tell me why?
    Are there something wrong?
    Thank you in advance.

    Hi,
    You can also Use ranges for Stlnr and Stlkn fields, instead of int table.
    TABLES: stpo.
    DATA: begin of  t_stpo OCCURS 0.
                  stlnr like stpo-stlnr,
                  stlkn  like stpo-stlkn,
                  end of t_stpo.
    data t_stpo_itm LIKE stpo OCCURS 0 WITH HEADER LINE.
    t_stpo-stlnr = '00000058'.
    t_stpo-stlkn = '00000003'.
    append t_stpo.
    clear t_stpo.
    t_stpo-stlnr = '00000058'.
    t_stpo-stlkn = '00000007'.
    append t_stpo.
    clear t_stpo.
    if not t_stpo[] is initial.
    SELECT * FROM stpo INTO TABLE t_stpo_itm
    FOR ALL ENTRIES IN t_stpo
    WHERE stlnr = t_stpo-stlnr " BOM No.
    AND stlkn <> t_stpo-stlkn. " BOM item node number
    endif.
    or you can simply write a select for STPO like this:
    SELECT * FROM stpo INTO TABLE t_stpo_itm
    WHERE stlnr = '00000058' " BOM No.
    AND ( stlkn <> '00000007' or stlkn <>  '00000003' ). " BOM item node number
    regards,
    Anji

  • What is the use of for all entries in select statement

    what is the use of for all entries in select statement

    hi,
    FOR ALL ENTRIES is an effective way of doing away with using JOIN on two tables.
    You can check the below code -
    SELECT BUKRS BELNR GJAHR AUGDT
    FROM BSEG
    INTO TABLE I_BSEG
    WHERE BUKRS = ....
    SELECT BUKRS BELNR BLART BLDAT
    FROM BKPF
    INTO TABLE I_BKPF
    FOR ALL ENTRIES IN I_BSEG
    WHERE BUKRS = I_BSEG-BUKRS
    AND BELNR = I_BSEG-BELNR
    AND BLDAT IN SO_BLDAT.
    *******************************8
    look another example
    what is the use of FOR ALL ENTRIES
    1. INNER JOIN
    DBTAB1 <----
    > DBTAB2
    It is used to JOIN two DATABASE tables
    having some COMMON fields.
    2. Whereas
    For All Entries,
    DBTAB1 <----
    > ITAB1
    is not at all related to two DATABASE tables.
    It is related to INTERNAL table.
    3. If we want to fetch data
    from some DBTABLE1
    but we want to fetch
    for only some records
    which are contained in some internal table,
    then we use for alll entries.
    1. simple example of for all entries.
    2. NOTE THAT
    In for all entries,
    it is NOT necessary to use TWO DBTABLES.
    (as against JOIN)
    3. use this program (just copy paste)
    it will fetch data
    from T001
    FOR ONLY TWO COMPANIES (as mentioned in itab)
    4
    REPORT abc.
    DATA : BEGIN OF itab OCCURS 0,
    bukrs LIKE t001-bukrs,
    END OF itab.
    DATA : t001 LIKE TABLE OF t001 WITH HEADER LINE.
    itab-bukrs = '1000'.
    APPEND itab.
    itab-bukrs = '1100'.
    APPEND itab.
    SELECT * FROM t001
    INTO TABLE t001
    FOR ALL ENTRIES IN itab
    WHERE bukrs = itab-bukrs.
    LOOP AT t001.
    WRITE :/ t001-bukrs.
    ENDLOOP.
    Hope this helps!
    Regards,
    Anver
    <i>if hlped pls mark points</i>

  • Select ....FOR ALL ENTRIES.... performance tuning

    I have the following SELECT statement:
    SELECT recn, recnroot, ippers
         INTO CORRESPONDING FIELDS OF TABLE <ITAB1>
       FROM CCIHT_IP
          FOR ALL ENTRIES IN <ITAB2>
    WHERE ippers = <ITAB2>-ippers
          AND valfr LE sy-datum
          AND valto GE sy-datum
          AND iptype = 'INJ'.
    Did a trace, and the SQL executed is:
    SELECT recn, recroot, ippers
       FROM CCIHT_IP
    WHERE mandt= ?
         AND ippers IN (?1, ..., ?10)
         AND valfr <= ?
         AND valto >= ?
         AND iptype = ?
         FOR FETCH ONLY WITH UR
    This is very slow.
    To speed it up, I programmatically break up the SQL using a range table:
    i.e.:   WHERE ...
                 AND IPPERS IN <RANGE TABLE>
        With the range table containing 1500 entries which is near the limit for IN statement. This is much faster.
    The question is why with the FOR ALL ENTRIES the IN statement contains only 10 values and not the maximum allowed, is this a database config issue ?

    Hi,
    as Thomas said for this case rsdb/max_in_blocking_factor is the parameter in question.
    And yes, Andrew, you are right, FAE parameters should not be changed system wide
    since the delivered default values are those values that turned out to be the best values
    in systemwide tests.
    However you can increase the value on statement level with a hint. So you can have both
    the FAE and a non default blocking for a specific statement.
    example:
    SELECT recn, recnroot, ippers
    INTO CORRESPONDING FIELDS OF TABLE <ITAB1>
    FROM CCIHT_IP
    FOR ALL ENTRIES IN <ITAB2>
    WHERE ippers = <ITAB2>-ippers
    AND valfr LE sy-datum
    AND valto GE sy-datum
    AND iptype = 'INJ'
    %_hints db2 '&max_blocking_factor 500&&max_in_blocking_factor 500&u2019.
    Use with care.
    Kind regards,
    Hermann

  • Regarding 'Select .... for all entries' statement

    Hi experts,
    Can anyone suggest me that whether we can use two internal tables in 'Select .... for all entries'  statement?

    Hi,
    You can use ranges instead of second for all entries.
    Eg:
    Say for example i need to write selec statement using fields from two int tables in where conidition namely itab1, itab2.
    RANGES: r_vbeln FOR wa_tab1-vbeln.
    LOOP AT itab1 INTO wa_tab1.
      r_vbeln-sign = 'I'.
      r_vbeln-option = 'EQ'.
      r_vbeln-low = wa_tab1-vbeln.
      APPEND r_vbeln.
    ENDLOOP.
    SELECT * FROM vbap INTO TABLE itab3
    FOR ALL ENTRIES IN itab2
    WHERE vbeln IN r_vbeln "range contains all vbeln from the table itab1
    AND matwa = itab2-matwa.
    Hope this helps you.
    Regards,
    Manoj Kumar P

  • Nested statement "for all entries in"

    Hi,
    is ist possiple to nest "for all entries in" statements ?
    At the moment I have the following SELECT-Statement:
    select * from /rtc/tm_inusk
              appending table gt_zrtc4inusk
              for all entries in lt_trkorrdesti
                where trkorr = lt_trkorrdesti-trkorr and
                      objname in lv_selk_copy.
    Sometimes the statement dumps because the range table "lv_selk_copy" is to big.
    In another thread I was told to use "for all entries in" instead of a range when the range is to big.
    If do so I have to use two "for all entries in" statements in my select. But I think this is not possible.
    So any idea ?
    Thanks
    Arnfried

    Hi,
    Using two for all entries in not possible... Its better that you split up your range into smaller chunks..
    or..
    select * from /rtc/tm_inusk
    appending table gt_zrtc4inusk
    for all entries in lt_trkorrdesti
    where trkorr = lt_trkorrdesti-trkorr .
    Once you have selected delete the records where objname Not in lv_selk_copy.

  • FOR ALL ENTRIES IN Problem

    Hello,
    probably it is a silly problem, but can anybody tell me why this FOR ALL ENTRIES IN statement does not fill all the columns of my internal table?
    At the end of the report only the columns LGOBE contains values.
    data itab type zmm_t_alv.
    select mardmatnr mardwerks mardlgort mardlabst
      maktspras maktmaktx
      into corresponding fields of table itab
      from mard inner join makt
        on mardmatnr = maktmatnr
    where makt~spras = 'D'.
    select lgobe
      into corresponding fields of table itab
      from t001l
      for all entries in itab
      where t001l~werks = itab-werks.
    break-point.
    Thanks,
    Manuel

    Please read the documentation aboutr for all entries
    For all entries selects all records from a db table which correspond to the entries in an internal table, the result must be stored in a different table.
    Otherwise use a loop at itab.
       select single ...
       modify itab
       endloop
    Be careful with empty For all entries tables, it behave like a ranges table, no entry means no restriction and you get all records from the db table. That is a different behavior than the loop above.
    Use   field1 field2 ... in corresponding fields of ....
    If you specify only one field then you get only one result.
    If you want one the field 'lgobe' then use into wa-lgobe and not the much slower into corresponding!
    Siegfried

Maybe you are looking for

  • Am I being charged for international texting?

    So I am doing a masters program in Ireland, so I'm international. Everyone that I talk to back home has an iphone just like I do, and I have a question that I cannot find an answer to. Since I'm in Ireland, I don't want to have a huge phone bill ever

  • Adobe Premiere Pro CC crash on startup

    Hello i have a problem when i will open Adobe Premiere Pro CC it crash and i become this error Problem signature:   Problem Event Name:         APPCRASH   Application Name:          Adobe Premiere Pro.exe   Application Version:          8.2.0.65   Ap

  • How to delete CR2 files from iPad

    I recently used the camera connection kit to download photos (JPEG and Raw) from my Canon G12 to my iPad.  Since I have gotten home, I have been transferring the photos to iPhoto on my MacBook Pro.  When I try to delete the photos from my iPad, it wi

  • CIM_ERR_FAILED: HTTP response code: 404 Not found

    Hello! We are installing NW7.0 PI with local SLD as HA system with virtual name and after patching it up to SPS17 we started Configuration wizard PI_00_This wizard will execute Postinstall steps of technical configuration for the PI Usage and on step

  • Problem - Class containing template functions

    Hi everyone, I've written a simple class (not template), containing one template functions, like te following one: class MyClass public: template <typename T> typename T::_ptr_type DoSomeThing(int a, int b); When I am within a function and I need to