Question for "FOR ALL ENTRIES"

Some materials mentioned that If the table on which the For All Entries IN clause is based is very large, the performance will go down instead of improving. But what's the moderate size of the table used in "FOR ALL ENTRIES"?

Hi Dan,
Yes the material you read is correct some ways.
For all entries 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.
If you using less than 1000 records then it is better to populate those entries into a range then you can use that in the select as IN option.
If the entries are more 1000 records then it is better to use below logic
describe table r_ebeln  lines dl_lines.
    if dl_lines >= 1.
      clear: dl_start, dl_end.
      do.
        dl_start = dl_end + 1.
        dl_end = dl_end + 1000.
        if dl_end > dl_lines.
          dl_end = dl_lines.
        endif.
        refresh: r_ebeln_temp. clear r_ebeln_temp.
        append lines of r_ebeln from dl_start to dl_end to r_ebeln_temp.
        select ebeln "PurNo
               bukrs "ComapnyCode
               ernam "Name
               ekgrp "PurGRp
               waers "Currency
               bedat "Date
             from ekko
             appending  table it_ekko
             where ebeln in r_ebeln_temp.
        if dl_end >= dl_lines.
          exit.
        endif.
      enddo.

Similar Messages

  • Wrong url in weblog for RSS, all entries and others

    I created a weblog for myself and have been writing for a while and didn't notice anything wrong.
    Now when I click RSS or all entries, I get a url to an IP adress that the machine had when it was configured the first time, befor it was moved to the hosting location.
    The weblog is at http://xserve.internetfabriek.be/weblog/internetfabriek/
    when I hit All entries it links to http://192.168.11.100:16080/weblog/internetfabriek/
    Maybe this is due to the recent upgrade to 10.4.6 or maybe I never noticed.
    I tried disabeling performance cache but the url stays the same.

    Nice one
    At last somebody who posts a solution to the problem they have...
    I was having this trouble since 10.4.3 and forgot about it... Not only did you remind me but you fixed it too.
    I did enable the admin concole on the development servers with 10.4.3 and i'm pretty sure half the options were not there.
    A theme plus pack would be nice too

  • Question about statement for all entries

    Hi Abap experts,
    I have a question concerning the ABAP statement for all entries.
    Explanations:
    Let’s say that my source package (Source table) contains 2 types of data:
    -type1
    -type2
    I would like to use the statement select from table into internal table
    For all entries in source package
    But the where statement changes depending on the data type (2 keys when data type is 1 and only 1 key when data type is 2) .
    So that would be:
    Type1:
    Select fields
    From table into internal table
    Where field1 = source_package-field1
    And field2 = source_package-field2.
    Type2:
    Select fields
    From table into internal table
    Where field1 = source_package-field1
    How can I merge them assming that the field od data type is ftype?
    Thanks.
    Amine

    Hi amine,
    i think this is helpful for you.
    there are 2 ways  to use the for all entries...
    1. with header line:  this method is old one. in this method the internal table (ITAB) is automatically create workarea (WA) with same name, this method 1 drawback is there where we can use WA and ITAB confused that's why this is come difficult.
    2. without header line : this is nowadays we can use this method. in this method we create separate ITAb and WA. very clear this method.
    EXAMPLES:
    1.WITH HEADER LINE METHOD:
    PARAMETERS p_kunnr TYPE kna1-kunnr.
    DATA:it_kna1 LIKE kna1 OCCURS 0 WITH HEADER LINE,
          it_adrc LIKE adrc OCCURS 0 WITH HEADER LINE,
          it_adr2 LIKE adr2 OCCURS 0 WITH HEADER LINE,
          it_adr6 LIKE adr6 OCCURS 0 WITH HEADER LINE.
    START-OF-SELECTION.
       SELECT * FROM kna1 INTO TABLE it_kna1
          UP TO 100 ROWS.
       IF NOT it_kna1[] IS INITIAL.
         SELECT * FROM adrc INTO TABLE it_adrc
         FOR ALL ENTRIES IN it_kna1
         WHERE addrnumber = it_kna1-adrnr.
       ENDIF.
       IF NOT it_adrc[] IS INITIAL.
         SELECT * FROM adr2 INTO TABLE it_adr2
         FOR ALL ENTRIES IN it_adrc
         WHERE  addrnumber = it_adrc-addrnumber.
       ENDIF.
       IF NOT it_adr2[] IS INITIAL.
         SELECT * FROM adr6 INTO TABLE it_adr6
         FOR ALL ENTRIES IN it_adr2
         WHERE  addrnumber = it_adr2-addrnumber.
       ENDIF.
       LOOP AT it_kna1.
         READ TABLE it_adrc WITH KEY addrnumber = it_kna1-adrnr.
         IF sy-subrc = 0.
         ENDIF.
         READ TABLE it_adr2 WITH KEY addrnumber = it_kna1-adrnr.
         IF sy-subrc = 0.
         ENDIF.
         READ TABLE it_adr6 WITH KEY addrnumber = it_kna1-adrnr.
         IF sy-subrc = 0.
         ENDIF.
         WRITE : it_kna1-kunnr, it_kna1-name1, it_adrc-city1, it_adrc-street, it_adrc-po_box_reg,
                      it_adr2-telnr_long, it_adr6-smtp_addr.
       ENDLOOP.
    2. WITH OUT HEADER LINE:
    TABLES: KNA1 , ADRC.
    DATA : IT_KNA1 TYPE STANDARD TABLE OF KNA1,
            IT_ADRC TYPE STANDARD TABLE OF ADRC,
            WA_KNA1 TYPE KNA1,
            WA_ADRC TYPE ADRC.
    DATA: BEGIN OF STRTYPE ,
           CUSTMERNO LIKE KNA1-KUNNR,
           FIRSTNAME LIKE KNA1-NAME1,
           LASTNAME  TYPE NAME2,
           CITY TYPE ORT01,
           STATE TYPE REGIO,
           COUNTRY TYPE LAND1,
           ADDRESS LIKE ADRC-ADDRNUMBER,
           END OF STRTYPE.
    DATA : IT_1 LIKE TABLE OF STRTYPE.
    SELECT-OPTIONS  K_kunnr FOR kna1-kunnr NO-EXTENSION.
    SELECT * FROM KNA1 INTO TABLE IT_KNA1 WHERE KUNNR IN K_KUNNR.
    IF NOT IT_KNA1[] IS INITIAL.
    SELECT * FROM ADRC INTO WA_ADRC FOR ALL ENTRIES IN IT_KNA1 WHERE ADDRNUMBER = IT_KNA1-ADRNR.
    ENDSELECT.
    ENDIF.
    LOOP AT IT_KNA1 INTO WA_KNA1.
       READ TABLE IT_ADRC INTO WA_ADRC WITH KEY ADDRNUMBER = WA_KNA1-ADRNR.
       IF SY-SUBRC = 0.
           STRTYPE-ADDRESS = WA_ADRC-ADDRNUMBER.
       ENDIF.
    APPEND  STRTYPE TO IT_1.
       WRITE : / WA_KNA1-KUNNR, WA_KNA1-NAME1, WA_KNA1-NAME2, WA_KNA1-ORT01, WA_KNA1-REGIO, WA_KNA1-LAND1, WA_ADRC-ADDRNUMBER.
    ENDLOOP.
    regards,
    roopa.k

  • Performance issue with select query and for all entries.

    hi,
    i have a report to be performance tuned.
    the database table has around 20 million entries and 25 fields.
    so, the report fetches the distinct values of two fields using one select query.
    so, the first select query fetches around 150 entries from the table for 2 fields.
    then it applies some logic and eliminates some entries and makes entries around 80-90...
    and then it again applies the select query on the same table using for all entries applied on the internal table with 80-90 entries...
    in short,
    it accesses the same database table twice.
    so, i tried to get the database table in internal table and apply the logic on internal table and delete the unwanted entries.. but it gave me memory dump, and it wont take that huge amount of data into abap memory...
    is around 80-90 entries too much for using "for all entries"?
    the logic that is applied to eliminate the entries from internal table is too long, and hence cannot be converted into where clause to convert it into single select..
    i really cant find the way out...
    please help.

    chinmay kulkarni wrote:Chinmay,
    Even though you tried to ask the question with detailed explanation, unfortunately it is still not clear.
    It is perfectly fine to access the same database twice. If that is working for you, I don't think there is any need to change the logic. As Rob mentioned, 80 or 8000 records is not a problem in "for all entries" clause.
    >
    > so, i tried to get the database table in internal table and apply the logic on internal table and delete the unwanted entries.. but it gave me memory dump, and it wont take that huge amount of data into abap memory...
    >
    It is not clear what you tried to do here. Did you try to bring all 20 million records into an internal table? That will certainly cause the program to short dump with memory shortage.
    > the logic that is applied to eliminate the entries from internal table is too long, and hence cannot be converted into where clause to convert it into single select..
    >
    That is fine. Actually, it is better (performance wise) to do much of the work in ABAP than writing a complex WHERE clause that might bog down the database.

  • Performance issue fetching huge number of record with "FOR ALL ENTRIES"

    Hello,
    We need to extract an huge amount of data (about 1.000.000 records) from VBEP table, which overall dimension is about 120 milions records.
    We actually use this statements:
    CHECK NOT ( it_massive_vbep[] IS INITIAL ) .
    SELECT (list of fields) FROM vbep JOIN vbap
                 ON vbepvbeln = vbapvbeln AND
                  vbepposnr = vbapposnr
                 INTO CORRESPONDING FIELDS OF  w_sched
                 FOR ALL ENTRIES IN it_massive_vbep
                 WHERE    vbep~vbeln   = it_massive_vbep-tabkey-vbeln
                    AND    vbep~posnr   = it_massive_vbep-tabkey-posnr
                    AND    vbep~etenr   = it_massive_vbep-tabkey-etenr.
    notice that internal table it_massive_vbep contains always records with fully specified key.
    Do you think this query could be further optimized?
    many thanks,
    -Enrico

    the are 2 option to improve performance:
    + you should work in blocks of 10.000 to 50.000
    + you should check archiving options, does this really make sense
    > VBEP table, which overall dimension is about 120 milions records.
    it_massive_vbep  into it_vbep_notsomassive (it_vbep_2)
    CHECK NOT ( it_vbep_2[] IS INITIAL ) .
      get runtime field start.
    SELECT (+list of fields+)
                  INTO CORRESPONDING FIELDS OF TABLE w_sched
                  FROM vbep JOIN vbap
                  ON vbep~vbeln = vbap~vbeln AND
                       vbep~posnr = vbap~posnr
                  FOR ALL ENTRIES IN it_vbep_2
                  WHERE vbep~vbeln = it_vbep_2-vbeln
                  AND      vbep~posnr = it_vbep_2-posnr
                  AND      vbep~etenr  = it_vbep_2-etenr.
      get runtime field stop.
    t = stop - start.
    write: / t.
    Be aware that even 10.000 will take some time.
    Other question, how did you get the 1.000.000 records in it_massive_vbep. They are not typed in, but somehow select.
    Change the FAE into a JOIN and it will be much faster.
    Siegfried

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

  • JOINS Vs FOR ALL ENTRIES

    hi,
    I have to extract data from 6 tables based on cross check reference among these tables.some of the tables do not have foregin key references,but i have written SELECT query joining all the 6 tables, it works fine.
    My question is, if i use FOR ALL ENTRIES instead of an inner join will it improve performance?
         but no of database hits would be more isn't it?
    Kindly reply ASAP

    hi ,
    here you go ,,,
    1. in the innerjoin system will hit the databasa one time.. then fetch the data..for the tables u have joined... when u use the join make sure the query shold not effect the performance.. try to paas all the primary key values.. then link the tables using the complete primary...
    2. when u use the FOR ALL ENTRIES.. the system will retrive all the records which matches the FIELDS which u r refering in the Internal tabel... while using the FOR ALL ENTRIES.. creal the duplicate entries.. other wise it select the record more number of time at data base level... but u will get the entries properly...
    Regards,
    Ranjita

  • 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

  • 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

  • FOR ALL ENTRIES in Object Oriented Context

    Dear all,
                is it possible to use FOR ALL ENTRIES for an internal table with out header line ? I Am using Objected Oriented Programming and I Am not able to create internal table with header line . Please provide your valuable inputs on this issue.
    Thanks In Advance.
    Sri

    Hello,
    Few questions:
    1. Did you do an F1 on FOR ALL ENTRIES(FAE)? Does it say FAE is allowed only for tables w. header line?
    2. Have you tried using FAE on an internal table w/o header line? Does it give an error?
    BR,
    Suhas

  • For all entries in source package merge

    Hi experts,
    I have one question regarding statement for all entries in source package where …..
    Explanations:
    Let’s say that my source package contains 2 types of data:
    -type1
    -type2
    I would like to use the statement select from table into internal table
    For all entries in source package
    But the where statement changes depending on the data type (2 keys when data type is 1 and only 1 key when data type is 2) .
    So that would be:
    Type1:
    Select fields
    From table into internal table
    Where field1 = source_package-field1
    And field2 = source_package-field2.
    Type2:
    Select fields
    From table into internal table
    Where field1 = source_package-field1
    How can I merge them?
    Thanks.
    Amine

    Hi Amine,
    Didn't try that before but there are some idea for you to reference.
    I assume source_packet have a field which indicate the data type which call source_packet-dtype
    1) Write SQL like this... (Notes: never try that, not sure if it will work)
    Select fields
    From table into internal table
    Where ( source_packet-dtype = 1 and field1 = source_package-field1 and field2 = source_package-field2 )
    OR ( source_packet-dtype = 2 and field1 = source_package-field1 ).
    2) Try to split the source_packet into 2 itab, one contain type 1 and another contain type 2 data and then read with 2 sql and merge with appending key word, but this idea assume the record will be difference
    Select fields
    From table into internal table
    Where field1 = itab_type1-field1
    And field2 = itab_type1-field2.
    Select fields
    From table APPENDING internal table
    Where field1 = itab_type2-field1
    BTW, you may have better luck in the ABAP space.
    Regards
    Bill
    Message was edited by: Chie Bill

  • Queries for FOR ALL ENTRIES IN

    1. If I use For all entries in inspite of loop within loop , wil it help in   
        increasing processing time ??
    2. There is one problem in For all entries in , it is not fetching all 
         entries but it left entries having same data so is it like that only
    Please dont pass any link.
    Ankesh.

    Hi,
    SELECT ... FOR ALL ENTRIES IN <itab> WHERE <cond> ..<cond>
    If you specify a field of the internal table <itab>
    as an operand in a condition, you address all lines of the internal table. The comparison is then performed for each line of the internal table. For each line, the system selects the lines from the database table that satisfy the condition. The result set of the SELECT statement is the union of the individual selections for each line of the internal table. Duplicate lines are automatically eliminated from the result set. If <itab> is empty, the addition FOR ALL ENTRIES is disregarded, and all entries are read. The internal table <itab> must have a structured line type, and each field that occurs in the condition <cond> must be compatible with the column of the database with which it is compared. Do not use the operators LIKE, BETWEEN, and IN in comparisons using internal table fields. You may not use the ORDER BY clause in the same SELECT statement. You can use the option FOR ALL ENTRIES to replace nested select loops by operations on
    internal tables. This can significantly improve the performance for large sets of selected data.
    It is also possible to avoid nested SELECT loops by placing the selection from the outer loop in an internal table and then running the inner selection once only using the FOR ALL ENTRIES addition. This technique stems from the time before joins were allowed in the FROM clause. On the other hand, it does prevent redundant data from being transferred from the database.
    Answers for your question is :
    1. If I use For all entries in inspite of loop within loop , wil it help in  increasing processing time ?? : It will Improve your performance.
    2. There is one problem in For all entries in , it is not fetching all entries but it left entries having same data so is it like that only : True it preventsredundant data from being transferred from the database.
    Hope this solves your doubt.
    Plz reward if helpful.
    Thanks,
    Dhanashri.

  • How does select stmt with for all entries uses Indexes

    Hello all,
    I goes through a number of documents but still confused how does select for all entries uses indexes if fields are not in sequences. i got pretty much the same results if i take like two cases on Hr tables HRP1000 and HRP1001(with for all entries based upon hrp1000). Here is the sequence of index fields on hrp1001 (MANDT, OTYPE, OBJID, PLVAR, RSIGN, RELAT, ISTAT, PRIOX, BEGDA, ENDDA, VARYF, SEQNR). in second case objid field is in sequence as in defined Index but i dont see significant increase in field even though the number of records are around 30000. My question is does it make a differrence to use field sequence (same as in table indexes) in comparison to redundant field sequence (not same as defined in table indexes), secondly how we can ge tto know if table index is used in Select for entries query i tried Explain in ST05 but its not clear if it uses any index at all in hrp1001 read.
    here is the sample code i use to get test results.
    test case 1
    REPORT  zdemo_perf_select.
    DATA: it_hrp1000 TYPE STANDARD TABLE OF hrp1000 WITH HEADER LINE.
    DATA: it_hrp1001 TYPE STANDARD TABLE OF hrp1001 WITH HEADER LINE.
    DATA: it_hrp1007 TYPE STANDARD TABLE OF hrp1007 WITH HEADER LINE.
    DATA: it_pa0000 TYPE STANDARD TABLE OF pa0000 WITH HEADER LINE.
    DATA: it_pa0001 TYPE STANDARD TABLE OF pa0001 WITH HEADER LINE.
    DATA: it_pa0002 TYPE STANDARD TABLE OF pa0002 WITH HEADER LINE.
    DATA: it_pa0105_10 TYPE STANDARD TABLE OF pa0105 WITH HEADER LINE.
    DATA: it_pa0105_20 TYPE STANDARD TABLE OF pa0105 WITH HEADER LINE.
    DATA: t1 TYPE timestampl,
          t2 TYPE timestampl,
          t3 TYPE timestampl 
    SELECT * FROM hrp1000 CLIENT SPECIFIED  INTO TABLE it_hrp1000 bypassing buffer
                WHERE mandt EQ sy-mandt AND
                      plvar EQ '01' AND
                      otype EQ 'S'AND
                      istat EQ '1' AND
                      begda <= sy-datum AND
                      endda >= sy-datum AND
                      langu EQ 'EN'.
    GET TIME STAMP FIELD t1.
    SELECT * FROM hrp1001 CLIENT SPECIFIED INTO TABLE it_hrp1001 bypassing buffer
                FOR ALL ENTRIES IN it_hrp1000
                 WHERE mandt EQ sy-mandt AND
                        otype EQ 'S' AND
    *                    objid EQ it_hrp1000-objid and
                        plvar EQ '01' AND
                        rsign EQ 'B' AND
                        relat EQ '007' AND
                        istat EQ '1' AND
                        begda LT sy-datum AND
                        endda GT sy-datum and
                        sclas EQ 'C' and
                        objid EQ it_hrp1000-objid.
    *                    %_hints mssqlnt 'INDEX(HRP1001~0)'.
    *delete it_hrp1001 where sclas ne 'C'.
    GET TIME STAMP FIELD t2.
    t3 = t1 - t2.
    WRITE: 'Time taken - ', t3.
    test case 2
    REPORT  zdemo_perf_select.
    DATA: it_hrp1000 TYPE STANDARD TABLE OF hrp1000 WITH HEADER LINE.
    DATA: it_hrp1001 TYPE STANDARD TABLE OF hrp1001 WITH HEADER LINE.
    DATA: it_hrp1007 TYPE STANDARD TABLE OF hrp1007 WITH HEADER LINE.
    DATA: it_pa0000 TYPE STANDARD TABLE OF pa0000 WITH HEADER LINE.
    DATA: it_pa0001 TYPE STANDARD TABLE OF pa0001 WITH HEADER LINE.
    DATA: it_pa0002 TYPE STANDARD TABLE OF pa0002 WITH HEADER LINE.
    DATA: it_pa0105_10 TYPE STANDARD TABLE OF pa0105 WITH HEADER LINE.
    DATA: it_pa0105_20 TYPE STANDARD TABLE OF pa0105 WITH HEADER LINE.
    DATA: t1 TYPE timestampl,
          t2 TYPE timestampl,
          t3 TYPE timestampl 
    SELECT * FROM hrp1000 CLIENT SPECIFIED  INTO TABLE it_hrp1000 bypassing buffer
                WHERE mandt EQ sy-mandt AND
                      plvar EQ '01' AND
                      otype EQ 'S'AND
                      istat EQ '1' AND
                      begda <= sy-datum AND
                      endda >= sy-datum AND
                      langu EQ 'EN'.
    GET TIME STAMP FIELD t1.
    SELECT * FROM hrp1001 CLIENT SPECIFIED INTO TABLE it_hrp1001 bypassing buffer
                FOR ALL ENTRIES IN it_hrp1000
                 WHERE mandt EQ sy-mandt AND
                        otype EQ 'S' AND
                        objid EQ it_hrp1000-objid and
                        plvar EQ '01' AND
                        rsign EQ 'B' AND
                        relat EQ '007' AND
                        istat EQ '1' AND
                        begda LT sy-datum AND
                        endda GT sy-datum and
                        sclas EQ 'C'." and
    *                    objid EQ it_hrp1000-objid.
    *                    %_hints mssqlnt 'INDEX(HRP1001~0)'.
    *delete it_hrp1001 where sclas ne 'C'.
    GET TIME STAMP FIELD t2.
    t3 = t1 - t2.
    WRITE: 'Time taken - ', t3.

    Mani wrote:
    Thank you for your answer, its very helpful but i am still nor sure how does parameter rsdb/max_blocking_factor affect records size.
    Hi,
    The blocking affects the size of the statement and the memory structures for returning the result.
    So if your itab has 500 rows and your blocking is 5, the very same statement will be executed 100 times.
    Nothing good or bad about this so far.
    Assume, your average result for an inlist 5 statement is 25 records with an average size of 109 bytes.
    You average result size will be 2725 byte plus overhead which will nearly perfectly fit into two 1500 byte ethernet frames.
    Nothing to do in this case.
    Assume your average result for an inlist 5 statement is 7 records with an average size of 67 bytes.
    You average result size will be ~ 470 byte plus overhead which will only fill 1/3 of a 1500 byte ethernet frame.
    In this case, setting the blocking to 12 ... 15 will give you 66% network transfer performance gain,
    and reduces the number of calls to the DB by 50%, giving additional benefit.
    Now this is an extreme example. The longer the average row length is, the lower will be the average loss in the network.
    You have the same effects in memory structures, but on that layer you are fighting single micro seconds instead of
    hundreds of these, so in real life it is rarely measurable.
    Depending on table-statistics, oracle might decide for short inlists to use a concatanation instead of an inlist.
    This is supposed to be more costy, but I never had a case where I could proove a big difference.
    Values from 5 to 15 for blocking seem to be ok for me. If you have special statements in customer coding,
    it #might# be benefitial to do the mentioned calculations and do some network tracing to see if you can squeeze your
    network efficiency by tuning the blocking.
    If you have jumbo frames enabled, it might be worth to be analyzed as well.
    If you are only on a DB-CI system that is loopback connected to the DB, I doubt there might be a big outcome.
    Hope this helps
    Volker

  • Need help for all entries

    hi to all experts,
    I'm a beginner in ABAP please help me out with following questions
    1.what is the purpose of for all entries please please help with an example(joining 3 tables)
    2. how it is different when compared with joins
    3. how too use for all entries
    4.performance issues
                               thanks in advance
    helpful answers will rewarded

    Hi,
    Go through the below link, here i gave a answer on inner joins issue, you will understand.
    Re: Improve performance of a SQL request
    <b>Reward points if it helps,</b>
    Satish

  • Better to have outer join or to have for all entries

    Hi Gurus
    I have one select query taking lot of time to retrieve data.
    My question is Is it better to have a outer join or should i go with For all entries.
      SELECT distinct sbukrs skunnr sumskz sgsber sbschl swaers
             sblart szfbdt sgjahr sbelnr sbuzei sbudat
             swrbtr sdmbtr sshkzg crzzrprctr
       APPENDING TABLE gt_data_a
       FROM bsad AS s
                      LEFT OUTER JOIN zcce1a as c  
                        ON  sbukrs = crbukrs               
                       AND  sgjahr = crefryear             
                       AND  sbelnr = cbelnr                
                       AND  sbuzei = cbuzei               
                       AND  sSHKZG = cDRCRK         
                       AND  c~REFDOCCT = 'W'            
                       AND  c~RLDNR = 'Z1'                   
                       AND  c~RVERS = '001'                 
      WHERE
             s~bukrs IN s_bukrs
         AND s~kunnr IN s_kunnr
         AND s~umsks IN s_umsks
         AND s~umskz IN s_umskz
         AND s~augdt IN s_augdt
         AND s~augbl IN s_augbl
         AND s~zuonr IN s_zuonr
         AND s~gjahr IN s_gjahr1
         AND s~belnr IN s_belnr
         AND ( sbudat IN s_budat1 AND sbudat LE p_stida ) 
         AND s~augdt GT p_stida
         AND s~bldat IN s_bldat1
         AND s~cpudt IN s_cpudt
         AND s~waers IN s_waers1
         AND s~xblnr IN s_xblnr
         AND s~blart IN s_blart
         AND s~monat IN s_monat
         AND s~bschl IN s_bschl
         AND s~shkzg IN s_shkzg
         AND s~gsber IN s_gsber
         AND s~mwskz IN s_mwskz
         AND s~dmbtr IN s_dmbtr
         AND s~wrbtr IN s_wrbtr
         AND s~hkont IN s_hkont
         AND s~filkd IN s_filkd
         AND s~zlsch IN s_zlsch
         AND s~zlspr IN s_zlspr
         AND s~mansp IN s_mansp
         AND s~mschl IN s_mschl
         AND s~madat IN s_madat
         AND s~manst IN s_manst
         AND s~maber IN s_maber
         AND s~rstgr IN s_rstgr
         AND s~projk IN s_projk
         AND s~xref1 IN s_xref1
         AND s~xref2 IN s_xref2
         AND s~imkey IN s_imkey
         AND s~fistl IN s_fistl
         AND s~dabrz IN s_dabrz
         AND s~kostl IN s_kostl
         AND s~cession_kz IN s_cessio.
    Moderator message - Please see Please Read before Posting in the Performance and Tuning Forum before posting - post locked
    Edited by: Rob Burbank on Sep 15, 2009 9:52 AM

    Hi  Sandeep Sharma,
    Table BSAD is having below primary key fields...
    BUKRS
    KUNNR
    UMSKS
    UMSKZ
    AUGDT
    AUGBL
    ZUONR
    GJAHR
    BELNR
    BUZEI
    Now the Question is In your selection screen what and all fields you kept mandatory ??
    Try to make some of these above fileds as mandatory which may fit one of the index of BSAD table...
    Different Available Indexes on BSAD is as below...
    Index for logical database
    MANDT
    KUNNR
    BUKRS
    AUGDT
    AUGBL
    GJAHR
    BELNR
    BUZEI
    Index using settlement run (payment cards)
    MANDT
    BUKRS
    CCBTC
    Index for Invoice Reference
    MANDT
    BUKRS
    REBZG
    REBZJ
    REBZZ
    KUNNR
    UMSKS
    REBZT
    Index for Line Item Access
    MANDT
    BUKRS
    BELNR
    GJAHR
    BUZEI
    Index for BW Extract
    MANDT
    BUKRS
    CPUDT
    Also code in both the way... and check the time of execution for the queries...  Actually it(Performance) depends on data as well as selection criteria...
    Hope it will solve your problem..
    Thanks & Regards
    ilesh 24x7
    ilesh Nandaniya

