How to create index attributes in CAF Entity Service

When one creates an entity service with external persistency (local persistency on the persistency tab is unchecked) you have to create at least one "key" attribute. However, how do you create "index" attributes to improve performance. Currently, if you add custom key you must select "key" checkbox in attribute wizard when creating an attribute and this key field must be unique. This is not what I am looking for. I'd like to create a few custom keys that the contents allow duplicate.

Hi Tom,
This is a very valuable question. Yes, you can add an index for specific fields to the generated database table. You can do in the NWDS, navigate to the dictionnary view and open the corresponding database table. Now you can add an index and assign database field(s) to this index.
However: you must be aware that, if the entity is changed (i.e. new parameters are added), the database table is re-generated and the indices are lost.
Regards,
  Jan

Similar Messages

  • How to use a structure in CAF entity service

    Hi All
    I want to use a structure as datatype of a complex attribute in a CAF entity service. I tried to use a dictionary structure created in the dictionary part
    of the CAF project and added it to the public part of this DC.But I can't find it in the list of data structures while trying to mention datatype for a complex attribute in an entity service. Can any body suggest how to do it.
    Cheers
    Sudip

    Hello Sudip,
    You can create a complex structure by doing the following:
    1.  From the Attributes Tab, right click on your Entity and select "Create Attribute"
    -  Enter an attribute name and description
    -  select "Complex Attribute" checkbox
    -  select "Finish"
    2.  Right click on the newly created complex attribute and select "Create Sub Attribute".  Do this for each attribute in your structure.
    This complex structure can now be used in your CAF application and also CAF UI patterns.
    Creating complex attributes from the data dictionary is only usually used for creating enumeration types.  When doing this, you have to use the CAF enumeration editor to populate the values.  The "How to guide" that Jan refers to describes this.
    Regards,
    Austin.

  • How to design CAF Entity service?

    hello,
    here is my question.
    how to design CAF Entity service?
    i got employees data and departments data.
    an employee can join over one department, and of course, a department had many employee.
    in tradition RDBMS(relational database management system), i'll create three tables and named "Employee", "Department" and "DepEmp". the table "DepEmp" is a kind of table for N to N relaction.
    but when i use CAF's entity service, i can't do like RDBMS.
    i can create three entity services, named "Employee", "Department" and "DepEmp". i can make service refence(pull service from left side of windows), but the information about Key(in properties) cannot be "true".
    how can i do?
    is there a different normalization way i have to learn.

    thank you so much, it really help.
    but when the issue more complicated.
    a employee can join multiple departments, and he/she got different job title in each department. case will like fallow.
    Vic is a software engineer in XX company's IT department, and he is a MIS engineer in XX company's HR department.
    the db( i'm sorry for take this for example) structure will like..
    =======================================
    table:employee
    column:
    employeeCode PK
    name
    phone
    table:department
    column:
    departmentCode PK
    name
    location
    table:jobTitle
    column:
    titleCode PK
    name
    description
    table:deptEmployee
    column:
    employeeCode PK FK
    departmentCode PK FK
    titleCode PK FK
    =======================================
    my SAP NetWeaver Developer Studio is version 7.0
    1. how i make sure that three keys be mapped each other?(empCode,deptCode,titleCode)
    2. is there have any "IUD abnormality" risk?
    3. if there have, how can i avoid it?
    thank you again, i'm sorry for ask much, because the way to design CAF Entity Service is that i didn't learn before. it really make me confused.
    have a nice day

  • How to create an attribute dimension in Essbase Studio?

    I cannot figure out how to create an attribute dimension using Essbase Studio. The online help states that I need to "Find the Attribute settings grouping in the center" of the member properties dialog box. I suspect that I'm having a problem figuring this out because I don't have the attribute dimension properly defined in the relational data source or in the mini-schema. I've tried creating a table with no key relationship to the other tables and with no logical joins defined, but that doesn't seem to help. Any ideas?

    so in the 11.1.1 version you would click on the member name in the hierarchy you added to the Essbase model and in the center pane of the general tab should be the attributes settings section.
    If I had a dimension called stores wth two groupings unser it region and store_type, I would click on store_type and add the attribute info

  • How to create a attribute for a table

    I am created a table with four columns.
    How to create a attribute for each column.........

    Hi Cranjith Kumar,
    First Create a node for ur table.In that give your table name in the dictionary structure then select option add attributes from the structure that will display the fields there u can select the fields then automatically attributes for ur table will be created in the context.
    Reward points if useful.
    Edited by: srilalitha yerramsetti on Jun 18, 2008 3:23 PM

  • How to create an Attribute set

    Hi Everyone,
    i am learning OAF....right now going through PPR.I was referring the sample tutorials where i came across attribute sets in the PPR Example, which i believe were created as per requirement.So not able to proceed further till i get some clue abt how to create an attribute set as per my requirement.Tried to refer dev guide but not able to grab the concept
    Can anyone tell me where exactly do i need attribute sets(i am only aware that it is used to provide the look n feel to the browser) and how to go abt creating one.
    Thanks
    Amrita

    Thanks for replying
    i'd like u to see the PartialPageExample in sampleLibrary project..There is a function being called in the CO from SampleBrowserAM which is
    public void handleSupplierSelectionEvent()
    OADBTransaction txn = getOADBTransaction();
    String detailTableText = null;
    // Find the selected radio button so we can mark the current row.
    OAViewObject vo = (OAViewObject)findViewObject("SuppliersVO1");
    // Get the first filtered row.
    Row masterRow = vo.getFirstFilteredRow ("SelectFlag", "Y");
    if (masterRow != null)
    vo.setCurrentRow(masterRow);
    String supplierName = (String)masterRow.getAttribute("Name");
    MessageToken[] tokens = { new MessageToken("SUPPLIER_NAME", supplierName)};
    detailTableText =
    txn.getMessage("AK", "FWK_TBX_SITES_FOR_SUPPLIER", tokens); }
    else
    // If there are no selected rows, display a default generic message.
    detailTableText =
    txn.getMessage("AK", "FWK_TBX_SUPPLIER_SITES", null);
    // Now set the text message on the DETAIL_TABLE_TEXT attribute in
    // the application properties VO.
    SampleBrowserPVOImpl appPropsVo = getSampleBrowserPVO1();
    Row appPropsRow = appPropsVo.getCurrentRow();
    if (appPropsRow != null)
    appPropsRow.setAttribute("DetailTableText", detailTableText);
    } // end handleSupplierSelectionEvent()
    i am not able to understand the text in bold in the code above.how do i refer to it, where is it stored, what is it doing , and it is maybe specific to the supplier table coz i cannot use it for my custom table...can u pls explain

  • How to create indexes on ODS ?

    Hello friends ,
    Need some help .
    Could any one please let me know how to create indexes on ODS ?
    How Indexes are useful on ODS ?
    Thanks in advance
    Regards

    Dear Akshay,
    Below is the information about indexes and there creation for ODS.
    You can search a table for data records that satisfy certain search criteria faster using an index.
    An index can be considered a copy of a database table that has been reduced to certain fields. This copy is always in sorted form. Sorting provides faster access to the data records of the table, for example using a binary search. The index also contains a pointer to the corresponding record of the actual table so that the fields not contained in the index can also be read.
    The primary index is distinguished from the secondary indexes of a table. The primary index contains the key fields of the table and a pointer to the non-key fields of the table. The primary index is created automatically when the table is created in the database.
    You can also create further indexes on a table in the ABAP Dictionary. These are called secondary indexes.Under Indexes, you can create secondary indexes by using the context menu in order to improve the load and query performance of the ODS object This is necessary if the table is frequently accessed in a way that does not take advantage of the sorting of the primary index for the access.
    The database system sometimes does not use a suitable index for a selection, even if there is one. The index used depends on the optimizer used for the database system. You should therefore check if the index you created is also used for the selection (see How to Check if an Index is Used).).
    Creating an additional index could also have side effects on the performance. This is because an index that was used successfully for selection might not be used any longer by the optimizer if the optimizer estimates (sometimes incorrectly) that the newly created index is more selective.
    The indexes on a table should therefore be as disjunct as possible, that is they should contain as few fields in common as possible. If two indexes on a table have a large number of common fields, this could make it more difficult for the optimizer to choose the most selective index.
    Leaving content frame.
    With Regards,
    Prafulla Singh

  • How to create indexes using CREATE TABLE statement

    Hi,
    Can anyone please tell me how to create indexes using CREATE TABLE staement? This point is part SQL Expert exam (1Z0-047) and please guide me to use which books for this particular exam.
    Thanks in advance.

    Can anyone please tell me how to create indexes using CREATE TABLE staement?e.g. creating a primary key or a unique constraint will generate indexes along with the create table syntax:
    SQL> create table t (a integer primary key, b integer unique)
    Table created.
    SQL> select   index_name, index_type, uniqueness
      from   user_indexes
    where   table_name = 'T'
    INDEX_NAME                     INDEX_TYPE                  UNIQUENES
    SYS_C0016575                   NORMAL                      UNIQUE  
    SYS_C0016574                   NORMAL                      UNIQUE  
    2 rows selected.

  • How to create/add attributes in element list in Screen (example 100)

    HI,
    how to create/add attributes in element list in Screen (example 100)
    I mean after creating screen ..it has "OK CODE " attribute in element list tab in 100 screen.
    I want to create "container" in Element list tab in my screen 100 program
    I want to create new layout " container" in the element tab (i know if i click on layout button where i can create manually)
    Thanks
    Edited by: Raja on Apr 29, 2009 4:19 PM

    Hi Raja,
    Do you remember how you resolved this problem? I am facing the same. Appreciate your response.
    Thanks,
    Shailaja

  • Removing/updating data through CAF entity service

    Does anyone know a way to remove/update data through a CAF entity service from a web dynpro which uses the webdynpro model of the CAF project ?

    Hi Nicolaij,
    This example describes how UPDATE and DELETE works under SP8.
    Hopefully it helps.
    Regards
    Kamil
    UPDATE of entity called "Bank"
    =======================
    ABank recordBank;
    recordBank = BankServiceProxy.read(“000000024”);
    recordBank.setCountryId(„Germany“);
    IAspect aspectList = recordBank.getAspect();
    aspectList.sendChanges();
    DELETE from entity called "TransferID"
    ============================
    ATransferID recordTransferID;
    recordTransferID = TransferIDServiceProxy.read(„123115651“);
    IAspect aspectList = recordTransferID.getAspect();
    IAspectRow aspectRow = aspectList.getAspectRow(0);
    aspectList.removeAspectRow(aspectRow);
    aspectList.sendChanges();

  • Problem when creating CAF Entity Service finder Methods

    Guys,
    Can any one please suggest me appropriatly to the below problem.
    I am using NWDS 7.06. I have no problem when creating CAF project, Application Service and Entity Service even.
    But in the Entity Service:
    1. Add a string or longtext attribute.
    2. try to create a custom finder method in operations tab, during that operation i am  not finding the attribute which i have created in step1.
    That means i am not able to create the my own finder methods with parameters.
    I was able to do that in some version long ago but i have forgotten that NWDS version.
    summary of Problem Is: " Cannot create custom methods with custom parameters in Entity Service"
    Can you please suggest me the right version or a solution to this problem on urgent basis please.
    I promise you that i will give you full points to you who ever gives me the right solution.
    Please mail your suggestions to [email protected]

    Guys,
    I have solved the problem successfully. Thanks for your attention.

  • How to create  index for a column of a view

    Hi,
    I have created view for a table and then i am trying to create index for a column of that view. i am using the query "CREATE INDEX index_name ON view_name (col)". but Mysql is showing error like "view_name is not a base table".
    How can i do that......

    As mentioned this is a java forum not a mysql forum, but as I know the answer - you can't create an index directly on a view in mysql.

  • How to create index not unique at the time of the CREATE TABLE

    Hi,
    I am trying to find out how in Oracle create secondary indexes that can accept duplicated into the CREATE TABLE statement, without have to execute a CREATE INDEX separately.
    As far I can see the only syntax accepted by Oracle 9i to create more than one index at the time of the table creation is:
    CREATE TABLE test_tab (x INTEGER, y INTEGER, z INTEGER PRIMARY KEY(x,y), UNIQUE(z))
    But, in my case I need to have the unicity only for the primary key, but not for the second index, that I would like to have not unique.
    How to do that inside of the CREATE TABLE statement?
    Any help?
    Thanks a lot in advance.

    To create an index automatically (not constraint related) , you will need to have an 'event' trigger on the schema that will (IE: detecting a table create/drop matching ARCHIVE_%) , generate the appropriate SQL required (create index sql) and pass THAT to a DBMS_JOB.
    Make sure you have job queue's enabled.
    This was the ONLY way that I could re-create a view automatically as new tables were created that matched a criteria IE ARCHIVE_JAN06, ARCHIVE_FEB06 etc.
    The application's "archiving" method created and was thus aware of these tables and permitted searching within 'archived' data, but 3rd party reporting applications needed to see a view encompassing all data, regardless of the tables involved. The view automatically created was a 'union_all' of all tables concerned.

  • How to create index on a single parition

    Hi,
    I have a table which has got 7 partitons,I want to index only one partition how do it?
    i am using oracle 11g.Also i want to know if it is possible to create an index within a o partiotn only fr some values..
    Edited by: user8731258 on Jul 13, 2012 12:35 AM

    Hi,
    I've been thinking a bit about your requirement.
    One way could be to use the fact that index do not "store" nulls.
    Let's make a table with data :SQL> create table t
      2  (
      3  grp integer,
      4  id integer,
      5  val varchar2(10)
      6  )
      7  partition by range(grp)
      8  (
      9  partition p01 values less than (2)
    10  ,partition p02 values less than (3)
    11  ,partition p03 values less than (4)
    12  ,partition pXX values less than (maxvalue)
    13  );
    Table created.
    SQL> insert into t select 1+mod(level,4), level, dbms_random.string('a',10) from dual connect by level <= 200000;
    200000 rows created.
    SQL> select grp, count(*) cnt from t group by grp order by grp;
           GRP       CNT
          1     50000
          2     50000
          3     50000
          4     50000
    SQL> select grp, count(*) cnt from t group by grp order by grp;
           GRP       CNT
          1     50000
          2     50000
          3     50000
          4     50000
    SQL> begin
      2  dbms_stats.gather_table_stats(
      3  ownname => user,
      4  tabname => 'T',
      5  method_opt => 'for all columns size 1',
      6  granularity => 'global and partition',
      7  estimate_percent => null);
      8  end;
      9  /
    PL/SQL procedure successfully completed.
    SQL> select table_name, partition_name, num_rows from user_tab_partitions where table_name='T' order by partition_name;
    TABLE_NAME                 PARTITION_NAME               NUM_ROWS
    T                      P01                       50000
    T                      P02                       50000
    T                      P03                       50000
    T                      PXX                       50000Now let's say you only want to index P01.
    You could do it as follows :SQL> create index t_idx on t(decode(grp,1,id,null)) local;
    Index created.The index would only have IDs from partition P01.
    SQL> select INDEX_NAME, PARTITION_NAME, DISTINCT_KEYS
      2  from user_ind_partitions
      3  where index_name='T_IDX'
      4  order by partition_name;
    INDEX_NAME                 PARTITION_NAME                DISTINCT_KEYS
    T_IDX                      P01                          50000
    T_IDX                      P02                           0
    T_IDX                      P03                           0
    T_IDX                      PXX                           0
    SQL> select SEGMENT_NAME, PARTITION_NAME, BYTES
      2  from user_segments
      3  where SEGMENT_NAME='T_IDX'
      4  order by partition_name;
    SEGMENT_NAME                                               PARTITION_NAME                BYTES
    T_IDX                                                    P01                        1048576
    T_IDX                                                    P02                          65536
    T_IDX                                                    P03                          65536
    T_IDX                                                    PXX                          65536See, only the keys from P01 are here, and only the segment for P01 partition has grown <i>(the 65k segment for the others partitions come from default values of storage clause which I didn't specify)</i>.
    Now you can query your table in the following way.
    Instead of writing (for P01) : select * from t where grp=1 and id between 30 and 40;If you want to use the index on P01, you would do :SQL> select * from t where grp=1 and decode(grp,1,id,null) between 30 and 40;
           GRP        ID VAL
          1        32 hSrmmTYXXW
          1        36 xofKlsxORE
          1        40 vazRGnWzWc
    Execution Plan
    Plan hash value: 1186642050
    | Id  | Operation                  | Name  | Rows  | Bytes | Cost (%CPU)| Time        | Pstart| Pstop |
    |   0 | SELECT STATEMENT             |        |   125 |  2375 |      3   (0)| 00:00:01 |        |        |
    |   1 |  PARTITION RANGE SINGLE         |        |   125 |  2375 |      3   (0)| 00:00:01 |      1 |      1 |
    |*  2 |   TABLE ACCESS BY LOCAL INDEX ROWID| T        |   125 |  2375 |      3   (0)| 00:00:01 |      1 |      1 |
    |*  3 |    INDEX RANGE SCAN             | T_IDX |   225 |        |      2   (0)| 00:00:01 |      1 |      1 |
    Predicate Information (identified by operation id):
       2 - filter("GRP"=1)
       3 - access(DECODE("GRP",1,"ID",NULL)>=30 AND DECODE("GRP",1,"ID",NULL)<=40)The index is being used.
    +(also note that the grp value is "given" twice in the query : once explicitly, the other one within the decode.)+
    Now for a query like : SQL> select * from t where grp=2 and id between 30 and 40;
           GRP        ID VAL
          2        33 bhFrCYCiDb
          2        37 jnPauHJiyo
    Execution Plan
    Plan hash value: 2931986080
    | Id  | Operation            | Name | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |
    |   0 | SELECT STATEMENT       |      |     5 |    95 |    68     (0)| 00:00:01 |       |       |
    |   1 |  PARTITION RANGE SINGLE|      |     5 |    95 |    68     (0)| 00:00:01 |     2 |     2 |
    |*  2 |   TABLE ACCESS FULL    | T    |     5 |    95 |    68     (0)| 00:00:01 |     2 |     2 |
    Predicate Information (identified by operation id):
       2 - filter("ID"<=40 AND "ID">=30 AND "GRP"=2)The optimizer goes for a FULL TABLE (partition) SCAN.
    <b>NOTE :</b> That would also work with a global index.
    Of course, it remains a rather dirty tweak...
    ;-)

  • How to sort web dynpro table wich data bind to CAF Entity Service

    Hi
    I created UI Table based on Model Node (CAF Entity).
    When I try to sort this Table with using TableSorter, I  get following in the trace log:
    The error is: com.sap.caf.rt.exception.CAFBaseRuntimeException: Aspect does not support changing rows via its list interface
    Have I met CAF limitation, or do I do something wrong?

    Hi Nikolai,
    if you use the implementation
    <code>
    IServiceFacade serviceFacade = CAFServiceFactory.getServiceFacade(ts2Definition.class);
    </code>
    it means you use the typed access.
    Possible in this sneak the
    <code>
         IServiceFacade serviceFacade = CAFServiceFactory.getServiceFacade();
    </code>
    does not work.
    Try the following way - it must work.
    <code>
         private IServiceFacade getServiceFacade()  {
              final String method = "getServiceFacade()";
              entering(method);
              if (m_serviceFacade==null) {
                   try {
              CoolConnectionProperties properties = new CoolConnectionProperties()
                   public String getCoolHost()
                        return "caf";
                         m_serviceFacade = CoolUtils.getServiceFacade(properties);
                   } catch (CoolConnectionPropertiesException e) {
                        wdComponentAPI.getMessageManager().reportException(e.getMessage(),false);
                        CAFUIPublicLogger.traceThrowable(Severity.ERROR, method, e) ;
                   } catch (CoolUtilsException e) {
                        wdComponentAPI.getMessageManager().reportException(e.getMessage(),false);
                        CAFUIPublicLogger.traceThrowable(Severity.ERROR, method, e) ;
              exiting(method) ;
              return  m_serviceFacade;
    </code>
    Also do not sort in query. Sort the model node after you aspect binded. Use the method
    node.sort(your_comparator) ;
    the comparator like this:
    <code>
         public class YourComparator implements Comparator
           public int compare(Object o1, Object o2)
              IWDNodeElement nodeElement1 = (IWDNodeElement) o1 ;
              IWDNodeElement nodeElement2 = (IWDNodeElement) o2 ;
              String name1 = nodeElement1.getAttributeAsText(_attrName) ;
              String name2 = nodeElement2.getAttributeAsText(_attrName) ;
              if (name1 == null)
                   return -1 ;     
              if (name2 == null)
                   return 1 ;     
              if (_direction == "up")
                   return name1.compareToIgnoreCase(name2) ; 
              else if (_direction == "down")
                   return -name1.compareToIgnoreCase(name2) ;
              return 0 ;
           public void initilize(String attrName, String direction)
              _attrName = attrName ;
              _direction = direction ;
           private String _attrName ;
           private String _direction ;
    </code>
    Best regards,
    Aliaksei.

Maybe you are looking for

  • Creating a Full-Path Hyperlink in Adobe 9

    I need to create hyperlinks to files stored on our network. Our network automatically maps this location to a mapped drive on my computer, but maps other locations to the same mapped drives on other people's computers (I have to put it in this folder

  • Folio Orientation on iOS 7 with v24

    Hi, on IOS 7 older single edition apps (in my case built with v24 of the app builder), only portrait orientation is displayed, even when the device is rotated to landscape. The folio supports both orientations and iPad is not set to lock orientation.

  • Program for activating transformations

    Hi All, Can you plz tell me is there any standard program to activate transformations in BI. Thanks, Chella.

  • Forgot administrator name and password

    I cannot remember the administrator name and password that I set up when first using macbook pro. How can I find these?

  • How to make bank management system using java file system

    Hi, I have some fields 1.ID 2. Deposite 3. Withdraw 4. Balance Now how can i manage this Bank Management System using java file system. Thanks in advance.