Fast data retreival from Table BSAD

Dear Friends,
I want to retrive data from table BSAD and right now it have more than 1,300,000 records.
for "where condition" i have Customer number, Document number, Document type fixed RV and only
debit side S.
What should i do for fast retreival or any function module . right now data fatching is too slow with simple select.
regards
Malik

Hi Malik,
Pass all the key fields present in the database table, and in the current selection you are using only 2 key fields.  The remaining key fields in this table i.e, BSAD are:
BUKRS-----     BUKRS---     CHAR     4     0--
     Company Code
KUNNR-----     KUNNR---     CHAR     10     0--
     Customer Number 1
UMSKS------     UMSKS-----CHAR     1     0--
     Special G/L Transaction Type
UMSKZ------     UMSKZ-----CHAR     1     0--
     Special G/L Indicator
AUGDT-----AUGDT---DATS8     0--
     Clearing Date
AUGBL------     AUGBL------     CHAR--     10     0--
     Document Number of the Clearing Document
ZUONR-----DZUONR-     CHAR     180--
     Assignment number
GJAHR-----     GJAHR---     NUMC     4     0--
     Fiscal Year
BELNR-----     BELNR_D--     CHAR--10     0--
     Accounting Document Number
BUZEI--     BUZEI     NUMC     3     0--
     Number of Line Item Within Accounting Document
Therefore pass as many key fields as possible to improve the performance of the select query.
Regards,
Md Ziauddin.

