Data fetch from table GLPCA taking long .

Hi Friends,
I am fetching five fields from GLPCA table and i have RACCT and RPRCTR ( account Number and profit Centre res ) in the where condition. neither of these field is the primary key of the table GLPCA. I have around 161096,482 entries in the GLPCA. It takes around 20 min to fetch the data. can you guys think of some method so that it works faster.

Hi Vidya,
The time utilization is due to the way data base is been accessed. Just think that you are selecting same data in SE16 with 200 hits. See how that behaves. If you find its Ok(i.e. around 1/2 mins) go for open cursor logic. Check this syntax and change the code accordigly and try:
OPEN CURSOR w_cur1 FOR
       SELECT  ktabg vkorg ktaar ktaer kunnr
               vtweg spart
               FROM vbka
               WHERE ktabg IN so_ktabg AND
                     vkorg IN so_vkorg AND
                     kunnr IN so_kunnr AND
                     ktaar IN so_ktaar AND
                     ktaer IN so_ktaer.
    DO.
      FETCH NEXT CURSOR w_cur1 INTO CORRESPONDING
            FIELDS OF TABLE it_vbka2 PACKAGE SIZE 200.
      IF sy-subrc NE 0.
        CLOSE CURSOR w_cur1.
        EXIT.
      ENDIF.
   ENDDO.
  It behaves just like Select ... Endselect. The most important thing here is the Pakage size which you have to decide based on the SE16 results. Also please mind that if the Package size is less, number of times it hits the DB is high, reducing the efficiency thereby.
Regards & Thanks,
Anand

