Is it possible to use a secondary index in embedded persistent class

Hi,
I'm new to Berkely DB Java Edition and have just started playing with it.
To express a relation between two entities Foo and Bar, I am trying with an assocation class FooBarAssociation that is not an entity but rather a @Persistent-annotated embedded class in Foo (Foo has a collection of FooBarAssociations). Now I'm looking for a way to find all Foos associated with a given Bar id by use of an index. Can this be done? Is the use of the SecondaryKey in the embedded class at all correct? If this is not the way to go, can it be done any other way (except from using three entities)?
@Entity
class Bar {
    @PrimaryKey
    private int id;
@Persistent
class FooBarAssocication {
    @SecondaryKey(relatedEntity=Bar.class, relate=Relationship.ONE_TO_ONE)
    private int barId;
@Entity
class Foo {
    @PrimaryKey
    private int id;
    private Set<FooBarAssocication> fooBarAssociations = new HashSet<FooBarAssocication>();
}Any help much appreciated.
/Martin Söderström

Martin,
So could this be done with the embedded persistent class like this, or should I give up and make the FooBarAssociation class an entity of its own?A separate relationship entity class will definitely work, as described in the SecondaryIndex javadoc.
But SecondaryKey fields have to be at the top level of an entity class, so an embedded class that contains the secondary key (and other attributes) won't work.
Logically, you have a one-to-many relationship from Foo-to-Bar, and the relationship has attributes.
If you store the relationship in the Bar entity, then it's pretty easy because there is one Bar instance per relationship and other attributes can easily be stored there. I know you said you want to put it in the Foo class because it logically belongs there, but I'll show this alternative anyway for completeness:
@Entity
class Bar {
    @PrimaryKey
    private int id;
    @SecondaryKey(relatedEntity=Foo.class, relate=Relationship.MANY_TO_ONE)
    private int fooId;
    private Date createTime;
@Entity
class Foo {
    @PrimaryKey
    private int id;
}If it's really important to put the relationship fields into the Foo class, then you can do something like the following. It's messy to attach relationship attributes, but it can be done with either a parallel list or map.
Also, be sure to read the "Key Placement with Many-to-Many for Related Entities" section of the SecondaryIndex javadoc page.
@Entity
class Bar {
    @PrimaryKey
    private int id;
@Entity
class Foo {
    @PrimaryKey
    private int id;
    // Use one of the following, either this:
    @SecondaryKey(relatedEntity=Bar.class, relate=Relationship.ONE_TO_MANY)
    private List<Integer> barIds = new ArrayList<Integer>;
    private List<Date> barCreateTimes = new ArrayList<Date>;
    // Or this:
    @SecondaryKey(relatedEntity=Bar.class, relate=Relationship.ONE_TO_MANY)
    private Set<Integer> barIds = new HashSet<Integer>;
    private Map<Integer, Date> barCreateTimes = new HashMap<Integer, Date>;
From reading the documentation I also get the feeling that I could use the Base API and set up a SecondaryDatabase to create a secondary index for a case like this (correct?).Yes, you could do that, but I would hate to see you move to the base API just for this issue. The DPL is much easier to use (and easier for us to support).
Anyway, so far the BDBJE looks very promising to us. It may replace our current Hibernate solution.Great. We'd love to hear more about what you're doing, why JE works well for you, etc, either on the forum or privately if you prefer (mark.hayes at o.com). It helps us a lot to know what people are doing with JE.
--mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • Use two secondary indexes in a select statement

    hi, i want to use two secondary indexes in a select statement.
    how can i do it?

    Hello,
    To do it use the WHERE stm in the same order as the secondary stm is on SE11....To check if the index is used go to tcode ST05.
    example
    select * from ztable
    WHERE BUKRS EQ 'BUK1' AND
                 ZFIELD EQ 'BOY'.
    on se11 on the ZTABLE indexes setion must have a secondary index with
    BUKRS and
    ZFIELD.
    BYE!!
    Hope this helps!!
    Gabriel

  • Need help in using a Secondary Index of a GL Table

