Skip to Content
author's profile photo Former Member
Former Member

Re: Table declaration

hi,

i saw some table declaration like

GT_AGENTS TYPE STANDARD TABLE OF TT_AGENTS WITH DEFAULT KEY ,

Here what is meaning of Default key.

Please give me explanation

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Jun 19, 2008 at 05:21 AM

    The standard key is specified as DEFAULT KEY. The standard key fields of a structured row type are all fields that are neither numeric (i, p, f) nor table types. The standard key for non-structured row types is the entire table row if the row type itself is not a table type. If there is no relevant component that applies and the row type itself is a table type, the standard key remains empty. This is only possible for standard tables.

    Reward points if the above ans is useful...

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 19, 2008 at 05:24 AM

    Hi Santosh,

    Please check this link

    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb366d358411d1829f0000e829fbfe/content.htm

    Key

    You can specify the key <key> of an internal table as follows:

    [UNIQUE|NON-UNIQUE] KEY <col1> ... <col n>

    In tables with a structured line type, all of the components <coli> belong to the key as long as they are not internal tables or references, and do not contain internal tables or references. Key fields can be nested structures. The substructures are expanded component by component when you access the table using the key. The system follows the sequence of the key fields.

    [UNIQUE|NON-UNIQUE] KEY TABLE LINE

    If a table has an elementary line type (C, D, F, I, N, P, T, X), you can define the entire line as the key. If you try this for a table whose line type is itself a table, a syntax error occurs. If a table has a structured line type, it is possible to specify the entire line as the key. However, you should remember that this is often not suitable.

    [UNIQUE|NON-UNIQUE] DEFAULT KEY

    This declares the fields of the default key as the key fields. If the table has a structured line type, the default key contains all non-numeric columns of the internal table that are not and do not contain references or internal tables. If the table has an elementary line type, the default key is the entire line. The default key of an internal table whose line type is an internal table, the default key is empty.

    Specifying a key is optional. If you do not specify a key, the system defines a table type with an arbitrary key. You can only use this to define the types of field symbols and the interface parameters of procedures . For exceptions, refer to Special Features of Standard Tables.

    The optional additions UNIQUE or NON-UNIQUE determine whether the key is to be unique or non-unique, that is, whether the table can accept duplicate entries. If you do not specify UNIQUE or NON-UNIQUE for the key, the table type is generic in this respect. As such, it can only be used for specifying types. When you specify the table type simultaneously, you must note the following restrictions:

    You cannot use the UNIQUE addition for standard tables. The system always generates the NON-UNIQUE addition automatically.

    You must always specify the UNIQUE option when you create a hashed table.

    Besty regards,

    raam

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.