How to make use of Index of a table in report to fetch data?

Hi,
I need a sample code for select statement which is making use of INDEX of a table
to fetch data.
Doubt:
Can I fetch all the fields in the table by passing certain key fields of INDEX in where condition?

Hi Raja,
1) Mention the fields that you wish from database table (incase you don't need all the fields from the database table).
2) Don't use the INTO CORRESPONDING FIELDS OF TABLE ztable clause.
3)Instead use INTO TABLE ztable (But take care that during the declaration of the ztable, the fields declared are in order that in database table to fetch the Records in sequence).
Please Find the Syntax and Code Below..
SELECT *  FROM <TABLE>
  WHERE  <WHERE>
    %_HINTS ORACLE 'INDEX("<TABLE>~<INDEX ID")'.
SELECT carrid
INTO TABLE t_spfli
FROM spfli
WHERE carrud IN s_carrid AND
connid IN s_connid
%_HINTS ORACLE 'INDEX("&SPFLI&" "SPFLI~XXX")'.
Hope this Is helpFul
Thanks
kalyan

Similar Messages

  • How to make use of indexes when using group by caluse?

    Hi All
    I am using a query with a group by caluse without any WHERE caluse.There are indexes on columns in the select clause,but the explain plan shows a full table scan.Can this be avoided and make use of indexes?
    Execution Plan
       0      SELECT STATEMENT Optimizer=ALL_ROWS (Cost=347 Card=27007 Byt
              es=1053273)
       1    0   HASH (GROUP BY) (Cost=347 Card=27007 Bytes=1053273)
       2    1     TABLE ACCESS (FULL) OF 'TABLEXYZ' (TABLE) (Cost=73 Ca
              rd=27007 Bytes=1053273)
    Statistics
              1  recursive calls
              0  db block gets
            317  consistent gets
              0  physical reads
            116  redo size
         373725  bytes sent via SQL*Net to client
          12351  bytes received via SQL*Net from client
           1086  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
          16268  rows processedThanks in Advance

    user10450559 wrote:
    Hi All
    I am using a query with a group by caluse without any WHERE caluse.There are indexes on columns in the select clause,but the explain plan shows a full table scan.Can this be avoided and make use of indexes?In principle there are cases where Oracle can use an index range or full scan to do a group by without sorting if the "group by" columns are the leading columns in the index. But if you want an intelligent answer in your case, you will have to post the query and the definition of the index you think is the one that should be used.
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk
    "Science is more than a body of knowledge; it is a way of thinking" Carl Sagan

  • How to make use of a global internal table in SAP BW during transfer rules

    HI friends,
    I am ABAP consultant working on some APO info cubes. I have an issue during the upload of planning area data into APO info cube.
    Please help.
    I am using a transfer routine to find the TECHWEEK from a data base table ZGC_CALWEEK based on the on the calender month and calender week.
    Code I am writing is like below.
    *       FORM COMPUTE_/BIC/ZCALWEEK
    * Compute value of InfoObject ZCALWEEK
    * in communication structure /BIC/CSZT6DPPA
    * Technical properties:
    *     field name      = /BIC/ZCALWEEK
    *     data element    = /BIC/OIZCALWEEK
    *     data type       = NUMC
    *     length          = 000006
    *     decimals        = 000000
    *     ABAP type       = N
    *     ABAP length     = 000006
    *     reference field =
    * Parameters:
    *  -->  RECORD_NO       Record number
    *  -->  TRAN_STRUCTURE  Transfer structure
    *  <--  RESULT          Return value of InfoObject
    *  <->  G_T_ERRORLOG    Error log
    *  <--  RETURNCODE      Return code (to skip one record)
    *  <--  ABORT           Abort code (to skip whole data package)
    FORM COMPUTE_/BIC/ZCALWEEK
      USING    RECORD_NO LIKE SY-TABIX
               TRAN_STRUCTURE TYPE TRANSFER_STRUCTURE
               G_S_MINFO TYPE RSSM_S_MINFO
      CHANGING RESULT TYPE /BIC/OIZCALWEEK
               G_T_ERRORLOG TYPE rssm_t_errorlog_int
               RETURNCODE LIKE SY-SUBRC
               ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel datapackage
    *$*$ begin of routine - insert your code only below this line        *-*
    * DATA: l_s_errorlog TYPE rssm_s_errorlog_int.
    DATA: LV_WEEK         TYPE ZGC_CALWEEK-APOWEEK,
            LV_MONTH        TYPE ZGC_CALWEEK-APOMONTH,
            LV_TECH_WEEK    TYPE ZGC_CALWEEK-TECHWEEK.
      LV_WEEK   = TRAN_STRUCTURE-CALWEEK.
      LV_MONTH  = TRAN_STRUCTURE-CALMONTH.
      SELECT SINGLE TECHWEEK INTO LV_TECH_WEEK
        FROM ZGC_CALWEEK CLIENT SPECIFIED
        WHERE  MANDT = SY-MANDT
        AND  APOWEEK  = LV_WEEK
        AND   APOMONTH = LV_MONTH.
      IF SY-SUBRC IS INITIAL.
        RESULT = LV_TECH_WEEK.
      ELSE.
        RETURNCODE = 1.
        ENDIF.
    *$*$ end of routine - insert your code only before this line         *-*
    ENDFORM.
    There are more than 50-80 million records that wil be transferred from planning area to info cube. The select statment is giving pathetic performance as this has to run 50-80 million times.
    After adding the select statment to find the TECHWEEK it is taking 4 times the time that used to take before writing the select statment.
    Is there a way that I can first fetch the data from ZGC_CALWEEK to one internal table and that internal table can be used using read statment during the transfer routine instead of writing select statement here.
    Please help in this case?

    Hi Ashutosh,
    Thanks for the reply,
    The structure of the ZGC_CALWEEK is as below. I have already created a secondary index on the table for this table for the fields APO WEEK and APO MONTH. This didn't help much on the performance.
    I am also planning to keep the ZGC_CALWEEK database table to be fully buffered and this may definitely improve the performance but I need to reduce the data base hits as less as possible.
    MANDT                           MANDT                           CLNT     3     0     Client
    TECHWEEK                           ZTECHWEEK                           NUMC     6     0     Technical Week
    FROMDATE_TECH     DATUM                           DATS     8     0     Date
    TODATE_TECH     DATUM                           DATS     8     0     Date
    APOWEEK                           /BI0/OICALWEEK     NUMC     6     0     Calendar year / week
    FROMDATE_APO     DATUM                            DATS     8     0     Date
    TODATE_APO     DATUM                            DATS     8     0     Date
    APOMONTH                           /BI0/OICALMONTH     NUMC     6     0     Calendar year/month
    The table ZGC_CALWEEK is in APO system, where the transfer rules are being executed.
    As you mentioned START ROUTINE, In the start routine Can I create an internal table let's say GT_CALWEEK with structure ZGC_CALWEEK and pull all the records (I have a max of 2000 records in this table) from ZGC_CALWEEK to GT_CALWEEK and Can I used the same internal table GT_CALWEEK in the transfer routine to read the TECHWEEK from internal table.
    Thank you very much again for you reply. Any help regarding this would be greatly appreciated.
    Best regards,
    Siva

  • How to make use of pre-filter option in custom reports developed in SRSS(Fetch XML feature)

    Hi,
    I have created a report and have enabled the prefiltering option. But still when i select a particular record to run, it gives an error. Is there anything that needs to be changed in the xml query. Can someone please show me a detailed example of how to
    develop a report that uses prefilter option in order to make the report context sensitive. My objective is to create an invoice report that selects only one invoice record at a time.
    jigme_dhonyoe

    see if this helps
    http://www.njevity.com/blog/creating-dynamics-crm-2011-reports-sql-reporting-services-pre-filtering-and-default-filters
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How to make use of reference site to cut down the volume of data

    I am exploring the option to convert the current article master.
    I understand there is something like reference article.
    Is this tied to reference site?
    What about grouping a series of PP conditions to be shared by a few sites?
    I need more info on this. Can someone shared their experience on this and also provide me with some useful links?
    Thanks

    No reply after 2 weeks

  • How to make use of adjacent data elements within the same buffer

    Hi,
             Does anyone know how to make use of adjacent data elements within the same buffer? To make my question clearly, I would like to give you an example. In my application, I set "sample to read" as 10 which means at each loop 10 data samples will be taken into a buffer. Now, what I would like to do is to do some calculations on adjacent data samples in same buffer. I tried to use "shift register" for this, but it seemed to me that it only can deal with the calculation between data from adjacent loops. In other words, it skips 9 data elements and take the 10th one for the calculation.
             Here I also attach my VI showing what I did.
        Thank you very much in advance,
                            Suksun
    Attachments:
    wheel_encoder_1.vi ‏98 KB

    Hi Suksun,
          I hope you'll forgive me for distilling your code - mainly to understand it better.  I tried to duplicate your logic exactly - which required reversing the "derivatives"-array before concatination with the current samples array.  As in your code, the last velocity is being paired with the first position.  If first velocity is really supposed to be paired with first position, just remove the "Reverse 1D Array" node.
    cheers
    Message Edited by Dynamik on 01-07-2006 03:17 AM
    Message Edited by Dynamik on 01-07-2006 03:19 AM
    When they give imbeciles handicap-parking, I won't have so far to walk!
    Attachments:
    encoder2.GIF ‏14 KB
    encoder2.vi ‏102 KB

  • How to make use of SE37- Function Module & how to find out the table?

    Hi ,
    1.Could anyone help me what's this SE37-Function module is all about,How to make use of this?
    For Eg,If i want to delete a BOM permanently from the system then I have to use the Function module CM_DB_DEL_FROM_ROOT_BOM.
    But after giving the particular name what should i do?
    Please help me.
    2.How to find out the respective table for a particular field sya for T code-COGI, T code MFBF,where its values are getting populated.,Please help in this issue.
    Thanks in adavnce for spending some time
    Raj.S

    Hi Raj
    Function Modules
    Function modules are procedures that are defined in special ABAP programs only, so-called function groups, but can be called from all ABAP programs. Function groups act as containers for function modules that logically belong together. You create function groups and function modules in the ABAP Workbench using the Function Builder.
    Function modules allow you to encapsulate and reuse global functions in the SAP System. They are managed in a central function library. The SAP System contains several predefined functions modules that can be called from any ABAP program. Function modules also play an important role during updating  and in interaction between different SAP systems, or between SAP systems and remote systems through remote communications.
    Unlike subroutines, you do not define function modules in the source code of your program. Instead, you use the Function Builder. The actual ABAP interface definition remains hidden from the programmer. You can define the input parameters of a function module as optional. You can also assign default values to them. Function modules also support exception handling. This allows you to catch certain errors while the function module is running. You can test function modules without having to include them in a program using the Function Builder.
    The Function Builder  also has a release process for function modules. This ensures that incompatible changes cannot be made to any function modules that have already been released. This applies particularly to the interface. Programs that use a released function module will not cease to work if the function module is changed.
    Check this link
    http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db988735c111d1829f0000e829fbfe/content.htm
    You can execute function module in SE37ie you can perform the activiites defined in the function module by executing it.
    By deleting BOM you mention the FM name in se37 and execute. In some function module it will ask input parameters as developed in the program , you have to give the input parameters and execute.

  • How to make use of BAPI_CATIMESHEETMGR_CHANGE

    Hi All,
           We need to make use of BAPI_CATIMESHEETMGR_CHANGE for changing entered hours against an activity instead of adding new row for the same(BAPI_CATIMESHEETMGR_INSERT does that ) . Please guide me what all table parameters we should supply while executing this FM.
    Regards,
    Ganga.

    Hi Senthil,
    Now I have got how to make use of BAPI insert and change. But problme is when I need to add an hours entry for , say tuesaday of activity A for which already HAS monday hours,I am using  BAPI_CATIMESHEETMGR_INSERT AND IT IS ADDING ONE MORE ROW AS SHHOWN BELOW
    . But it adding new row. How top overcome this.
    <b>       Monday
          A     2</b>
    After insert
    <b>      Monday  Tuesday
          A     2
          A            3</b>
    =----
    SHould I use delete and insert.
    Please help me..;
    Regards,
    Ganga
    Message was edited by:
            Gangadharayya Hiremath
    Message was edited by:
            Gangadharayya Hiremath

  • How to make use of the presentation variable in SQL result query

    I have 2 prompts in my dashboard.
    Prompt1 decides the values of Prompt2.
    I have set a presentation Variable (selected_comp) in prompt1 which holds the value selected.
    To populate the values for Prompt2, I need to execute a query using the presenation variable set by Prompt1.
    SELECT "List Of Values".RID from rocketv2_3 WHERE "List Of Values".NAME='COMPONENT' AND "List Of Values".VAL=@{selected_comp}
    the query is resulting into
    SQL Issued: SELECT "List Of Values".RID from rocketv2_3 WHERE "List Of Values".NAME='COMPONENT' AND "List Of Values".VAL=0
    but the value in selected_comp is "ABC".
    Can anybody help in how to make use of the presentation variable in query to get the correct value
    thanks
    Shubha

    Just use constrain check box to filter your 2nd prompt values based on the 1st prompt.
    Thanks,
    Venkat
    http://oraclebizint.wordpress.com

  • How to make use of classlocator in NWDS.

    Hi Experts,
    I don't have Class / jar Locator.
    I am unable to install from SourceForge Website, it is showing some error.
    where can i get it ?
    And how to make use of classlocator in NWDS.
    Help me out in this regard.it's urgent
    Regards
    Bala

    Hi Balakrishna,
    You can download the  classlocator  from this URL:
    http://www.filewatcher.com/b/ftp/ftp.heanet.ie/mirrors/download.sourceforge.net/pub/sourceforge/c/cl/classlocator.0.0.html
    Check this thread for more help
    How to use classlocator plugin?
    Thanks n Regards
    Santosh
    Reward if helpful !!!

  • How to make use of the XFList in the Function Bar  of the XML Form Builder?

    Hello:
        Now I am creating blog using the XML Form Builder.
        In the bolg publishing interface of the SDN ,there is a tpoics list ,in this list you can select single or multiples.
        I find the XFList in the Function Bar of the XML Form Builder.But I don't know how to make use of this list?Who can help me?
    lexian
    Thanks a lot!

    In the Attributes of a screen field, there is an attribute called "Groups". This has 4 options for input (4 text boxes)
    SCREEN has 4 fields GROUP1, GROUP2, GROUP3 and GROUP4.
    The first text box under Groups attribute corresponds to SCREEN-GROUP1,
    2nd text box for SCREEN-GROUP2
    3rd text box for SCREEN-GROUP3
    4th text box for SCREEN-GROUP4
    Hope this helps.
    Thanks,
    Balaji

  • How to make use of label printing in sap smartforms

    Hi Dear,
    How to make use of label printing in sap smartforms.. I need to print four records from internal table into sap smart forms. It will
    come as four labels.All page should follow the same procedure... How to do...please help me..
    Regards,
    Nikhil

    Hi,
    Please go through below link, would be helpfull for you.
    [http://help.sap.com/saphelp_nw04/helpdata/EN/6b/54b4b8cbfb11d2998c0000e83dd9fc/frameset.htm]

  • How to make use of 'Icon Name' in Logical link?

    I see the option 'Icon name' in 'define logical links' in SPRO. It does not however has an F4. I tried giving the name of image in the relevant skin. But no image appears besides the logical link. Is there something else that needs to be done to get an image besides workcenter link? How to make use of this 'Icon Name' in logical link?

    Hi,
    i guess this icon_name is not possible for every skin in CRM70.
    We use nova skin - here it is not possible.
    With default skin i saw icons for example on the salespro startpage.
    Kind regards
    Manfred

  • How to make use of 32bit packages on Arch64

    Hello everyone, I recently installed arch 64bit which was not yet fully tweaked to suit my needs. 
    My 32bit version has some nice apps and I would like to know how to make use of them or even reuse them so that I won't download things anymore because I have a slow internet connection...:)
    Arch x86_64 / XFCE4
    Thanks in advance
    Last edited by kaola_linux (2008-12-09 15:24:36)

    kaola_linux wrote:
    Hello everyone, I recently installed arch 64bit which was not yet fully tweaked to suit my needs. 
    My 32bit version has some nice apps and I would like to know how to make use of them or even reuse them so that I won't download things anymore because I have a slow internet connection...:)
    Arch x86_64 / XFCE4
    Thanks in advance
    You can reuse the packages in /var/cache/pacman/pkg/ on your  Arch32.
    You can use these saved packages in a 32bit chroot ENV on your Arch64. Just pacman -U all of them.

  • How to make use of StreamGobbler?

    Hi,
    I want to redirect the out and err statements to a file.
    I found a class called StreamGobbler at http://www.physionet.org/physiotools/puka/sourceCode/puka/StreamGobbler.java
    I dont know how to make use of it as I have almost no knowledge of Concurrency and threads in Java.
    Plz guide.

    I found a class called StreamGobbler at
    http://www.physionet.org/physiotools/puka/sourceCode/p
    uka/StreamGobbler.javaDo you see, at the very top of that page, the URL for the original article? It explains everything step by step in great detail.

Maybe you are looking for

  • Macbook Display question

    I've noticed this after getting the computer back from repair for a cracked topcase. I'm sure it was there before hand but I wanted to get others thoughts on the issue. I'm worried it's going to ballo out into a bigger problem. As my computer was boo

  • Iweb SEO tool or iweb valet

    Which is the best iweb SEO tool or iweb valet? or is there a alternative to these? I have used iweb SEO tool, itweak, RAGE Sitemap Automator, and upload my site http://www.southfarm.co.uk/home.html with Transmit. It is a pain when I have a small upda

  • Encryption in PL/SQL

    Hi all, Has anyone came across encryption code, such as DES, written in PL/SQL? I found two files in Oralce 8.1.6, namely $ORACLE_HOME/rdbms/admin/dbmsobtk.sql & prvtobtk.plb. These files created a package called DBMS_OBFUSCATION_TOOLKIT which contai

  • FCE/Livetype workflow

    Hi everyone. I make videos that have quite a lot of titling in them -- for a 3-minute video, there might be 4 or 5 text slides, plus a title slide and some end credits. In terms of ease of editing -- lots of times I want to go back and fiddle with th

  • JAAS and LDAP

    hi, how can I check the password expiration time in the loginModule ??? I want to add this feature ..? can any one help???