    Hello ABAPers,
    Good morning/afternoon!
    I  was wondering if anyone could give me a hand on this issue.
    To give you a brief background, I need to retrieve Open and Cleared items in the last 24 hours, that is, from 11 am yesterday till 10:59:59 today. The criteria is to pull the information using Entry Date (CPUDT) and Entry Time (CPUTM) from BKPF and using BELNR, retrieve the postings in BSIS and BSAS. as you can see in the piece of code. However, this process takes soooooo long to run.
    Below is the code snippet.
    We use 46C and MS SQL database.
    The index fields of BKPF~ZB2 are: MANDT, CPUDT and BLART.
    The index fields of BSIS~Z01are: BUKRS, GJAHr, HKONT, PRCTR, GSBER
    TYPES: BEGIN OF i_bseg,
           bukrs LIKE bkpf-bukrs,
           hkont LIKE bsis-hkont,
           gjahr LIKE bkpf-gjahr,
           belnr LIKE bkpf-belnr,
           buzei LIKE bsis-buzei,
           bldat LIKE bsis-bldat,
           budat LIKE bsis-budat,
           waers LIKE bsis-waers,
           monat LIKE bsis-monat,
           shkzg LIKE bsis-shkzg,
           gsber LIKE bsis-gsber,
           dmbtr LIKE bsis-dmbtr,
           wrbtr LIKE bsis-wrbtr,
           cpudt LIKE bkpf-cpudt,
           cputm LIKE bkpf-cputm,
           END OF i_bseg.
    *Internal Tables
    DATA:
          i_bkpf TYPE TABLE OF bkpf,
          i_bseg TYPE STANDARD TABLE OF i_bseg.
    Select records from yesterday's entry date.
        SELECT  bukrs belnr gjahr monat budat cpudt cputm waers
                FROM bkpf INTO  CORRESPONDING FIELDS OF TABLE i_bkpf
                WHERE ( cpudt = so_date2-low AND
                        cputm >= so_cputm-low AND
                        cputm <= so_cputm-high )
                OR    ( cpudt = so_date2-high AND
                        cputm >= so_time2-low AND
                        cputm <= so_time2-high )
                %_HINTS MSSQLNT 'INDEX("BKPF" "BKPF~ZB2")'.
        IF sy-subrc NE 0.
          MESSAGE e006 WITH 'BKPF'.
        ENDIF.
    Select Open Items***
        SELECT bukrs hkont gjahr belnr buzei  budat bldat
               waers monat shkzg gsber  dmbtr wrbtr
               FROM bsis
               APPENDING CORRESPONDING FIELDS OF TABLE i_bseg
               FOR ALL ENTRIES IN i_bkpf
               WHERE bukrs = i_bkpf-bukrs
               AND gjahr = i_bkpf-gjahr
               AND hkont IN so_saknr
               AND belnr = i_bkpf-belnr
               %_HINTS MSSQLNT 'INDEX("BSIS" "BSIS~Z01")'.
    Also get any cleared items ***
        SELECT bukrs hkont gjahr belnr buzei  budat bldat
               waers monat shkzg gsber  dmbtr wrbtr
               FROM bsas
               APPENDING CORRESPONDING FIELDS OF TABLE i_bseg
               FOR ALL ENTRIES IN i_bkpf
               WHERE bukrs IN so_bukrs
               AND   hkont IN so_saknr
               AND   gjahr = sp_gjahr
               AND   belnr = i_bkpf-belnr.
    Many thanks,
    Rosemarie

    Thanks for your response.
    The date and time fields are defined in my selection screen and the default values pre-set in the INITIALIZATION, so the dates and times are already stored as a range.
    The problem is why is the process taking so long. Is the syntax for the INDEX correct?
    PARAMETERS:p_not RADIOBUTTON GROUP pass.
    SELECT-OPTIONS:
      so_date2 FOR bkpf-cpudt,         " Entry Date
      so_cputm FOR sy-uzeit,         " Entry Time
      so_time2 for sy-uzeit.        " Entry Time 2
    INITIALIZATION.
    RANGES: so_time2 FOR sy-uzeit.
      g_date = sy-datum - 1.
      g_year = sy-datum+0(4).
      sp_gjahr = g_year.
      CONCATENATE sp_gjahr '0101' INTO g_from_date.
      g_from_time = '110000'.
      g_24_hour   = '235959'.
      g_time_diff = g_24_hour - g_from_time.
      g_to_time = g_from_time + g_time_diff.
      g_to_time2 = g_from_time - 1.
      MOVE: 'I'      TO so_cpudt-sign,
            'BT'     TO so_cpudt-option,
            g_from_date   TO so_cpudt-low,
            sy-datum TO so_cpudt-high.
      APPEND so_cpudt.
      MOVE: 'I'      TO so_date2-sign,
            'BT'     TO so_date2-option,
            g_date   TO so_date2-low,
            sy-datum TO so_date2-high.
      APPEND so_date2.
      MOVE: 'I'         TO so_cputm-sign,
            'BT'        TO so_cputm-option,
            g_from_time TO so_cputm-low,
            g_to_time   TO so_cputm-high.
      APPEND so_cputm.
      MOVE: 'I'         TO so_time2-sign,
            'BT'        TO so_time2-option,
            '000000'    TO so_time2-low,
             g_to_time2 TO so_time2-high.
      APPEND so_time2.

