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.

Similar Messages

  • Joins And For all Enteries in Select Statement

    Could you please tell me when there is a high amount of data which is being handled in the table, does the use of INNER JOINS and FOR ALL ENTERIES in SELECT Statement decreases the system performance? ?
    Can you also let me know where can i get some tips regarding do's and dont's for ABAP Programming, I want to increase my system performance.
    Currently the programs which are being used are taking a lot of time for execution...
    Its very URGENT!

    Hai Jyotsna
    Go through the following Tips for improving Performence
    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)
    Some steps that might make FOR ALL ENTRIES more efficient:
    Removing duplicates from the driver table
    Sorting the driver table
    If possible, convert the data in the driver table to ranges so a BETWEEN statement is used instead of and OR statement:
                   FOR ALL ENTRIES IN i_tab
                      WHERE mykey >= i_tab-low and
                 mykey <= i_tab-high.
    Nested selects
    The plus:
    Small amount of data
    Mixing processing and reading of data
    Easy to code - and understand
    The minus:
    Large amount of data
    when mixed processing isn’t needed
    Performance killer no. 1
    Select using JOINS
    The plus
    Very large amount of data
    Similar to Nested selects - when the accesses are planned by the programmer
    In some cases the fastest
    Not so memory critical
    The minus
    Very difficult to program/understand
    Mixing processing and reading of data not possible
    Use the selection criteria
    SELECT * FROM SBOOK.                   
      CHECK: SBOOK-CARRID = 'LH' AND       
                      SBOOK-CONNID = '0400'.        
    ENDSELECT.                             
    SELECT * FROM SBOOK                     
      WHERE CARRID = 'LH' AND               
            CONNID = '0400'.                
    ENDSELECT.                              
    Use the aggregated functions
    C4A = '000'.              
    SELECT * FROM T100        
      WHERE SPRSL = 'D' AND   
            ARBGB = '00'.     
      CHECK: T100-MSGNR > C4A.
      C4A = T100-MSGNR.       
    ENDSELECT.                
    SELECT MAX( MSGNR ) FROM T100 INTO C4A 
    WHERE SPRSL = 'D' AND                
           ARBGB = '00'.                  
    Select with view
    SELECT * FROM DD01L                    
      WHERE DOMNAME LIKE 'CHAR%'           
            AND AS4LOCAL = 'A'.            
      SELECT SINGLE * FROM DD01T           
        WHERE   DOMNAME    = DD01L-DOMNAME 
            AND AS4LOCAL   = 'A'           
            AND AS4VERS    = DD01L-AS4VERS 
            AND DDLANGUAGE = SY-LANGU.     
    ENDSELECT.                             
    SELECT * FROM DD01V                    
    WHERE DOMNAME LIKE 'CHAR%'           
           AND DDLANGUAGE = SY-LANGU.     
    ENDSELECT.                             
    Select with index support
    SELECT * FROM T100            
    WHERE     ARBGB = '00'      
           AND MSGNR = '999'.    
    ENDSELECT.                    
    SELECT * FROM T002.             
      SELECT * FROM T100            
        WHERE     SPRSL = T002-SPRAS
              AND ARBGB = '00'      
              AND MSGNR = '999'.    
      ENDSELECT.                    
    ENDSELECT.                      
    Select … Into table
    REFRESH X006.                 
    SELECT * FROM T006 INTO X006. 
      APPEND X006.                
    ENDSELECT
    SELECT * FROM T006 INTO TABLE X006.
    Select with selection list
    SELECT * FROM DD01L              
      WHERE DOMNAME LIKE 'CHAR%'     
            AND AS4LOCAL = 'A'.      
    ENDSELECT
    SELECT DOMNAME FROM DD01L    
    INTO DD01L-DOMNAME         
    WHERE DOMNAME LIKE 'CHAR%' 
           AND AS4LOCAL = 'A'.  
    ENDSELECT
    Key access to multiple lines
    LOOP AT TAB.          
    CHECK TAB-K = KVAL. 
    ENDLOOP.              
    LOOP AT TAB WHERE K = KVAL.     
    ENDLOOP.                        
    Copying internal tables
    REFRESH TAB_DEST.              
    LOOP AT TAB_SRC INTO TAB_DEST. 
      APPEND TAB_DEST.             
    ENDLOOP.                       
    TAB_DEST[] = TAB_SRC[].
    Modifying a set of lines
    LOOP AT TAB.             
      IF TAB-FLAG IS INITIAL.
        TAB-FLAG = 'X'.      
      ENDIF.                 
      MODIFY TAB.            
    ENDLOOP.                 
    TAB-FLAG = 'X'.                  
    MODIFY TAB TRANSPORTING FLAG     
               WHERE FLAG IS INITIAL.
    Deleting a sequence of lines
    DO 101 TIMES.               
      DELETE TAB_DEST INDEX 450.
    ENDDO.                      
    DELETE TAB_DEST FROM 450 TO 550.
    Linear search vs. binary
    READ TABLE TAB WITH KEY K = 'X'.
    READ TABLE TAB WITH KEY K = 'X' BINARY SEARCH.
    Comparison of internal tables
    DESCRIBE TABLE: TAB1 LINES L1,      
                    TAB2 LINES L2.      
    IF L1 <> L2.                        
      TAB_DIFFERENT = 'X'.              
    ELSE.                               
      TAB_DIFFERENT = SPACE.            
    LOOP
    AT TAB1.                     
        READ TABLE TAB2 INDEX SY-TABIX. 
        IF TAB1 <> TAB2.                
          TAB_DIFFERENT = 'X'. EXIT.    
        ENDIF.                          
      ENDLOOP.                          
    ENDIF.                              
    IF TAB_DIFFERENT = SPACE.           
    ENDIF.                              
    IF TAB1[] = TAB2[].  
    ENDIF.               
    Modify selected components
    LOOP AT TAB.           
    TAB-DATE = SY-DATUM. 
    MODIFY TAB.          
    ENDLOOP.               
    WA-DATE = SY-DATUM.                    
    LOOP AT TAB.                           
    MODIFY TAB FROM WA TRANSPORTING DATE.
    ENDLOOP.                               
    Appending two internal tables
    LOOP AT TAB_SRC.              
      APPEND TAB_SRC TO TAB_DEST. 
    ENDLOOP
    APPEND LINES OF TAB_SRC TO TAB_DEST.
    Deleting a set of lines
    LOOP AT TAB_DEST WHERE K = KVAL. 
      DELETE TAB_DEST.               
    ENDLOOP
    DELETE TAB_DEST WHERE K = KVAL.
    Tools available in SAP to pin-point a performance problem
    ·                The runtime analysis (SE30)
    ·                SQL Trace (ST05)
    ·                Tips and Tricks tool
    ·                The performance database
    Optimizing the load of the database
    Using table buffering
    Using buffered tables improves the performance considerably. Note that in some cases a statement can not be used with a buffered table, so when using these statements the buffer will be bypassed. These statements are:
    Select DISTINCT
    ORDER BY / GROUP BY / HAVING clause
    Any WHERE clause that contains a sub query or IS NULL expression
    JOIN s
    A SELECT... FOR UPDATE
    If you wan t to explicitly bypass the buffer, use the BYPASS BUFFER addition to the SELECT clause.
    Use the ABAP SORT Clause Instead of ORDER BY
    The ORDER BY clause is executed on the database server while the ABAP SORT statement is executed on the application server. The database server will usually be the bottleneck, so sometimes it is better to move the sort from the database server to the application server.
    If you are not sorting by the primary key ( E.g. using the ORDER BY PRIMARY key statement) but are sorting by another key, it could be better to use the ABAP SORT statement to sort the data in an internal table. Note however that for very large result sets it might not be a feasible solution and you would want to let the database server sort it.
    Avoid the SELECT DISTINCT Statement
    As with the ORDER BY clause it could be better to avoid using SELECT DISTINCT, if some of the fields are not part of an index. Instead use ABAP SORT + DELETE ADJACENT DUPLICATES on an internal table, to delete duplicate rows.
    Thanks & regards
    Sreenivasulu P

  • FOR ALL ENTERIES?

    WHAT IS THE USE OF FOR ALL ENTERIES IN AN INTERNAL TABLE?PLZZ TELL

    Hi,
    FOR ALL ENTRIES works with a database in a quantity-oriented manner. Initially all data is collected in an internal table. Make sure that this table contains at least one entry (query sy-subrc or DESCRIBE), otherwise the subsequent transaction will be carried out without any restrictions).
    SELECT...FOR ALL ENTRIES IN is treated like a SELECT statement with an external OR condition. The system only selects those table entries that meet the logical condition .
    Using FOR ALL ENTRIES is recommended when data is not being read from the database, that is, it is already available in the program, for example, if the user has input the data. Otherwise a join is recommended.
    Here is sample program for FOR ALL  ENTRIES:
    DATA:it_ekko LIKE ekko OCCURS 0 WITH HEADER LINE.
    DATA:it_ekpo LIKE ekpo  OCCURS 0 WITH HEADER LINE.
    START-OF-SELECTION.
      SELECT * FROM ekko INTO TABLE it_ekko UP TO 10 ROWS.
      IF NOT it_ekko[] IS INITIAL.
        SELECT * FROM ekpo INTO TABLE it_ekpo
        FOR ALL ENTRIES IN it_ekko
        WHERE ebeln = it_ekko-ebeln.
      ENDIF.
      LOOP AT it_ekko.
        WRITE:/ it_ekko-ebeln.
        HIDE it_ekko-ebeln.
      ENDLOOP.
    AT LINE-SELECTION.
      LOOP AT it_ekpo WHERE ebeln = it_ekko-ebeln.
        WRITE:/ it_ekpo-ebelp,it_ekpo-ebeln.
      ENDLOOP.
    Regds
    Sivaparvathi
    Please reward points if helpful....

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

  • For all people with video capture problem

    For all people who have trouble with video capture here is the Link

    thnx rus,
    I had no problems with ViVo, but this file is tiny.
    No frills, just what it's meant to do..
     :D  :D  :D
    (will test thorough later on)

  • Just looking for a solution to a performance problem (HP)

    Hi thank you for reading any attempt to help is greatly appreciated.
    First off i am running on a HP P6-2100 8 GB of ram (4 of which are aftermarket) Windows 7 64 bit OS processor is AMD A4-3420 with Radeon HD graphics 2.8 GHz (i appologize if i am missing any important specs this is my first post) im also running an aftermarket Nvidia GeForce GTX 550 Ti graphics card. All drivers are up to date.
    Now here is my issue. I feel that my computer is not amazing but it is pretty decent *atleast thats how i feel idk though* but i game a lot (mainly world of warcraft) im trying to make it so that i can run the game on higher graphics. when i first got my comp and card and all that good stuff i could run on max graphics and still be above 60 fps in game. Now its no where near able to do that. Im trying to find some way to bring life back into my computer. i have defragged and cleaned up my registry as well as repaired it multiple times i run anti malware programs at least once a week just to keep safe but if you guys have any ideas at all on what i could do to make my gaming experience better i would be all ears to hear them =D 
    Thanks so much,
    Gnome

    Glad you referenced some specs. The problem is the A4.    Here are some reference comparisons for world of warcraft.
    Battlenet    CPUBOSS    and my choice: Game-debate.   On Game-debate,  near the middle of page you'll find the "Can I Run It" settings.   Just plug-in your system (answer the prompts), and behold the rating.
    I am a volunteer. I am not an HP employee.
    To say THANK YOU, press the "thumbs up symbol" to render a KUDO. Please click Accept as Solution, if your problem is solved. You can render both Solution and KUDO.
    The Law of Effect states that positive reinforcement increases the probability of a behavior being repeated. (B.F.Skinner). You toss me KUDO and/or Solution, and I perform better.
    (2) HP DV7t i7 3160QM 2.3Ghz 8GB
    HP m9200t E8400,Win7 Pro 32 bit. 4GB RAM, ASUS 550Ti 2GB, Rosewill 630W. 1T HD SATA 3Gb/s
    Custom Asus P8P67, I7-2600k, 16GB RAM, WIN7 Pro 64bit, EVGA GTX660 2GB, 750W OCZ, 1T HD SATA 6Gb/s
    Custom Asus P8Z77, I7-3770k, 16GB RAM, WIN7 Pro 64bit, EVGA GTX670 2GB, 750W OCZ, 1T HD SATA 6Gb/s
    Both Customs use Rosewill Blackhawk case.
    Printer -- HP OfficeJet Pro 8600 Plus

  • Text Varible for user enter date range

    Hi,
    I need code for text variable,
    the user enters the date range in user entry varible screen
    ex : production for the date range of xxxxx(xxxx= text variable)
    user enters the date range 25-05-2010 -  31-05-2010
    The query description name should be 
    production for the date range of    25-05-2010 -  31-05-2010
    for that  i need code i _step 2  code
    User eners the date range in varaible screen as per that report header has to come
    Please provide the valuble code.
    Thanks & Regards,
    Sathish

    Use Replacement Path Approach instead of Customer Exit.
    Create two Text variables TVAR1 and TVAR2 of type replacement path. Replace them with the Date Characteristic that you are using on which variable is created for user to enter the date range. 
    While creating Text variables, for TVAR1 select From Value and  TVAR2 select To Value.
    Now make the Query description as   Production for the date range of &TVAR1& - &TVAR2&

  • LX25 displays wrong data for the entered date range

    System says "Inventory not executed" status for the bins even if Inventory is executed for the bins in the date range provided in the selection screen.
    For e.g.
    I execute report for Warehouse XYZ. I specify date range as 01.04.2014 to 31.03.2015.
    I get some bins in the status "No Inventory executed".I presume that Inventory is not executed for these bins within this period.
    But when I go to each bin in the status "No Inventory executed" I find that The bins are counted on the dates 24.09.2014 and then on 05.04.2015.
    Then I changed the date in the selection screen to 01.04.2014 to 05.04.2015.
    Those bins which were earlier in the status of "No inventory status executed" are now not present in this status.
    Does this mean that LX25 report is based on the Last counted date? Or the report is not displayed correctly for the date range provided?
    I want to know the criteria based on which the LX25 report works.
    Thanks In Advance.

    Hi Jurgen,
    Below information I found from the LX25 report info in SAP.
    Inventory status
    Description
    This report provides information on the stock in the storagae bins and presents this on the screen.  You can limit your selection by warehouse number, storage type and storage bin, or choose the following criteria:
    Total number of bins
    Number of inventoried bins in the selection period
    Bins with active inventory
    Bins with planned inventory
    Bins without executed inventory
    From this list, you can obtain a plan of the individual storage bins with further detail information within a storage type, by clicking on the relevant line total.
    It clearly shows that the report should be able to show the number of inventoried bins in the selection period, which it doesn't. Does it mean that system is not working as expected?
    Regards
    Soumya

  • For all of those with DM problems

    I have read quite a few of threads where people describe problems they are having...I know it can be frustrating.  So let me make some general comments:
    1. RIM is not involved with this site as far as support goes (TMK), just a bunch of users
    2. Mac users are used to things going fairly smoothly with new software installation...
    3. RIM is a direct competitor of Mac (iPhone...LOL)
    4. Diagnosing a software issue can be difficult (especially when no information is supplied regarding Mac system, Mac OS, Device, Device OS, and what other software did you or do you have installed)...
    5.  My first recommendation is to reinstall the DM software following this thread:
    http://supportforums.blackberry.com/t5/BlackBerry-for-Mac/Proper-DM-Install/td-p/381491
    6. The thread that is a sticky at the top by FozyBear is also great:
    http://supportforums.blackberry.com/t5/BlackBerry-for-Mac/Mac-version-of-BlackBerry-Desktop-Manager-...
    7. Do not expect perfect one-to-one sync of contacts, calendar events and notes.  The field maps are different...remember they are competing software platforms.  You may have to "clean up" either your device or iCal/Address Book BEFORE you sync...and always archive.
    8. If it fails the first thing to do is delete the blackberrydesktop folder from user/username/library/application support restart, repair permissions, clear cache and try again.
    4.6.1.305 hybrid
    Mac Pro 2X2.8 Quad SL

    HI Jeff,
    Try posting in the Developer Forum here. http://discussions.apple.com/forum.jspa?forumID=727
    Carolyn

  • For all entries

    I was under the impression that, while getting data from database table 'for all entries' always imporves performance. Since we are not getting whole database table data. I was doing a select statement and I have used for all entries. I have only 20,000 records in the internal table. While selecting data from database table, it took more than one hour and timed out.
    Latter, I hard coded some values and query worked and it just took few minutes.
    So, do we need to avoid for all entries? What the best practice?
    For more details Please check the code:
    Source package has only 20,000 records and while getting data it timed out. So I commented for all entries and hardcoded the values. This time it took only few minutes. Can any one suggest the best practice for handling such things?
        IF SOURCE_PACKAGE[] IS NOT INITIAL.
          SELECT
            CALMONTH
            CALYEAR
            COMPANY
            /BIC/XPROF_CTR
            PCOMPANY
            /BIC/ZPRODASGN
            /BIC/ZSLSRPTCD
            CURKEY_TC
            UNIT
            GL_ACCOUNT
            MATERIAL
            FUNC_AREA
            COSTCENTER
            WBS_ELEMT
            CURKEY_LC
            /BIC/ZTEMPKEY
            QUANTITY
            /BIC/ZAMT_REP
            /BIC/ZSALETYP
          FROM
          /BIC/AZGMROA1400
          INTO TABLE IT_SOURCE_TMP
         FOR ALL ENTRIES IN SOURCE_PACKAGE
          WHERE
                CALMONTH       BETWEEN CMONTH1 AND CMONTH2 AND
                CALYEAR        = CURR_YEAR AND
               COMPANY        = SOURCE_PACKAGE-COMPANY AND
               /BIC/XPROF_CTR = SOURCE_PACKAGE-/BIC/XPROF_CTR AND
               PCOMPANY       = SOURCE_PACKAGE-PCOMPANY AND
               /BIC/ZPRODASGN = SOURCE_PACKAGE-/BIC/ZPRODASGN AND
               /BIC/ZSLSRPTCD = SOURCE_PACKAGE-/BIC/ZSLSRPTCD AND
               CURKEY_TC      = SOURCE_PACKAGE-CURKEY_TC AND
               UNIT           = SOURCE_PACKAGE-UNIT AND
               GL_ACCOUNT     = SOURCE_PACKAGE-GL_ACCOUNT AND
                MATERIAL       = SOURCE_PACKAGE-MATERIAL AND
                /BIC/ZSALETYP  in ('TS', 'CG', 'IS', 'IC',
                                   'TO', 'FG', 'OD', 'SS',
                                   'RD', 'I3', 'D1', 'D2',
                                   'D3', 'MS', 'PF', 'RA') .
               FUNC_AREA      = SOURCE_PACKAGE-FUNC_AREA AND
               COSTCENTER     = SOURCE_PACKAGE-COSTCENTER AND
               WBS_ELEMT      = SOURCE_PACKAGE-WBS_ELEMT AND
               CURKEY_LC      = SOURCE_PACKAGE-CURKEY_LC and
               /BIC/ZACCOUNT       = SOURCE_PACKAGE-/BIC/ZACCOUNT .
        ENDIF.

    Hi,
    if you have a statement like
    SELECT ... FOR ALL ENTRIES IN FAE_itab WHERE f = FAE_itab-f.
    SAP sends it to the database depending how the parameter rsdb/prefer_union_all is set:
    rsdb/prefer_union_all = 0 =>
    SELECT ... WHERE f = FAE_itab[1]-f
              OR    f = FAE_itab[2]-f
              OR    f = FAE_itab[N]-f
    You have some small influence of the number of generated statements in the case of  OR'ed  taht an IN list should be used  by
    rsdb/prefer_in_itab_opt parameter:
    SELECT ... WHERE f IN (itab[1]-f, itab[2]-f, ..., itab[N]-f)
    rsdb/prefer_union_all = 1 =>
    SELECT ... WHERE f = FAE_itab[1]-f
    UNION ALL SELECT ... WHERE f = FAE_itab[2]-f
    UNION ALL SELECT ... WHERE f = FAE_itab[N]-f
    see: Note 48230 - Parameters for the SELECT ... FOR ALL ENTRIES statement
    As you can see that the last setting generates several statements and combine them with a UNION ALL,
    the first setting generates a statement with OR's (or uses IN list) for the entries in FAE_itab.
    I give you a little example here (my parameters are set in a way that the OR's are translated to IN lists; i traced the execution in  ST05)
    Select myid into table t_tabcount from mydbtable
      for all entries in t_table    " 484 entries
        where myid = t_table-myid
        and myid = 72.
    ST05 trace:
    |Transaction SEU_INT|Work process no 0|Proc.type  DIA|Client  200|User     |
    |Duration |Obj. name |Op.    |Recs.|RC    |Statement                                                                                |
    |      640|mydbtable |PREPARE|     |     0|SELECT WHERE "myid" IN ( :A0 , :A1 , :A2 , :A3 , :A4 ) AND "myid" = :A5                                                                                |
    |        2|mydbtable |OPEN   |     |     0|SELECT WHERE "myid" IN ( 1 , 2 , 3 , 4 , 5 ) AND "myid" = 72                                                                                |
    |    2.536|mydbtable |FETCH  |    0|  1403|                                                                                |
    |        3|mydbtable |REOPEN |     |     0|SELECT WHERE "myid" IN ( 6 , 7 , 8 , 9 , 10 ) AND "myid" = 72                                                                                |
    |      118|mydbtable |FETCH  |    0|  1403|                                                                                |
    |        2|mydbtable |REOPEN |     |     0|SELECT WHERE "myid" IN ( 11 , 12 , 13 , 14 , 15 ) AND "myid" = 72                                                                                |
    |        3|mydbtable |REOPEN |     |     0|SELECT WHERE "myid" IN ( 475 , 476 , 477 , 478 , 479 ) AND "myid" = 72                                                                                |
    |       94|mydbtable |FETCH  |    0|  1403|                                                                                |
    |        2|mydbtable |REOPEN |     |     0|SELECT WHERE "myid" IN ( 480 , 481 , 482 , 483 , 484 ) AND "myid" = 72                                                                                |
    You see the IN list contained 5 entries each  , wich made up about 97 statements for all 484 entries.
    From database point of view these settings kill performance when you have a lot of entries and/or
    a lot of columns in your FAE_itab.
    Said that, FAE i.e. can never be a replacement for joining big tables (think of having a table with thousands of records in a FAE table like you had)
    If you say now that you completly threw away the FAE table of 20.000 entries it is no wonder
    that it performs better. 20.000 records is not a small number if you create a lot of UNION's or OR's / IN lists  that way!
    Your original statement is a good example for the abuse of a FAE. In the SAP Notes this is the core problem with FAE besides empty FAE tables.
    It's safe to use a FAE_itab table if the expected entries count is small (i.e. << 100).
    What you have to decide is if it's more advantagous to
    retrieve the FAE_tabs data once and executing other statements with the SAME FAE table in the same program to reuse it
    or having additional roundtrips to the database if you don't use FAE tables at all
    Bye
    yk

  • Performance problem with query on bkpf table

    hi good morning all ,
    i ahave a performance problem with a below query on bkpf table .
    SELECT bukrs
               belnr
               gjahr
          FROM bkpf
          INTO TABLE ist_bkpf_temp 
         WHERE budat IN s_budat.
    is ther any possibility to improve the performanece by using index .
    plz help me ,
    thanks in advance ,
    regards ,
    srinivas

    hi,
    if u can add bukrs as input field or if u have bukrs as part of any other internal table to filter out the data u can use:
    for ex:
    SELECT bukrs
    belnr
    gjahr
    FROM bkpf
    INTO TABLE ist_bkpf_temp
    WHERE budat IN s_budat
        and    bukrs in s_bukrs.
    or
    SELECT bukrs
    belnr
    gjahr
    FROM bkpf
    INTO TABLE ist_bkpf_temp
    for all entries in itab
    WHERE budat IN s_budat
        and bukrs = itab-bukrs.
    Just see , if it is possible to do any one of the above?? It has to be verified with ur requirement.

  • A017 performance Problem

    Hi all
          I am facing performance problem, While selecting field 'DATAB' ( Validity start date of the condition record ) from Pooled table 'A017',I am getting timed out error ( slong ).IS there any efficient way to retrieve data.
    Regards
    Sreenivasa Reddy

    Hi,
         follow below condition to improve performance
    1) Remove * from select
    2) Select field in sequence as defined in database
    3) Avoid unnecessary selects
    i.e check for internal table not initial
    4) Use all entries and sort table by key fields
    5) Remove selects ferom loop and use binary search
    6) Try to use secondary index when you don't have
    full key.
    7) Modify internal table use transporting option
    8) Avoid nested loop . Use read table and loop at itab
    from sy-tabix statement.
    9) free intrenal table memory wnen table is not
    required for further processing.
    10)
    Follow below logic.
    FORM SUB_SELECTION_AUFKTAB.
    if not it_plant[] is initial.
    it_plant1[] = it_plant[].
    sort it_plant1 by werks.
    delete adjacent duplicates from it_plant1 comparing werks
    SELECT AUFNR KTEXT USER4 OBJNR INTO CORRESPONDING FIELDS OF TABLE
    I_AUFKTAB
    FROM AUFK
    FOR ALL ENTRIES IN it_plant1
    WHERE AUFNR IN S_AUFNR AND
    KTEXT IN S_KTEXT AND
    WERKS IN S_WERKS AND
    AUART IN S_AUART AND
    USER4 IN S_USER4 AND
    werks eq it_plant1-werks.
    free it_plant1.
    Endif.
    ENDFORM. "SUB_SELECTION_AUFKTAB
    Regards
    Amole

  • Oracle Performance problem in Tru64 Unix

    Hello All,
    I am having performance problem in Tru6u Unix. Details are mentioned below :
    OS: Tru64 Unix
    Oracle Version : 8.1.7.4.0
    Forms : 6.0
    Mode: Oracle Parallel Server
    When, developers are trying to save some data using forms, it's taking too much time.
    Any hint/idea, how to start tracking the things, will be highly appreciated.
    Regards,
    Rajeev Tomar

    Check what are the session waits from v$session_wait and try to tune them.
    If possible, get the code and tune the sqls.
    Without knowing the application behaviour and other related stuff, no one can simple adice on performance problems.
    Jaffar

  • "For All Entries in ITAB" -error

    Hello!
                       I am new to this ABAP. I getting one error in Select query "For All Entries" keyword. My problem is,
            Iam taking vbeln field  from the table LIPS and stored in internal table it_lips. and then based on this vbeln i am taking the material document no. field mblnr from MKPF table. The Common field present in this table is vbeln in LIPS and xblnr in MKPF.
    my select query is,
                                  select xblnr mblnr
            into corresponding fields of table it_mkpf
            from mkpf
            for all entries in it_lips
            where xblnr = it_lips-vbeln
            and blart = 'WL'.

    Hi,
    Use the below logic:
    TYPES: BEGIN OF ty_mkpf,
            mblnr TYPE mblnr,
            xblnr TYPE xblnr1,
           END OF ty_mkpf.
    TYPES: BEGIN OF ty_lips,
            vbeln TYPE vbeln_vl,
            vbeln1 TYPE xblnr1,
           END OF ty_lips.
    DATA: git_mkpf TYPE STANDARD TABLE OF ty_mkpf,
                git_lips TYPE STANDARD TABLE OF ty_lips.
    DATA: gwa_lips TYPE ty_lips.
    SELECT vbeln FROM lips INTO TABLE git_lips
    UP TO 5 ROWS.
    LOOP AT git_lips INTO gwa_lips.
      gwa_lips-vbeln1 = gwa_lips-vbeln.
      MODIFY git_lips FROM gwa_lips.
    ENDLOOP.
    SELECT mblnr xblnr
    INTO TABLE git_mkpf
    FROM mkpf
    FOR ALL ENTRIES IN git_lips
    WHERE xblnr = git_lips-vbeln1
    AND blart = 'WL'.

  • Make this query into for all entries

    Hello Experts,
    please change this query into for all entries to increase performance
    loop at itab1.
        SELECT  single b~vtext INTO itab2
         FROM vbkd AS a
            INNER JOIN tvkggt AS b
            ON akdkg1 = bkdkgr
         WHERE a~vbeln EQ itab1-vbeln_vauf
         AND a~posnr EQ itab1-posnr_vauf.
    endloop.
    Thank you so much for all the replies.

    as I write again and again, then performance is mainly increased but correct index usage
    SELECT single b~vtext
    INTO itab2
    FROM vbkd AS a
    INNER JOIN tvkggt AS b
    ON   ..... spras ???
           bkdkgr  = akdkg1 
    WHERE a~vbeln EQ itab1-vbeln_vauf
    AND      a~posnr EQ itab1-posnr_vauf.
    You access vbkd with the primary key vbeln and posnr
    and then you switch to tvkggt where you need spras and kdgr for the primary key
    With spras you statement is incorrect you get one text it is unclear in which language,
    it might be that there is onyl one, but still you *** it to the statement to use the index.
    spras = sy-langu might be o.k.
    I.e.
    IF NOT ( itab1 is initial ).
       SELECT single b~vtext
           INTO itab2 
           FROM vbkd AS a
           INNER JOIN tvkggt AS b
           ON   b~spras = sy_langu
                  b~kdkgr  = a~kdkg1
           FOR ALL ENTRIES in itab1  
           WHERE a~vbeln EQ itab1-vbeln_vauf
           AND      a~posnr EQ itab1-posnr_vauf.
    ENDIF.
    Siegfried

Maybe you are looking for

  • Generating a new table based on user choices - Code Problems

    A while ago someone posted on one of the Adobe forums the following code (sorry I do not remember the name / link). This code is meant to generate a second table (an Object list in this case) according to the user's choices at another table (in this

  • MIDI, Gargeband, Camera connection kit...

    Current setup: I have a Kawai Digital Piano, with both a plain double MIDI connector, and a USB connector (also for MIDI). I use a normal USB <> USB cable purchased from BB to connect the piano to my MBP, where I use GarageBand to record and edit mus

  • Best Mobile Final Cut Pro Setup?

    I've been working on a DV project at home and need to continue editing it while I'm on a business trip for 4 weeks. All I'll be doing is sending quicktimes to my client for review. What's the best plan for editing in a hotel room? I have a Macbook Pr

  • Adding Visual custom component in spark DataGrid

    I am working with flex 4.5. I want to create Gauge component Datagrid. I am using open source com.betterthantomorrow.components. I have created custom components like this     <?xml version="1.0" encoding="utf-8"?>     <s:BorderContainer xmlns:fx="ht

  • Order levels in InventoryManager

    Hi, wat are the different order levels in Inventory Manager in ATG Thanks in advance