Similar Messages

  • Fast data retrieval from large tables

    Hello,
    we have created a table in oracle 10g DB. at an average there are around 20-30 rows inserted onto the table. so in 1 mnth the record count for the table is around 800-900 rows.
    in one year which is becoming to 10,000 rows. so speed up data retreval from this bulk data we need suggestion. various things that come to my mind are -
    Indexing of table/# Index of table/partitioning of table/materialized view etc.
    but not sure what exactly needs to be done here. please suggest on how smooth data retreival can be chaived whatever be the size of the table.
    Thanks,
    Sam

    Here is a simple look of your data progression.
    year        Row
    1           10,000
    5           50,000
    10          1,00,000
    50          5,00,000
    100         10,00,000You need to wait another 100 years to reach a million. And million is not a big number when it comes to Oracle.
    So as others have stated what the objective behind your question?
    basically the choice of Index or Partition mainly depends on how the data is going to be accessed from a table. If I am going to access all the rows of a table every time then there is no use of both the features. I would just prefer a FTS. In that situation i would be looking how to optimize my FTS.
    So you need to set you objective clear before picking up the solution. Just because you have a hammer you cant go around banging the wall ;)

  • Data retreival from FBL5N

    1.Is it possible to retrieve data using Customer Line item Display(FBL5N) from tables KNA1, BKPF, BSEG, etc.
    2.And to convert this data into a flat file or simply send into corresponding fields of Post incoming Payment(F-28) in FI module ?

    The tables are BSAD and BSID. Of course, KNA1 too if you need a customer name or some other master data. Keep in mind though that some fields on FBL5N are calculated and are not directly stored anywhere (document due date is one such example).
    Naturally, you may write a program and do whatever you please with this data.

  • Is select from view faster then select from table..???

    Hello Gurus,
    I want to query some data from two tables, both of table have many columns (attributes) and many rows...
    I use several where clauses to retrieve data from those tables..
    witch one is faster, I create a view or I just "select" from those tables???
    Regards.
    Nia...

    riedelme wrote:
    3360 wrote:
    riedelme wrote:
    Selecting through a view almost never helps performance and frequently hurts.Views do not affect performance.
    Views are simply queries and like queries there are fast and slow ones.I disagree.
    First of all, to use a view you are executing a query to get a result set, then accessing the data from that result set - a built-in extra step to perform to get data.First of all that entire explanation of how views work is not correct. The optimizer will rewrite the query to make the view go away if possible.
    SQL> create or replace view v as select * from dual;
    View created.
    SQL> explain plan for select * from dual where dummy = 'X';
    Explained.
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 272002086
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |     1 |     2 |     2   (0)| 00:00:01 |
    |*  1 |  TABLE ACCESS FULL| DUAL |     1 |     2 |     2   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter("DUMMY"='X')
    13 rows selected.
    SQL> explain plan for select * from v where dummy = 'X';
    Explained.
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 272002086
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |     1 |     2 |     2   (0)| 00:00:01 |
    |*  1 |  TABLE ACCESS FULL| DUAL |     1 |     2 |     2   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter("DUMMY"='X')
    13 rows selected.Exactly the same.
    >
    Second, when accessing the data from the view the result sets don't have indexes for fast lookups and efficient joins on later steps.This is also known as just making stuff up and is not how the database works. care to share any references at all for any of this?
    >
    Third, the systems I've seen that use views extensively - I am looking at one now - tend to perform joins on views using the same tables with the same data over and over. This is a design issue and not specifically a problem with views but they lend themselves to this misuse much too easilyCorrect as I said a view is just a query, and just like queries there are good fast views and bad slow views
    >
    I'll concede that the problem is not specifically with views themselves but as I just said they lend themselves to misuse. Tuning views of views and views joined to views is difficultYes, queries can be misused as can almost all SQL functions and functionality.
    As I said - Views are simply queries and like queries there are fast and slow ones.
    Nothing that you have posted that is accurate changes that.

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

  • Data relocation from table SOFFCONT1

    Hi experts,
    I have to relocate data from table SOFFCONT1 to an external repository with help of report RSIRPIRL...I went through all related Sap notes and it seems pretty straightforward.
    When I run the report RSIRPIRL I see all the fields I have to fill up (I have already created an content repository as well as a catalogue) but my question is how to select some data manually for testing purpose? Is it any way how to see from table SOFFCONT1 just 1 file for example?? I couldn't see that field in the report RSIRPIRL.
    Regards,
    Blaiso

    Applied OSS note 1536325 which will add an extra field to select by date and narrow the number of documents to test

  • Data retrivel from table ausp table

    Helllo Experts,
    I want to retrive data from table ausp based on the data retrived from the VBAK table.
    I have selected data from VBAK and VBAP tabble using code :
    SELECT VKORG VTWEG VBAKSPART VKGRP VKBUR KUNNR KNUMV VBAKVBELN VBAPMATNR VBAPARKTX INTO CORRESPONDING FIELDS OF  TABLE GT_DATA
    FROM VBAK INNER JOIN VBAP ON VBAKVBELN = VBAPVBELN
    WHERE VKORG        IN SVKORG
    AND  VTWEG        IN SVTWEG
    AND  VBAK~SPART   IN SSPART
    AND  VKGRP        IN SVKGRP
    AND  VKBUR        IN SVKBUR
    AND  KUNNR        IN SKUNNR
    AND  MATNR        IN SMATNR.
    SELECT MATNR BREIT ZEINR BRGEW INTO CORRESPONDING FIELDS OF TABLE GT_EANCODE FROM MARA
    FOR ALL ENTRIES IN LT_DATA WHERE MATNR = GT_DATA-MATNR.
    SORT GT_EANCODE BY MATNR.
    ENDIF.
    SELECT MATNR MVGR1 MVGR2 MVGR3 INTO CORRESPONDING FIELDS OF TABLE GT_MVGR FROM MVKE
    FOR ALL ENTRIES IN LT_DATA WHERE MATNR = LT_DATA-MATNR.
    SORT GT_MVGR BY MATNR.
    ENDIF.
    SELECT KNUMV KPOSN KSCHL KWERT INTO CORRESPONDING FIELDS OF TABLE GT_KONV  FROM KONV
    FOR ALL ENTRIES IN LT_DATA WHERE KNUMV = LT_DATA-KNUMV AND KSCHL IN ('ZG02').
    SORT GT_KONV BY KNUMV.
    So based on the material field in the table GT_DATA i have to select data from table ausp. The ausp table also having the field
    material ( but the name of the material field in the ausp table is OBJEK) . Material field in t the VBAP table have data type character and field length 18 and OBJEC field in the ausp table have data type character and lenght 50.
    So if i give select statement for ausp table
    SELECT OBJEK ATINN ATWRT  INTO CORRESPONDING FIELDS OF TABLE GT_AUSP FROM AUSP
    FOR ALL ENTRIES IN GT_DATA WHERE OBJEK = LT_DATA-MATNR AND
              .                        MFID = '01' AND
                                       KLART = '001' AND
                                       ATINN = V_ATINN.
    it is giving  error : when you use addition for all entries in internal table the object and GT_DATA-MATNR must have same data type and same length.
    So if i change the length of the matnr field it will effect for other select statement.
    please let me know hw to over come errors.
    Thakns in advace.
    Best Regards,
    Zubera

    Hi shridarudupi ,
    when you are declaring structure  for GT_DATA,define matnr field of type ausp-objek , so when you will select data from AUSP using for all entries of GT_DATA , there will  not be any type mismatch.
    For Ex.
    TYPES : BEGIN OF t_mara ,
             matnr TYPE ausp-objek,
             ersda TYPE mara-ersda,
            END OF t_mara,
             BEGIN OF t_ausp ,
             objek TYPE ausp-objek,
             atinn  TYPE ausp-atinn,
            END OF t_ausp.
    DATA : i_mara     TYPE STANDARD TABLE OF t_mara,
                 i_ausp     TYPE STANDARD TABLE OF t_ausp,
                wa_mara  LIKE LINE OF i_mara,
                wa_ausp  LIKE LINE OF i_ausp.
    SELECT matnr
                 ersda
                 FROM mara INTO TABLE i_mara
                 WHERE matnr = '4510'.
    IF sy-subrc = 0 .
      SELECT objek
                    atinn
                    FROM ausp
                    INTO TABLE i_ausp
                    FOR ALL ENTRIES IN i_mara
                    WHERE objek = i_mara-matnr.
      IF sy-subrc = 0 .
        WRITE : 'successful'.
      ENDIF.
    ENDIF.
    Hope this helps.
    Edited By Tejaswini Khante

  • 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

  • Data retrieve from tables in two diff schema in same db

    hi,
    i have one db and name is HWRDB, in this i have two schema PRLHEEP and PRLCFFP.
    in PRLHEEP my table is NAMAS, and in PRLCFFP also table's name is NAMAS.
    i want
    if :unit = 'H' then
    -- connect to PRLHEEP
    select data into some items from NAMAS
    eslif :unit = 'C' then
    -- connect to PRLCFFP
    select data into some items from NAMAS
    endif;
    plz help me to connect to schema. *** db is oracle db, 10g version***

    here is my code,
    if :deloan.unit = 'H' then
    ....... select nmodpay,nbnkacc
    .......into modpay, bnkacc
    .......from namas where nstfno = :deloan.stfno;
    .......select some colums
    .......into some items
    .......from pafac
    ....... where pstfno = :deloan.stfno and
    elsif :deloan.unit = 'C' then
    ....... select nmodpay,nbnkacc
    .......into modpay, bnkacc
    ....... from prlcffp.namas where nstfno = :deloan.stfno;
    .......select some colums
    ....... into some items
    ....... from prlcffp.pafac
    .......where pstfno = :deloan.stfno and
    in forms builder, i connect to prlheep
    when i compile i get errors:
    identifier *'PRLCFFP.NAMAS'* must be declared
    identifier *'PRLCFFP.PAFAC'* must be declared

  • Error in getting Long data type from Table

    Hi All,
    I have one table say xx_long. In this table one column is having Long data type.
    Now I want this values will get in to the PL/SQL variable. I taken variable data type as long but it is showing error "ORA-00997: illegal use of LONG datatype".
    Sample code with which I tried:
    declare
    a long;
    begin
    select slno into a from xx_long where slno = 100;
    dbms_output.put_line('Value:'||a);
    end;
    Please help me on this.
    Thanks in advance.
    Regards,
    Hari

    LONG columns cannot appear in certain parts of SQL statements:
    WHERE clauses, GROUP BY clauses, ORDER BY clauses, or CONNECT BY clauses or with the DISTINCT operator in SELECT statements
    The UNIQUE operator of a SELECT statement
    The column list of a CREATE CLUSTER statement
    The CLUSTER clause of a CREATE MATERIALIZED VIEW statement
    SQL functions (such as SUBSTR or INSTR)
    Expressions or conditions
    SELECT lists of queries containing GROUP BY clauses
    SELECT lists of subqueries or queries combined by the UNION, INTERSECT, or MINUS set operators
    SELECT lists of CREATE TABLE ... AS SELECT statements
    SELECT lists in subqueries in INSERT statements

  • Dynamic data select from table is giving dump

    Hello Experts,
       Below statement is giving Dump after it move all the data in my dynamic table.
    When i see in debug. All my recored are avilable in <T_TAB> Table.
    SELECT * FROM (pa_tab) INTO CORRESPONDING FIELDS OF TABLE <T_TAB>.
    > IF SY-SUBRC = 0.
    Information on where terminated
    The termination occurred in the ABAP program "ZFIR_ZTABLE_UPLOAD" in
    "F_DOWNLOAD".
    The main program was "ZFIR_ZTABLE_UPLOAD ".
    The termination occurred in line 403 of the source code of the (Include)
    program "ZFIR_ZTABLE_UPLOAD"
    of the source code of program "ZFIR_ZTABLE_UPLOAD" (when calling the editor
    4030).
    Processing was terminated because the exception "CX_SY_OPEN_SQL_DB" occurred in
    the
    procedure "F_DOWNLOAD" "(FORM)" but was not handled locally, not declared in
    the
    RAISING clause of the procedure.
    The procedure is in the program "ZFIR_ZTABLE_UPLOAD ". Its source code starts
    in line 399
    of the (Include) program "ZFIR_ZTABLE_UPLOAD ".
    please help me.
    Regards,
    Amit
    Message was edited by:
            Amit Gupta

    Hi Amit,
    Check if you are doing the following in your program
    FIELD-SYMBOLS <T_TAB> TYPE STANDARD TABLE.
    DATA: g_tabref type ref to data.   "Reference to your table structure
    CREATE DATA g_tabref type standard table of (pa_tab).
    ASSIGN g_tabref->* to <T_TAB>.
    SELECT * FROM (PA_TAB) INTO TABLE <T_TAB>.
    Hope this solves your problem.
    Let me know if you require any further info.
    Enjoy SAP. Reward points of useful
    Rajasekhar

  • Vendor General data extraction from Table

    Hi,
    I need to extract data maintained in 2 fields from vendor master table. These 2 fields are "Standard Communication method" under "communication" tab and "Comments" at the end of the vendor address data. Could you please tell me the table from which I can extract the data maintained in these two fields in vendor master? These fields are not maintained in LFA1 table.
    Thanks
    Satya

    Hi
    Kindly check these tables
         Vendor
         LFA1               Vendor master
         LFB1               Vendor per company code
         LFB5               Vendor dunning data
         LFM1               Purchasing organization data
         LFM2               Purchasing data
         LFBK               Bank details

  • Date Data difference from table

    DB : 11.1.0.7
    I have one table and it has date column without time information. I would like to retrive data for missing consecutive dates more than 2 days.
    For Eg.
    Select * from xyz
    location date
    1 05/10/2011
    1 04/10/2011
    1 01/10/2011
    1 30/09/2011
    1 27/09/2011
    2 04/10/2011
    2 01/10/2011
    2 30/09/2011
    3 04/10/2011
    3 01/10/2011
    3 30/09/2011
    3 29/09/2011
    3 26/09/2011
    3 25/09/2011
    Looking for output be like below.
    Location Missing Date
    1 04/10/2011
    1 30/09/2011
    2 04/10/2011
    3 04/10/2011
    3 29/09/2011
    Any suggestion ?

    with sample_data as (
                         select 1 location ,to_date('05/10/2011','dd/mm/yyyy') dt from dual union all
                         select 1,to_date('04/10/2011','dd/mm/yyyy') from dual union all
                         select 1,to_date('01/10/2011','dd/mm/yyyy') from dual union all
                         select 1,to_date('30/09/2011','dd/mm/yyyy') from dual union all
                         select 1,to_date('27/09/2011','dd/mm/yyyy') from dual union all
                         select 2,to_date('04/10/2011','dd/mm/yyyy') from dual union all
                         select 2,to_date('01/10/2011','dd/mm/yyyy') from dual union all
                         select 2,to_date('30/09/2011','dd/mm/yyyy') from dual union all
                         select 3,to_date('04/10/2011','dd/mm/yyyy') from dual union all
                         select 3,to_date('01/10/2011','dd/mm/yyyy') from dual union all
                         select 3,to_date('30/09/2011','dd/mm/yyyy') from dual union all
                         select 3,to_date('29/09/2011','dd/mm/yyyy') from dual union all
                         select 3,to_date('26/09/2011','dd/mm/yyyy') from dual union all
                         select 3,to_date('25/09/2011','dd/mm/yyyy') from dual
    select  location,
            dt missing_dt
      from  (
             select  location,
                     dt,
                     dt - lag(dt) over(partition by location order by dt) gap
               from  sample_data
      where gap > 2
      LOCATION MISSING_D
             1 30-SEP-11
             1 04-OCT-11
             2 04-OCT-11
             3 29-SEP-11
             3 04-OCT-11
    SQL> SY.

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

Maybe you are looking for

  • Why can't I copy and paste from google seach history with firefox 4

    When I try and copy and paste from Google drop down search box nothing happens. Only happen with Firefox 4. I tried to roll back to 3.6 but every time i reboot it puts 4 back

  • Adding animation as a background for a website

    I created my website on photoshop and added the animation on photoshop. I saved it as JPEG and opened it on dreamweaver and when I previewed the webpage the animation was not working. I want the background to animate from different pictures instead o

  • IPhone 4S restart itself iOS 5.0.1

    I lost the last 7 photos I shot as well. I was just sitting there and all of a sudden the Apple logo appeared and then after the appropriate time, I was shown the pass lock screen. Scratching head! Phone was in sleep mode. Anyone else seen this? mark

  • Trying to connect modem to router

    Hello.. Please bear with me, I am new at this..OK?  I am trying to hook up my wireless router to my DSL modem. My modem is using a USB connection! How do I hook up my router and/or modem? The power and WLAN lights are on, but not the #1  Model number

  • Information Rights Management

    Dear All , how i do integration with Oracle Imaging and Process Management and Information Rights Management Servers 11g with Oracle Content Management that come with Oracle Webcenter 11g . FYI we did installation on weblogic and the server work fine