  • Is it possible to use Apple Configurator to pre-load a class set of iPads with books?

    I have class set of iPads that I want to pre-load with books from the iBooks Store (all public domain/Project Gutenberg, so they're free). I've managed to get them on one device, but it was 60+ and I had to download each indiviually. In Apple Configurator, when I backed-up that iPad and tried to load it on the others, the books did not show up on the other devices.
    Short of downloading all the books on each iPad, is there an easier way to do this?

    unfortunately I don't see a way to do it with configurator. You may be able to use iTunes in the cloud for it though. On each iPad, make sure they are connected to the network, then go to Settings.app -> Store. Make sure the Apple ID associated with the books is logged in, and then turn the automatic downloads for books on. You may then have to download the books on again on one of the devices, but they should appear on all the devices.

  • Using Secondary Index

    Hi,
    I have a secondary index with 3 key fields.While wrting the select query with these 3 key fields I am providing 2 more non-key fields. Now the problem is that the secondary index in not used in this case. Can anybody help me why it is not using the secondary index.
    For example:
    Seconday Index fields are : fd1, fd2, fd3
    In select query:
    select A B C from  <XYZ> into table I_XYZ
    where  fd1 = 'a'     " key field
    and fd2 = 'b'         " key field
    and fd3 = 'c'         " key field
    and fd4 = 'd'         " non-key field
    and fd5 = 'e'.        " non-key field
    Problem : Query is not using the seconday index.
    Regards
    Sanjay

    hi,
    Check if your secondary index is having mandt field or not.
    system changes your select as
    select A B C from <XYZ> into table I_XYZ
    where <b>mandt = sy-mandt  and</b>
    fd1 = 'a' " key field
    and fd2 = 'b' " key field
    and fd3 = 'c' " key field
    and fd4 = 'd' " non-key field
    and fd5 = 'e'. " non-key field
    so, secondary index will be chosen only if mandt is there in the list of fields in secondary index.
    Regards
    sailaja.

  • Use secondary index in internal tables.

    what are the uses of secondary index in internal table?

    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eb47446011d189700000e8322d00/content.htm
    Creating Secondary Indexes
    Proceed as follows to create a secondary index on a table:
    In the field maintenance screen for the table, choose Goto --> Indexes.
    1. If you went to the field maintenance screen of the table in display mode, only correct the index (and not the table).
    If indexes already exist on the table, a list of these indexes is displayed. Choose Create. A dialog box appears in which you must enter the three-place index identifier. If there are no indexes, go directly to the dialog box.
    2. Enter the index identifier and choose Continue.
    You will go to the maintenance screen for indexes.
    3. Enter an explanatory short text in the field Short text.
    Choose TabFields.
    4. A list of all the fields of the table is displayed.
    5. Select the fields which you want to copy to the index.
    6. Choose Copy.
    The selected fields are copied to the index.
    7. If the values in the index fields already uniquely identify each record of the table, select Unique index.
    A unique index is automatically created on the database during activation because a unique index also has a functional meaning (prevents double entries of the index fields).
    8. If it is not a unique index, leave Non-unique index selected. In this case you can use the corresponding radio buttons to define whether the index should be created automatically on the database for all database systems, for selected database systems or for no database system.
    9. If you chose For selected database systems, you must specify these systems.
    You have two possibilities here:
    List of inclusions: The index is only created automatically during activation for the database systems specified in the list. The index is not created on the database for the other database systems.
    List of exclusions: The index is not created automatically on the database during activation for the specified database systems. The index is automatically created on the database for the other database systems.
    Click on the arrow symbol behind the radio buttons. A dialog box appears in which you can define up to 4 database systems. Use the corresponding radio buttons to decide whether this list should be treated as a list of inclusions or exclusions.
    10. Activate the index with Index ® Activate. The activation log tells you about the flow of the activation. Call it with Utilities ® Act.log. If an error occurred when activating the secondary index, you will automatically go to this log.
    The secondary index is automatically created on the database during activation if the corresponding table has already been created there and index creation was not excluded for the database system.
    Reward points if useful.

  • Null secondary index?

    I'm using Berkeley DB Java Edition with the Collections API. I want to know if it's possible to have a secondary index that is a null value.
    My persisted object has an optional email field. Email is a secondary index. Everything works except when the secondary index is null. I get an exception in the database. I have sortedDuplicates set to true in the SecondaryConfig.
    Thanks, Steve

    Okay, I overlooked something. I was first doing a get (on my secondary index StoredMap) to do some checking before calling put. I was passing null to get which resulted in the following exception:
    Exception in thread "main" java.lang.IllegalArgumentException: null key and null value
    at com.sleepycat.collections.DataView.useKey(DataView.java:495)
    at com.sleepycat.collections.DataCursor.getSearchKey(DataCursor.java:558)
    at com.sleepycat.collections.StoredContainer.get(StoredContainer.java:280)
    at com.sleepycat.collections.StoredMap.get(StoredMap.java:218)
    at ...
    Calling put with an object that results in a null secondary index works fine after all.
    This brings up a second question, why does secondary index's StoredMap.get(null) not work? I can call get with a non-existent non-null secondary key and it will return null. But calling get with null results in the above exception.
    Steve

  • Effect of Secondary Index on Performance Tuning

    Hi,
    I have a select statement with the below where statement.
    WHERE keyz1 = IT_dfkkzk-keyz1
    AND bldat IN s_pblda
    AND valut IN s_pvalu.
    Table from data is accessed Primary key is a combination of two fields KEYZ1 & POSZA.
    We have a Secondary Index with OPBEL & KEYZ1.
    Will Optimizer will use Secondary Index?
    If we change the where statement as given Below
    WHERE keyz1 = IT_dfkkzk-keyz1
    Will the access be fast?
    Should i create a secondary index on keyz1 to make it fast?
    Thanks & Reagrds
    Lijo Joseph

    Hi Lijo Joseph,
    I think, optimizer will use primary key because "WHERE keyz1" references the first part of this key. Even if you change your WHERE-statement as considered, this will not change optimizer approach.
    And yes, this access should be the fastest way to access you data, besides you have more values to reduce the amount of resulting rows. For example if you could specifiy POSZA too, this would accelerate access.
    Creation of another secondary index on keyz1 will not make it faster, maybe if you include bldat and valut in this key. But notice, insertion and modification of data will then be slower.
    To get optimizer to use existing secondary index you have to specify OPBEL in your where condition like this:
    "where OPBEL = 'X' and KEYZ1 = ....."
    Herbert

  • Using a byte[] as a secondary index's key within the Collection's API

    I am using JE 4.1.7 and its Collections API. Overall I am very satisfied with the ease of using JE within our applications. (I need to know more about maintenance, however!) My problem is that I wanted a secondary index with a byte[] key. The key contains the 16 bytes of an MD5 hash. However, while the code compiles without error when it runs JE tell me
    Exception in thread "main" java.lang.IllegalArgumentException: ONE_TO_ONE and MANY_TO_ONE keys must not have an array or Collection type: example.MyRecord.hash
    See test code below. I read the docs again and found that the only "complex" formats that are acceptable are String and BigInteger. For now I am using String instead of byte[] but I would much rather use the smaller byte[]. Is it possible to trick JE into using the byte[]? (Which we know it is using internally.)
    -- Andrew
    package example;
    import com.sleepycat.je.Environment;
    import com.sleepycat.je.EnvironmentConfig;
    import com.sleepycat.persist.EntityStore;
    import com.sleepycat.persist.PrimaryIndex;
    import com.sleepycat.persist.SecondaryIndex;
    import com.sleepycat.persist.StoreConfig;
    import com.sleepycat.persist.model.Entity;
    import com.sleepycat.persist.model.PrimaryKey;
    import com.sleepycat.persist.model.Relationship;
    import com.sleepycat.persist.model.SecondaryKey;
    import java.io.File;
    @Entity
    public class MyRecord {
    @PrimaryKey
    private long id;
    @SecondaryKey(relate = Relationship.ONE_TO_ONE, name = "byHash")
    private byte[] hash;
    public static MyRecord create(long id, byte[] hash) {
    MyRecord r = new MyRecord();
    r.id = id;
    r.hash = hash;
    return r;
    public long getId() {
    return id;
    public byte[] getHash() {
    return hash;
    public static void main( String[] args ) throws Exception {
    File directory = new File( args[0] );
    EnvironmentConfig environmentConfig = new EnvironmentConfig();
    environmentConfig.setTransactional(false);
    environmentConfig.setAllowCreate(true);
    environmentConfig.setReadOnly(false);
    StoreConfig storeConfig = new StoreConfig();
    storeConfig.setTransactional(false);
    storeConfig.setAllowCreate(true);
    storeConfig.setReadOnly(false);
    Environment environment = new Environment(directory, environmentConfig);
    EntityStore myRecordEntityStore = new EntityStore(environment, "my-record", storeConfig);
    PrimaryIndex<Long, MyRecord> idToMyRecordIndex = myRecordEntityStore.getPrimaryIndex(Long.class, MyRecord.class);
    SecondaryIndex<byte[], Long, MyRecord> hashToMyRecordIndex = myRecordEntityStore.getSecondaryIndex(idToMyRecordIndex, byte[].class, "byHash");
    // END

    We have highly variable length data that we wish to use as keys. To avoid massive index sizes and slow key lookup we are using MD5 hashes (or something more collision resistant should we need it). (Note that I am making assumptions about key size and its relation to index size that may well inaccurate.)Thanks for explaining, that makes sense.
    It would be the whole field. (I did consider using my own key data design using the @Persistent and @KeyField annotations to place the MD5 hash into two longs. I abandoned that effort because I assumed (again) that lookup with a custom key design would slower than the built-in String key implementation.)A composite key class with several long or int fields will not be slower than a single String field, and will probably result in a smaller key since the UTF-8 encoding is avoided. Since the byte array is fixed size (I didn't realize that earlier), this is the best approach.
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • When is a secondary index used (in select or where)

    HI All,
    We are confused (and new to ABAP) on the various postings on SDN concerning this topic.  Replies seem to vary.
    We have the following select statement:
    SELECT date1 FROM table2
    WHERE material (from a stored internal table) = material-table2
    AND order (from a stored internal table) = order-table2
    AND delivery method (from a stored internal table) = specific value of table2.
    For a second index to be created, would we create the index for only date1 (since it's the only field we are selecting from table 2) or an index with date1, material, order, delivery method or just what's in the WHERE clause of material, order and delivery method?
    How can you be sure that an index will be used?
    Thank you!

    > We are confused (and new to ABAP)
    seem you are very very new.
    Your question is actually not ABAP indexes etc are SQL and can be found in many textbooks also on Wiki pages. ABAP uses SQL, but does not change much.
    The use index is determined nearly only by the WHERE clause. You want to know the phone number of somebody and you know the name and the address. The Index uses the name and the address as a telephone book. The phone number comes from the table not the index! This is not the secondary index, but the primary index.
    If you search in the internet for phone number, then you can use also a secondary index, i.e. you know only the complete address but not the name. A phone book would not help here.
    Which index is used, if often very simple as in the example, but can become very difficult. That is done by a sophisticated program of the database, the optimizer. Check other resoucres for details.
    Siegfried

  • Is it possible to created secondary indexes on ODS in Production

    Hi,
    Is it possible to created secondary indexes on ODS in Production System. I need to create secondary indexes on ODS but it is already in production. Hence Can I directly create secondary indexes without transportation from dev to production?

    Hi,
    Secondary Indexes for DSO can be transported. For the transport the DSO objects needs to be transported (R3TR ODSO <technical name>.
    Additionally, secondary Indexes are necessary quite often for DSO tables, which can be transported. In few cases you need indexes on other BW tables, but they cannot be transported. Never create additional Indexes on InfoCube tables (like E- and F-Fact tables and Dimension tables)
    Thanks & B.R.
    Vince

  • Is it possible to have 2 different output config XML files and index the data into 2 endeca apps using the same indexing component ProductCatalogSimpleIndexingAdmin

    Hi ,
    We have a catalog that defines 2 types of products (they have too many different properties), so wanted to keep them on two different MDEX engines and serve the applications requests. Here DB catalog and front end ATG application is same for both the MDEX instances.
    Is it possible to have 2 different output config XML files and index the data into 2 endeca apps using the same indexing component ProductCatalogSimpleIndexingAdmin?
    Thanks
    Dev

    Hi, also have had some problem some monthes ago - I created separete component ProductCatalogSimpleIndexingAdminSecond. After that one of my colleage gave me some advice:
    The creating separate component like ProductCatalogSimpleIndexingAdmin for the second IOC is possible way for resolving your situation. But I afraid that this way will be required creating mane duplicates for already existed components.
    In my opinion the better way is the following:
    starting from AssemblerApplicationConfiguration and ApplicationConfiguration component. It contains details for connecting between ATG and Endeca. Of course you should configure different components for different Endeca Apps.
    After that:
    Find all components that uses AssemblerApplicationConfiguration and ApplicationConfiguration. Customize these components for using one or another  *Configuration component depending on what index works. (many variants released it: the most simple global custom component with flag.)
    Then customize the existed ProductCatalogSimpleIndexingAdmin. Using one or another IOC  and setting the flag in global custom component when index started. You can add some methods into your custom ProductCatalogSimpleIndexingAdmin like:
    Execute baseline index for both IOC (one by one)
    Execute baseline for IOC 1
    Execute baseline for IOC 2.
    Note: you should be afraid about incremental (partial) index in this configuration. But resolving conflicts in incremental index should be done after full implementation these changes.
    Regards

  • Is it possible to use count_hits with a catsearch index

    i am trying to find the count of hits in an index, but i have tried the count_hits but this did not wotk with my catsearch index.
    I cannot just do a count as this is to trap an error message from Bug 4006624 , which we cannot correct by upgrading for a few months due to project live dates and current systems on different versions

    If you want to use ctx_query.count_hits, you will need to use a context index, not a ctxcat index.

  • How to use secondary index

    Hi abapers,
    Iam creating secondary index for the database table MSEG. ....How to write select query for the secondary index that i have created..
    Regards,
    Ramya

    how to create secondary index in tables
    https://forums.sdn.sap.com/click.jspa?searchID=933015&messageID=2971112
    Guidelines to create secondary index
    https://forums.sdn.sap.com/click.jspa?searchID=933015&messageID=2009801
    Secondary index;
    http://help.sap.com/saphelp_47x200/helpdata/en/cf/21eb2d446011d189700000e8322d00/content.htm
    this will definitely help you, dont forget to award points if found helpful

  • Difference between primary eindex and secondary index?

    hi experts
    pls answer me
    difference between primary eindex and secondary index?
    rewads apply.
    thanks.
    naresh.

    hi,
    check this link.
    http://help.sap.com/saphelp_47x200/helpdata/en/cf/21eb2d446011d189700000e8322d00/frameset.htm
    A difference is made between Primary & Secondary indexes to a table. the primary index consists of the key fields of the table and a pointer to the non-keys-fields of the table. The Primary index is generated automatically when a table is created and is created in the datebase as the same times as the table. It is also possible to define further indexes to a table in the ABAP/4 dictionary, which are then referred to as Secondary indexes.
    Always it is not mandatory that an index should have all the key fields of a table. To see the index of a table
    goto SE11->specify table name->click on the indexes... button on the application toolbar.
    Based on your requirement you can you any of those index fields in the where clause of your query. Always its a better practice to use the index fields in the order specified. While selecting the records from a table it is always better to select the fields in the same order as specified in the table.

Maybe you are looking for

  • How to open and show a word, excel, ppt file in Adobe AIR application?

    Dear All, I have a requirement to open a MS- word/ Excel file in the AIR application. On click of a brows button a file reference box opens...on any file selection...it should open in the application itself... so plz let me know the solutions u have.

  • Need to close RFC connection

    Hi all, Currently we developed a application in NWDS, the same is operational from portal. As per the requirment we have to run the RFC many times to extract the data from R/3. After running the RFC many times we are getting the following Error "Erro

  • Problem with data table and internal and external command button

    thanks for your time, i have this problem <t:dataTable binding="#{manejadorAsociarEvaluadoresProyecto.tablaPosiblesEvaluadores}" cellpadding = "6" cellspacing = "3" value = "#{manejadorAsociarEvaluadoresProyecto.listaPosiblesEvaluadores}" var = "posi

  • Discoverer Viewer - URGENT

    Hallo everybody I need urgent help. I am runing Discoverer 10g on a Windows 2000 server. This is my situation: On a normal site(on Synkron) I want to make a link. When I click on this link, I want the repport (the repport is made in Discoverer Plus)

  • Time scatter graph class cl_gui_chart_engine

    hello i need to biled graph that the y pivot is date and hour and the x is caracteristic but i whant to show the x pivot divied by  motnth  for that use i am tring to use time scatter graph. and my question is how to write the categories and the  ser