Similar Messages

  • Data fetch from table without Refresh and without using tab key.

    hi Friends,
    I have a problem i want to extract data from table without Refresh into text field without using Tab key. when i'll enter any value in a text field then corressponding value should come in to corressponding textfield without using Tab Key.
    eg. when i enter emp_id 101 in a text field then the first_name and last_name ,adress should come in to corressponding text fields without refresh and without using Tab key.
    How Can I do this.
    Thanks
    Manoj

    Hi Manoj,
    I assume that this is similar to: Data fetch without Refresh rather than Re: Value of one textfield should come into another textfield Without Using TAB ?
    If so, the only change you need to make on the first one is to use "onkeyup" instead of "onchange" in the item's "HTML Form Element Attributes" setting.
    Note, however, that the user must move away from the item at some point (for example, to click a button), so the onchange will be triggered anyway.
    Andy

  • Data fetch from table

    i have to select data from a database table into internal table but i want that it shud be selected as it is means i have a char 30 field which may have CAPS and small values in table but in the internal table it comes as all CAPS but it shud come as it is e.g "Data" shud come as "Data" in internal table but it comes as "DATA".

    Just check the Domain of the concerned field. There will be a characteristic check box called "lower case" in the Definition tab of your domain. See if that is Flagged. If that is flagged, then the stored record will be case sensitive. In best practice, you should not have that flagged, So that the records will not be case sensitive and you will not have to face a similar situation.
    Hope this helps.

  • Date fetching from table

    I have a customized table which contains monthwise details.say 12 entries for an year.I want to fetch the previous 5 month entries from the table wrto sy-datum.
    ie) if the month is 08 , then i want the records frm 03-07.
    ie) if the month is 02, i want the records 01,12,11,10,09.
    What logic to use?
    Rgds,
    SAPUSER100

    Hello,
    You have to also consider the year in your selection. so, change in the logic ...
    data: begin of r_mon occurs 0,
    mon(2),
    year(4),
    end of r_mon.
    l_month = sy_datum+4(2) - 1.
    l_year = sy_datum+0(4).
    do 5 times.
    r_mon-mon = l_month.
    r_mon-year = l_year.
    append r_mon.
    clear  r_mon
    l_mont = l_month - 1.
    if l_month = 0 .
    l_month = 12.
    l_year = sy_datum+0(4) - 1.
    endif.
    enddo.
    Once you got filled your range of the Month,
    I would advice like,
    loop at r_mon.
    select * from ztab
    appending table itab
    where mon = r_mon-mon
    and   year = r_mon-year.
    endloop.
    Regards,
    Naimesh

  • Data fetching from BSEG table

    Hi,
    I have used smartforms for generating suppler payment statement for financial department. more time duration is taken by the program when it is generating.
    I think this problem comes while data fetching from BSEG table. because, it has more records for one vendor ID.
    I want reduce this time duration.
    Please guide me.

    Have you tried this selection in se16? I'm quite sure that It will take
    a long time.
    The problem has been explained in this group before and I think you
    should search for bseg in the answers given.
    As a hint: It has to do with the selection universe. You are restricting
    only bukrs from the primary key (all the other restrictions in your
    where clause are filters that are applied on SAP's side (not on the
    database side)). The problem is that bseg isn't stored as separated
    fields in the RDBMS, but as a table with the primary key and a stream of
    bits in a raw field.
    You should review and change the logic you're using before reading bseg.
    It's the only way you'll improve the performance of this select. (for
    example, you could use one or more secondary index tables - bi or ba
    to retrieve belnr and access bseg with a better where clause).

  • CDHDR table query taking long time

    Hi all,
    Select query from CDHDR table is taking long time,in where condition i am giving OBJECTCLASS = 'MAT_FULL' udate = sy-datum and langu = 'EN'.
    any suggestion to improve the performance.i want to select all the article which got changed on current date
    regards
    shibu

    This will always be slow for large data volumes, since CDHDR is designed for quick access by object ID (in this case material number), not by date.
    I'm afraid you would need to introduce a secondary index on OBJECTCLAS and UDATE, if that query is crucial enough to warrant the additional disk space and processing time taken by the new index.
    Greetings
    Thomas

  • Getting data from table BSEG taking too long ... any solutions.

    Hello people I am currently trying to get data from table BSEG for one particular G/L Account Number With restrictions using For All Entries.
    The problem is that even with such tight restrictions its causing my report program to run way too slow. I put an option where you dont have to access table bseg. And it runs just fine. (all of this is done during PRD Server).
    My question is
    1.) How come BSEG seems to make the report slow, even though I put some tight restrictions. <b>Im using For All Entries where Zuonr eq i_tab-zuonr</b>it seems to work fine in DEV and <b>hkont EQ '0020103101'</b>(Customer Deposits).
    2.) Is there a way for me to do the same thing as what I mentioned in #1 but only much faster.
    Thanks guys and take care

    Hi
    It should be better you don't read BSEG table if you haven't the keys BUKRS and BELNR, because the reading could take many times if there are many hits.
    If you want to find out the records of G/L Account it's better read the index table BSIS (for open items) and BSAS (for cleared items), here the field HKONT is a key (and ZUONR too). So you can improve the performance:
    DATA: T_ITEMS LIKE STANDARD TABLE OF BSIS.
    SELECT * FROM BSAS INTO TABLE T_ITEMS
      FOR ALL ENTRIES I_ITAB WHERE BUKRS = <BUKRS>
                               AND HKONT = '0020103101'
                               AND ZUONR = I_ITAB-ZUONR.
    SELECT * FROM BSIS APPENDING TABLE T_ITEMS
      FOR ALL ENTRIES I_ITAB WHERE BUKRS = <BUKRS>
                               AND HKONT = '0020103101'
                               AND ZUONR = I_ITAB-ZUONR.
    Remember every kind of item has an own index tables:
    - BSIS/BSAS for G/L Account
    - BSIK/BSAK for Vendor
    - BSID/BSAD for Customer
    These table have the same informations you can find out from BSEG and BKPF.
    Max

  • Data fetching from Standard tables or transaction to SAP PI

    Dear Friends !
         Good day ! How are you ? 
         I have one requirement , My client asks me to develop a solution in that I should get the data from standard SAP tables like EKKO, EKPO ( MM related ) etc..  and send it to PI system and then PI system sends it to third party system database system.
    We have current scenario is working fine,  I have abap proxy that I called in various  standard transaction codes ( MIRO, MIGO, etc ) ' Baddis just beforethe commit stament and it passed the data to SAP PI system and it sends to SQL system.
    but my client dont want me to use Baddis. Client wants  like u should read from those EKKO,EKPO tables as soon as you get new entry there and send it to PI system.  I have no clue How can I go further in that. Shall I use events ? but then question is same I need to trgger them somewere?  Is any one have idea  How I can send the data to PI system frm SAP standard tcodes and tables without using Baddis.
    Please reply me. your any help will be appreciated.
    Regards
    Naeem

    The current Approach of your development perfectly good approach,
    it is not possbiel to read data directly from SAP Tables, you have to use IDoc/RFC/Proxy,if you want to avoid BADI's then better to contact ABAP Team, they will help you different approches .
    But you have to use Porxy/IDoc/BAPI for sure.
    Regards,
    Raj

  • Perofrmance issue on data fetch from db table

    Dear Experts,
    I have one requirement which explained below step wise.
    Step - 1 : I have a parameter on selection screen from where i ll get my ebeln value (User Input field) and that ebeln i ll check in ekpo table for validations.
                  If valid i  keep it in a variable gw_ebeln.
    Step - 2 : Need to fetch lifnr fron ekko based on gw_ebeln value.
    Step - 3 : Need to fetch adrnr from lfa1 based on lifnr (Previously fetched from ekko table in step 2)
    Step - 4 : Need to fetch email field from adr6 table based on adrnr value (Previously fetched from lfa1 table in step 3)
    Step - 5 : Now for these mail id , I need to send mail by given fm.
    My question is : I can create structure for step 2 , step 3, step 4 and by using " for all entries " in select statement i ll fetch my mail id in step 4.
    So instead of creating structure and then use for all entries , I can fetch by using "select single" statement for step 2 , step3 step 4.bcz i am fetching only one field from all 3 table.
    So which one is better performance wise and why ?
    I need more and clear clarifications on these difference.
    Please provide me suggestions.
    Thanks & Regards,
    Ajit Sarangi

    Hi Ajit,
    We are referring item table EKPO. Multiple entries are possible.
    To append the values in final internal table, we are going to process the LOOP. Inside loop, we should not use the Select statement, that decreases the performance. Database Interaction process should not done inside Loop...Endloop.
    That's why we are creating the Internal table for processing the values. Since we need limited number of fields in the particular table, we are creating our own structure in the program.
    For this case, For all entries will give better performance with compare to Select Single.
    Regards
    Rajkumar Narsimman

  • Gather table stats taking longer for Large tables

    Version : 11.2
    I've noticed that gathers stats (using dbms_stats.gather_table_stats) is taking longer for large tables.
    Since row count needs to be calculated, a big table's stats collection would be understandably slightly longer (Running SELECT COUNT(*) internally).
    But for a non-partitioned table with 3 million rows, it took 12 minutes to collect the stats ? Apart from row count and index info what other information is gathered for gather table stats ?
    Does Table size actually matter for stats collection ?

    Max wrote:
    Version : 11.2
    I've noticed that gathers stats (using dbms_stats.gather_table_stats) is taking longer for large tables.
    Since row count needs to be calculated, a big table's stats collection would be understandably slightly longer (Running SELECT COUNT(*) internally).
    But for a non-partitioned table with 3 million rows, it took 12 minutes to collect the stats ? Apart from row count and index info what other information is gathered for gather table stats ?
    09:40:05 SQL> desc user_tables
    Name                            Null?    Type
    TABLE_NAME                       NOT NULL VARCHAR2(30)
    TABLESPACE_NAME                        VARCHAR2(30)
    CLUSTER_NAME                             VARCHAR2(30)
    IOT_NAME                             VARCHAR2(30)
    STATUS                              VARCHAR2(8)
    PCT_FREE                             NUMBER
    PCT_USED                             NUMBER
    INI_TRANS                             NUMBER
    MAX_TRANS                             NUMBER
    INITIAL_EXTENT                         NUMBER
    NEXT_EXTENT                             NUMBER
    MIN_EXTENTS                             NUMBER
    MAX_EXTENTS                             NUMBER
    PCT_INCREASE                             NUMBER
    FREELISTS                             NUMBER
    FREELIST_GROUPS                        NUMBER
    LOGGING                             VARCHAR2(3)
    BACKED_UP                             VARCHAR2(1)
    NUM_ROWS                             NUMBER
    BLOCKS                              NUMBER
    EMPTY_BLOCKS                             NUMBER
    AVG_SPACE                             NUMBER
    CHAIN_CNT                             NUMBER
    AVG_ROW_LEN                             NUMBER
    AVG_SPACE_FREELIST_BLOCKS                   NUMBER
    NUM_FREELIST_BLOCKS                        NUMBER
    DEGREE                              VARCHAR2(10)
    INSTANCES                             VARCHAR2(10)
    CACHE                                  VARCHAR2(5)
    TABLE_LOCK                             VARCHAR2(8)
    SAMPLE_SIZE                             NUMBER
    LAST_ANALYZED                             DATE
    PARTITIONED                             VARCHAR2(3)
    IOT_TYPE                             VARCHAR2(12)
    TEMPORARY                             VARCHAR2(1)
    SECONDARY                             VARCHAR2(1)
    NESTED                              VARCHAR2(3)
    BUFFER_POOL                             VARCHAR2(7)
    FLASH_CACHE                             VARCHAR2(7)
    CELL_FLASH_CACHE                        VARCHAR2(7)
    ROW_MOVEMENT                             VARCHAR2(8)
    GLOBAL_STATS                             VARCHAR2(3)
    USER_STATS                             VARCHAR2(3)
    DURATION                             VARCHAR2(15)
    SKIP_CORRUPT                             VARCHAR2(8)
    MONITORING                             VARCHAR2(3)
    CLUSTER_OWNER                             VARCHAR2(30)
    DEPENDENCIES                             VARCHAR2(8)
    COMPRESSION                             VARCHAR2(8)
    COMPRESS_FOR                             VARCHAR2(12)
    DROPPED                             VARCHAR2(3)
    READ_ONLY                             VARCHAR2(3)
    SEGMENT_CREATED                        VARCHAR2(3)
    RESULT_CACHE                             VARCHAR2(7)
    09:40:10 SQL> >
    Does Table size actually matter for stats collection ?yes
    Handle:     Max
    Status Level:     Newbie
    Registered:     Nov 10, 2008
    Total Posts:     155
    Total Questions:     80 (49 unresolved)
    why so many unanswered questions?

  • Delete from VAPMA is taking long time

    Hello Team
    Steps followed to create order in ECC
    1) Create ZORD for customer 3022243 in VA01
    2) Add material 2001436 quantity 18, press enter
    3) Add material 2001436 quantity 1, press enter. Change item category to ZANP. Add Promo ID AS10061 in Additional Data B screen of item
    4) Add material 2001157 quantity 1, press enter. Change item category to ZANP. Add Promo ID AS10061 in Additional Data B screen of item
    5) Add material 5001044 quantity 1, press enter. Reject item "Y6 Promo not available"
    6) Set delivery block on the order - "Y6 Open Order Block"
    7) Save
    8) Change Order, remove delivery block, save.
    At this point the system calls function  RV_SALES_DOCUMENT_UPDATE in update task. This subsequently calls form INDEX_VAPMA_SCHREIBEN in program SAPLV05I  which deletes entries from table VAPMA. It is this form that is taking time to execute. In SM50 this can be seen quite clearly.
    SM50 shows as below
    27 UPD 19707 Running  Yes    346 SAPLV05I 020 DXEVANS2 Delete VAPMA
       No Ty. PID      Status  Reasn Start Err Sem CPU      Time   Cl. User                                          
       27 UPD 19707    Running       Yes           0:23     471    020 DXEVANS2                                      
       Report / Spool action                                                                               
    SAPLV05I                                                                               
    Main Program                                                                               
    RSM13000                                                                               
    Delete                    VAPMA                                                
    So i request you to please check and suggest any steps which i need to follow from my side.
    Reg
    Rj

    Hi Rj,
    Did you check OSS?  When you do a search on VAPMA quite a few notes dealing with performance related problems show up.
    Kind regards,
    Robert

  • Table valueset taking long time to open the LOV

    Hi,
    We added a table valueset to a concurrent program. The table vaueset showsTransaction number from ra_interface_lines_all table. It is having long list. So we added the partial string entering message before open a long list.But still it is taking long time.
    Please any help on this highly appreciated.
    Thanks,
    Samba

    Hi
    Try to modify the query or creating an index will speed up the process.
    Thanks & regards
    Rajan

  • Data fetched from buffer or database

    Hi,
    How to check tin the select query the data is being fetched from buffer or database .Is there any method to trace that  or it is just the setting we are  doing while creating a table..
    Pls suggest

    Hi,
    >
    arun purushothaman wrote:
    >Is there any method to trace that  or it is just the setting we are  doing while creating a table..
    > Pls suggest
    sure. ST05.
    SQL Trace shows everything that is going to the database. This means those statements are NOT
    using the buffer. The SQL Trace lines are yellow.
    Buffer Trace shows everything that is going to the buffer. This means those statements are NOT
    going to the database. The Buffer Trace lines are blue.
    Kind regards,
    Hermann

  • Data selection from Table

    Hi ,
    My requirement is to have Commercial Documents which are not Accounted. So that I've used the following logic.
      SELECT a~vbeln
                     a~vbtyp
                     a~fkdat
                     a~bukrs
             a~kunrg
             SUM( b~netwr )
           FROM vbrk AS a INNER JOIN vbrp AS b
           ON avbeln EQ bvbeln
           INTO ls_bill WHERE a~vbtyp EQ 'M'          AND
                              a~fkdat IN s_fkdat      AND
                              a~bukrs IN s_bukrs      AND
                              a~kunrg IN s_kunrg
                        GROUP BY a~vbeln
                                 a~vbtyp
                                 a~fkdat
                                 a~bukrs
                                 a~kunrg.
        l_awkey = ls_bill-vbeln.
        SELECT awkey FROM bkpf INTO l_awkey
                     WHERE awtyp EQ 'VBRK'  AND
                           awkey EQ l_awkey AND
                           bukrs EQ ls_bill-bukrs.
        ENDSELECT.
        IF sy-subrc NE 0.
          APPEND ls_bill TO lt_bill.
        ENDIF.
        CLEAR : ls_bill, l_awkey.
      ENDSELECT.
    Is that the above logic for getting data is correct. or  First taking all the entries from VBRK and VBRP table then selecting entries from BKPF and then if any entry of VBRK is not in BKPF then taking that.
    Regards,
    Rajiv.V
    Moderator message - Moved to the correct forum
    Edited by: Rob Burbank on Dec 10, 2009 9:36 AM

    You should have searched SDN for Performance Tuning.
    Solution :
    Please search SDN for Performance Tuning and then try to understand the use of various statements that you have used in terms of performance.

  • Fetching from tables

    a report is being generated in which we put sold to party,delivery date and plant.This gives us some output
    Now we have to add two fields that is loading date and ship to party in the screen and the output has to be same as the previous.can u please guide me as to how can i fetch the data.

    Hi,
    First of all check that two fileds exits same table where you are adding new fields in select stament.
    SELECT Field1 Field2 Newfield1 Newfield2
    FROM Table
    INTO CORRESPONDING FIELDS OF TABLE Internal_Table
    WHERE Conditions (Newfield1).
    Once you added two new fileds in same manar you should update internal table structure also then only that values passes in to that internal table.
    Regads
    Md.MahaboobKhan

Maybe you are looking for