Maybe you are looking for

  • Spool not getting generated in OO ALV report

    Hi, I developed a report in which we are giving output in same selection screen through OO ALV. But,when we are scheduling that report in background,spool is not getting generated. Waiting for your reply. BR, Praveen

  • How to achieve Copy-Paste in java ?

    Hello How can we copy file/files from source directory to destination? At the same time , files should remain in source directory. i.e. I want to achieve copy - paste. but not cut - paste. renameTo() method removes the files from source, that I dont

  • MapViewer 11g over https - how ?!?

    Hi, anyone able to access mapviewer 11 g deployed on standalone OC4J 10.1.3.4 over Https ? Namelly, the following link works: https://localhost/mapviewer/ _but, going on the 'Demos' tab, and clicking on the 'maps and faces' link ( https://localhost/m

  • AS5400 - ISR Spin too long

    I have an AS5400-IS-M running 12.4(24)T1. I have 2 AS5X-FCs, each with 6 AS5X-PVDM2-64. I also have a CT3 card with a DS3 circuit coming into it. The bootloader is 12.3(12r)PI6b. I am getting the following message every 4-30 seconds: from Trunk(7): F

  • BW VS other data warehousing tools

    What are some of the fundamental differences between SAP BW and other datawarehousing tools like Business objects and Cognos. Please provide specific points for each of the tools. Thanks