Define table type on runtime...Getting Error..

My requirement is to
I am trying to define table type on runtime. i.e. ortf_in_table_tbl{noformat}({noformat}i).field_position_rec.ortf_segment_field_name in below code.
But when I am executing below code and getting below error:
DECLARE
   CURSOR field_position_cur (p_table_name VARCHAR2)
   IS
      SELECT xosf.field_name, xosf.starting_position, xosf.field_length
        FROM record_types xort, record_segments xors, segment_fields xosf
       WHERE xort.record_type_id = xors.record_type_id
         AND xors.record_segment_id = xosf.record_segment_id
         AND xosf.table_name = p_table_name;
   CURSOR raw_data_cur
   IS
      SELECT *
        FROM raw_data;
   TYPE raw_data_typ IS TABLE OF raw_data_cur%ROWTYPE
      INDEX BY BINARY_INTEGER;
   TYPE table_typ IS TABLE OF emp%ROWTYPE
      INDEX BY BINARY_INTEGER;
   table_tbl      table_typ;
   raw_data_tbl   raw_data_typ;
BEGIN
   OPEN raw_data_cur;
   LOOP
      FETCH raw_data_cur
      BULK COLLECT INTO raw_data_tbl;
      EXIT WHEN raw_data_tbl.COUNT = 0;
      FOR i IN raw_data_tbl.FIRST .. raw_data_tbl.LAST
      LOOP
         FOR field_position_rec IN field_position_cur ('EMP')
         LOOP
            table_tbl (i).field_position_rec.field_name :=
               SUBSTR (raw_data_tbl (i).raw_line_text,
                       field_position_rec.starting_position,
                       field_position_rec.field_length
            DBMS_OUTPUT.put_line
                    (   'table_tbl (i).field_position_rec.field_name '
                     || table_tbl (i).field_position_rec.field_name
         END LOOP;
      END LOOP;
   END LOOP;
   CLOSE raw_data_cur;
FORALL i IN table_tbl.FIRST .. table_tbl.LAST
      INSERT INTO emp
           VALUES (table_tbl (i)
   COMMIT;
EXCEPTION
   WHEN OTHERS
   THEN
      DBMS_OUTPUT.put_line ('OTHERS ' || SQLERRM);
END;
**ORA-06550: line 61, column 52:**
**PLS-00302: component 'FIELD_POSITION_REC' must be declared**
**ORA-06550: line 54, column 13:**
**PL/SQL: Statement ignored**Here field_position_cur is giving me column name for the EMP table (i.e. field_position_rec.field_name) and field_position_cur is giving start and length to derive value of the that column
i.e.
SUBSTR (raw_data_tbl (i).raw_line_text,
                       field_position_rec.starting_position,
                       field_position_rec.field_length
                      )But it is giving me error. We are on 10g database.
Please suggest the solution to it.
Edited by: BluShadow on 12-Jan-2012 08:21
added {noformat}{noformat} and other tags to make it readable.  Please read {message:id=9360002} and learn to do this yourself.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

piyushgupta wrote:
My requirement is to
I am trying to define table type on runtime. Please explain - it is not clear from the code what you are attempting.
Also note that PL/SQL is strong typed language. This mean that you cannot define a variable using a weak type and at runtime change that into a formal data type.
In Oracle, the abstract AnyData data type can be used for unknown data types - and methods exist that allows different data types to be stored and retrieved as AnyData types. Of course, there are overheads involved in using an abstract data type (implemented as an object class) like this.
Another method is to use DBMS_SQL to create dynamic code (SQL or PL/SQL) - and perform dynamic binding (the bind determines the data type of the bind variable in the code). If the dynamic code is a SQL select, the describe interface enables you to determine the content (columns and data types) of the SQL projection.
The final method that comes to mind is using a RTTI (Run Time Type Information) interface - something that is also supported by Oracle (and basically the backend implementation of answering a describe interface call). This is however a bit more complex and quite specialised and needs a very unique problem to justify it being used.

Similar Messages

  • Syntax error when creating a user-defined table type in SQL Server 2012

    Why am I getting a syntax error when creating a user-defined table type in SQL Server 2014?
    CREATE TYPE ReportsTableType AS TABLE 
    ( reportId INT
    , questionId INT
    , questionOrder INT );
    Results:
    Msg 156, Level 15, State 1, Line 1
    Incorrect syntax near the keyword 'AS'.

    Hope these posts could help, 
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/37a45a9a-ed8c-4655-be93-f6e6d5ef44be/getting-incorrect-syntax-while-creating-a-table-type-in-sql-server-2008-r2?forum=transactsql
    Regards, Dineshkumar,
    Please Mark as Answer if my post answers your question and
    Vote as Helpful if it helps you

  • User-Defined Table Types - Where is it in SQL Server 2008?

    I am having 2 issues:
    1.  I don't see a folder for 'User-Defined Table Types' under programmability-->Types
    2.  When I execute the following code to create a Type; I get an error 'Incorrect syntax near the keyword 'AS'.'
    USE Locations;
    GO
    /* Create a user-defined table type */
    CREATE TYPE LocationTableType AS TABLE
    ( LocationName VARCHAR(50)
    , CostRate INT );
    GO

    Hi Shayann,
    The  user-defined table type is a new
    feature from SQL Server 2008. If you want to use it you have to upgrade your database to SQL Server 2008 or above.
    In you scenario(SQL Server 2005),as a workaround, you can use the  local temporary table instead. 
    --in SQL Server 2005
    CREATE TABLE tblType(id INT,name VARCHAR(99))
    GO
    CREATE PROC proc1
    AS
    BEGIN
    SELECT * FROM #temp;
    END
    GO
    SELECT * INTO #temp FROM tblType; -- the #temp name is fixed
    INSERT INTO #temp VALUES(1,'Eric');
    EXEC proc1
    --In SQL Server 2008 or above
    CREATE TYPE LocationTableType AS TABLE
    ( id INT,
    name VARCHAR(99) );
    GO
    CREATE PROC proc1 @t LocationTableType READONLY
    AS
    BEGIN
    SELECT * FROM @t
    END
    GO
    DECLARE @t LocationTableType;
    INSERT INTO @t VALUES(1,'Eric');
    EXEC proc1 @t
    I still suggest you upgrade to higher SQL Server.
    If you have any question, feel free to let me know.
    Best regards,
    Eric

  • How to reference a pre-defined table type in entity definition

    I have a Table Type brc.sapere.gso.DDL::domain.TIME_PERIOD defined.
    I try to use it in an entity definition. (dbcommon.hdbdd is attached.)
    But there is an error saying
    ERROR      brc/sapere/gso/DDL/dbcommon.hdbdd
               CDS activation failed;Full qualified names are not allowed
    How can I reference the table type?

    Kalhari wrote:
    Hi, Thanks, but I've seen this. What I need to know is if there is a way to map "user defined table type" specifically, which is a new SQL type introduced with SQL 2008.1. Depends on the database.
    2. Depends on the JDBC driver
    3. Depends on JDBC spec that it being used.

  • User defined table types sometimes show up a unknown data type in Profiler

    A couple of our users have a problem when using user defined table types. Calls are made using UDTT as variables and these are then passed to a stored procedure as parameters. Sometimes the application returns a timeout. In such situations a Profiler-Trace
    shows the following:
    declare @p4 unknown
    whereas the correct trace (that is sometimes displayed) should be:
    declare @p4 dbo.ReportFilterTableType
    ReportFilterTableType is a UDTT. The users do have correct permissions for the UDTT (otherwise they would never be usable for the user). What could be the reason that the data types for the variable
    @p4 in the example are sometimes returned as unknown and at other times are returned correctly as
    ReportFilterTableType? Could this possibly be a network related issue?
    Thank you.
    Graham Goodwin Email: [email protected]

    I know this is a old post, but i am also facing the same issue that too in my production server. Did you find any workarround for this issue. Please do reply. Critical problem we are facing.
    Alka, Is your problem timeouts when passing TVP parameters, or is it that a Profiler Trace shows type "unknown" for the TVP data type name?
    If your problem is timeouts, be aware that TVPs do not have statistics so the optimizer might not be able to generate an optimal plan for non-trivial queries. Declaring a primary key or unique constraint on the table type may help since that will provide
    useful cardinality information.  You may need to resort to hints in some cases.
    I suggest you start a new thread with details of your specific situation if the information in this thread doesn't help.
    Dan Guzman, SQL Server MVP, http://www.dbdelta.com

  • User defined table type output not coming

    hi all,
    i have a userdefined type delcared as:
    create or replace TYPE SAMPLE_SEARCH AS OBJECT (
    -- LIST OF VARIABLE NAMES AND RESPECTIVE DATA TYPE
    i have a user defined table type defined as:
    create or replace TYPE SAMPLE_SEARCH_TABLE IS TABLE OF SAMPLE_SEARCH;
    I have a stored proc which has an output paramter of type SAMPLE_sEARCH_TABLE.
    that is,
    sp_sample_proc(sample_search_tb OUT SAMPLE_SEARCH_TABLE);
    When i invoke the above stored proc from an anonymous pl/sql block , how can i display the contents of the output parameter using dbms_Output statements?

    Try this.........This is just a sample code.
    CREATE OR REPLACE TYPE address1 AS OBJECT
    (country VARCHAR2(1000),
    city VARCHAR2(1000),
    zip NUMBER,
    add1 VARCHAR2(4000),
    add2 VARCHAR2(4000));
    CREATE OR REPLACE TYPE t_addObj IS TABLE OF address1;
    CREATE OR REPLACE PROCEDURE Sp_Address_Obj(Out_Add_Obj OUT t_Addobj) IS
    v_Addobj t_Addobj := t_Addobj();
    BEGIN
    SELECT Address1(u.Object_Name,
    u.Object_Type,
    u.Object_Id,
    'Add01' || Rownum,
    'Add02' || Rownum) BULK COLLECT
    INTO v_Addobj
    FROM User_Objects u;
    Out_Add_Obj := v_Addobj;
    END Sp_Address_Obj;
    DECLARE
    v_Addobj t_Addobj := t_Addobj();
    BEGIN
    Sp_Address_Obj(v_Addobj);
    Dbms_Output.Put_Line(v_Addobj(1).City);
    FOR i IN 1 .. v_Addobj.Count LOOP
    Dbms_Output.Put_Line(v_Addobj(i).Country || '-' ||
    v_Addobj(i).City || '-' ||
    v_Addobj(i).Zip || '-' ||
    v_Addobj(i).Add1 || '-' ||
    v_Addobj(i).Add2);
    END LOOP;
    END;

  • How do i declare a user defined table type sproc parameter as a local variable?

    I have a procedure that uses a user defined table type.
    I am trying to redeclare the @accountList parameter into a local variable but it's not working and says that i must declare the scalar variable @accountList.this is the line that is having the issue: must declare the scalar variable @accountListSET @local_accountList = @accountListALTER PROCEDURE [dbo].[sp_DynamicNumberVisits] @accountList AS integer_list_tbltype READONLY
    ,@startDate NVARCHAR(50)
    ,@endDate NVARCHAR(50)
    AS
    BEGIN
    DECLARE @local_accountList AS integer_list_tbltype
    DECLARE @local_startDate AS NVARCHAR(50)
    DECLARE @local_endDate AS NVARCHAR(50)
    SET @local_accountList = @accountList
    SET @local_startDate = @startDate
    SET @local_endDate = @endDate
    CREATE TYPE [dbo].[integer_list_tbltype] AS TABLE(
    [n] [int] NOT NULL,
    PRIMARY KEY CLUSTERED
    [n] ASC
    )WITH (IGNORE_DUP_KEY = OFF)
    GO

    Why are you asking how to be an awful SQL programmer??  Your whole approach to SQL is wrong.
    We have a DATE data type so your insanely long NVARCHAR(50) of Chinese Unicode strings is absurd. Perhaps you can post your careful research on this? Can you post one example of a fifty character date in any language? 
    The use of the "sp_" prefix has special meaning in T-SQL dialect. Good SQL programmers do not use CREATE TYPE for anything. It is dialect and useless. It is how OO programmers fake it in SQL. 
    The design flaw of using a "tbl-" prefix on town names is called "tibbling" and we laugh at it. 
    There are no lists in RDBMS; all values are shown as scalar values. First Normal Form (1NF)? This looks like a set, which would have a name. 
    In any -- repeat any -- declarative programming language, we do not use local variables. You have done nothing right at any level. You need more help than forum kludges. 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Table Maintainance Generated but getting error when running SM30

    Hi Experts,
    I am modifying existing ZTable with around 31 fields and Maintainance was not allowed before also no Table maintainance was there. Now i have changed the attributes to allow maintainance and tried creating Table Maintainance generator.
    The TMG get created sucessfully but get error message when running SM30 for the Ztable with Run time error saying Coversion Error .
    Error Analysis says :
    Program SAPLZNMSLG attempted to display the fields of screen 0005 and error occured during the coversion of this data.
    Can any one let me know what happened? Expecting replies at the earliest.
    Thanks
    Smita

    Hi,
    In Text I/O Template Tab each field name will be there with Column- Name, Type  and Text Or I/O Field
    Go to Text OR I/O Field (Fields Wherever u have negative value).
    Name                     Type         Text Or I/O Field
    vbak-menge         I/O                _.___.___.___,____V
    Just add existing blank field ending with V.
    Regards,
    Nandha

  • Can i return a SYS_REFCURSOR from a programmer defined TABLE type in a fn?

    Good morning,
    I have a function that i declared a record type, and corresponding table type for that record in.
    Throughout my function , i populate my record type, then add the record to the table.
    At the end of my function, i'd like to return a sys_refcursor to my table.
    is that possible?
    everything seems to work up until i try to create a cursor from the table. my records populate the table successfully, and i can use a for loop at the end of my fn() to iterate through the table and echo out my data to dbms_output. what i'd like to do instead, is pass a cursor to my table to the caller of the function.
    works:
    FOR i IN t_my_tab.FIRST .. t_my_tab.LAST
    LOOP
    DBMS_OUTPUT.put_line('record: ' || t_my_tab(i).fieldname);
    END LOOP;
    doesn't work:
    OPEN my_cur FOR select fieldname from t_my_tab;
    RETURN my_cur;

    Bad idea.
    Why? Because this so-called "table" is in fact a PL/SQL array. It resides in the PGA - dedicated memory belonging to the Oracle process running the PL/SQL code.
    Now you want to open a refcursor against it - this only works against SQL data. So the data needs to be shipped from the PL/SQL engine to the SQL engine. Then a cursor needs to be created against the temporary set of data in memory.
    This is slow. This is cumbersome. The SQL Engine's "temporary data" structure is called a global temporary table. This is a proper SQL table - not a very simplistic array structure that has to be twisted into looking like a SQL table. It already resides in the SQL engine.
    The best place for data in Oracle is in a SQL table.
    So why then use PL/SQL arrays? For the same reason as you would use them in Pascal, C/C++, Java, Visual Basic, Cobol, Fortran, etc. Dealing with local program specific data and data structures - not as a stand-in for a SQL table.
    And as soon as you contemplate running a SQL against a PL/SQL array, you must ask yourself if this is the correct thing to do. 99% of the time, the answer will be "No. This is the Wrong Thing to Do".

  • How to pass a user defined table type to stored procedure?

    Hi,
    I am trying to call a stored procedure from Java. The store procedure has three IN parameter, 2 IN/OUT params and 3 OUT parameters. The two IN/OUT parameters are user defined objects. Can anyone tell me how to set these IN/OUT parameters in Java.
    Thanks

    It is database/driver specific so you need to use the specific functionality of the driver (not jdbc) to access it.

  • Dynamic table type generation at runtime

    Hi,
    Is there any way by which I can generate the table types at runtime.
    I am fetching table_name from all_tables and according to the table_name fetched from all_tables, I want to generate a table type for the same (eg. some thing like mentioned below) :
    TYPE v_tablename(int_tablecounter)||'_typ' IS TABLE OF v_tablename(int_tablecounter)%ROWTYPE INDEX BY BINARY_INTEGER
    thanks,
    aks

    Hello aks,
    did you try
      1  Declare
      2    v_CNT   NUMBER       := 1;
      3    v_TABLE VARCHAR2(30) := 'TEST';
      4    v_STMT  VARCHAR2(500);
      5  Begin
      6    v_STMT := ' DECLARE '||
      7              '   TYPE TAB'||v_CNT||' IS TABLE OF '||v_TABLE||'%ROWTYPE INDEX BY PLS_INTEGER;'||
      8              '   v_TAB'||v_CNT||' TAB'||v_CNT||';'||
      9              ' BEGIN'||
    10              '   v_TAB'||v_CNT||'(1).ID   := 1;'||
    11              '   v_TAB'||v_CNT||'(1).COL  := ''TEST'';'||
    12              '   P.L ( v_TAB'||v_CNT||'(1).COL );'||
    13              ' END;';
    14    EXECUTE IMMEDIATE v_STMT;
    15* End;
    bprechtl@DEV01>
    bprechtl@DEV01> /
    TEST
    PL/SQL-Prozedur wurde erfolgreich abgeschlossen.
    bprechtl@DEV01>And did you like it? ;-)
    Bernd

  • Table type & Structure

    Hi Experts. I have created on structure in DDIC and one table type.I have one class and within class from method I am passing the values of select statement threw the table type to my main program of se38.I need the syntax to use the structure and 'table type' and both get populated form the class method.

    Hi
    U need to define an internal table just like your TABLE TYPE:
    DATA: ITAB TYPE <TABLE TYPE>.
    and a work area like the LINE TYPE of the TABLE TYPE:
    DATA: WA TYPE <LINE TYPE>.
    Now you can read, update that table just like an internal table without the header line.
    So:
    WA-FIELD1 = ....
    WA-FIELD2 = ....
    WA-FIELDN = ....
    APPEND WA TO ITAB.
    Max

  • Getting error during write back operation in OBIEE

    Hi Experts
    I have implemented the Write back operation in OBIEE . My xml code is
    <?xml version="1.0" encoding="utf-8"?>
    <WebMessageTables xmlns:sawm="com.siebel.analytics.web/message/v1">
    <WebMessageTable lang="en-us" system="WriteBack" table="Messages">
    <WebMessage name="NEW">
    <XML>
    <writeBack connectionPool="Connection Pool">
    <insert> </insert>
    <update>UPDATE ACCT_DIM SET HIPC_FLAG='@{c5}' WHERE ACCT_SR_KEY=@{c0} </update>
    </writeBack>
    </XML>
    </WebMessage>
    </WebMessageTable>
    </WebMessageTables>
    But i am getting error when i will click on Write Back Button.
    An error occurred while writing to the server. Please check to make sure you have entered appropriate values. If the problem persists, contact your system administrator.
    Odbc driver returned an error (SQLExecDirectW).
    Error Details
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 27024] The EXECUTE PHYSICAL statement must specify a physical SQL statement to execute. (HY000)
    SQL Issued: EXECUTE PHYSICAL CONNECTION POOL "Connection Pool"
    Please suggest me how to remove this error.
    Thanks In advance
    Rehards
    Sunil

    Hi experts
    This is my xml code but i am not able to update records in my database. is there any changes required in this xml.
    <?xml version="1.0" encoding="utf-8"?>
    <WebMessageTables xmlns:sawm="com.siebel.analytics.web/message/v1">
    <WebMessageTable lang="en-us" system="WriteBack" table="Messages">
    <WebMessage name="new">
    <XML>
    <writeBack connectionPool="Connection Pool">
    <insert> </insert>
    <update>UPDATE ACCT_DIM SET HIPC_FLAG='@{c4}' WHERE ACCT_SR_KEY=@{c0} </update>
    </writeBack>
    </XML>
    </WebMessage>
    </WebMessageTable>
    </WebMessageTables>
    My table name in database is ACCT_DIM and i am updating HIPC_FLAG in my table.
    I am getting error:
    An error occurred while writing to the server. Please check to make sure you have entered appropriate values. If the problem persists, contact your system administrator.
    Odbc driver returned an error (SQLExecDirectW).
    Error Details
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. NQODBC SQL_STATE: HY000 nQSError: 10058 A general error has occurred. nQSError: 27024 The EXECUTE PHYSICAL statement must specify a physical SQL statement to execute. (HY000)
    SQL Issued: EXECUTE PHYSICAL CONNECTION POOL "Connection Pool"
    Thanks in advance
    Regards
    Sunil

  • Table type

    Hi,
       I dont know how to create table type through se11. what is line type. please help me.

    hi,
    Self-Defined Table Types
    You can start a screen sequence from an ABAP program using
    TYPES dtype TYPE|LIKE tabkind OF linetype [WITH key] ... .
    This defines an internal table type with access type tabkind, line type linetype and key key. The line type linetype can be any known data type. Specifying the key is optional. Internal tables can thus be generic.
    Internal Tables
    The syntax for declaring an internal table directly as a data type of a variable is the same as you would use to define one using the TYPES statement:
    DATA itab TYPE|LIKE tabkind OF linetype [WITH key] ... .
    The variable itabis declared as an internal table with access type tabkind, line type linetype, and key key. The line type linetype can be any known data type.
    For more information, refer to Internal Tables.
    Range Tables
    Using the statements:
    TYPES dtype {TYPE RANGE OF type}|{LIKE RANGE OF dobj} ... .
    DATA rtab {TYPE RANGE OF type}|{LIKE RANGE OF dobj} ... .
    you can define a special table type as a separate data type for Range tables, or as an attribute of the data object rtab of the type standard table, with a standard key and a specially structured line type.
    For more information on Range Tables see the keyword documentation.
    PROGRAM demo_internal_table.
    TYPES: BEGIN OF mytext,
             number TYPE i,
             name   TYPE c LENGTH 10,
           END OF mytext.
    TYPES mytab TYPE STANDARD TABLE OF mytext WITH DEFAULT KEY.
    DATA text TYPE mytext.
    DATA itab TYPE mytab.
    text-number = 1. text-name = 'John'.
    APPEND text TO itab.
    text-number = 2. text-name = 'Paul'.
    APPEND text TO itab.
    text-number = 3. text-name = 'Ringo'.
    APPEND text TO itab.
    text-number = 4. text-name = 'George'.
    APPEND text TO itab.
    LOOP AT itab INTO text.
      WRITE: / text-number, text-name.
    ENDLOOP.
    This program produces the following output on the screen:
    1  John
    2  Paul
    3  Ringo
    4  George
    In this example, first a data type mytext is defined as a structure. Then, a data type mytab is defined as an internal table with the line type mytext. The data objects text and itab  are declared with reference to the internal data types mytext und mytab. This lines of the internal table itab are generated dynamically with the APPEND statement. The contents of the internal table itab are written to the list using the structure text.
    Internal Tables
    Internal tables provide a means of taking data from a fixed structure and storing it in working memory in ABAP. The data is stored line by line in memory, and each line has the same structure. In ABAP, internal tables fulfill the function of arrays. Since they are dynamic data objects, they save the programmer the task of dynamic memory management in his or her programs. You should use internal tables whenever you want to process a dataset with a fixed structure within a program. A particularly important use for internal tables is for storing and formatting data from a database table within a program. They are also a good way of including very complicated data structures in an ABAP program.
    Data Type of an Internal Table
    The data type of an internal table is fully specified by its line type, key, and table type.
    Line Type
    The line type of an internal table can be any data type. The data type of an internal table is normally a structure. Each component of the structure is a column in the internal table. However, the line type may also be elementary or another internal table.
    Key
    The key identifies table rows. There are two kinds of key for internal tables - the standard key and a user-defined key. You can specify whether the key should be UNIQUE or NON-UNIQUE. Internal tables with a unique key cannot contain duplicate entries. The uniqueness depends on the table access method.
    At tables with structured row type, the standard key is formed from all character-type columns of the internal table. If a 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. At tables with non-structured row type, the standard key consists of the entire row. If the row type is also a table, an empty key is defined.
    The user-defined key can contain any columns of the internal table that are no internal table themselves, and do not contain internal tables. References are allowed as table keys. Internal tables with a user-defined key are called key tables. When you define the key, the sequence of the key fields is significant. You should remember this, for example, if you intend to sort the table according to the key.
    Table type
    The table type determines how ABAP will access individual table entries. Internal tables can be divided into three types:
    Standard tables have an internal linear index. From a particular size upwards, the indexes of internal tables are administered as trees. In this case, the index administration overhead increases in logarithmic and not linear relation to the number of lines. The system can access records either by using the table index or the key. The response time for key access is proportional to the number of entries in the table. The key of a standard table is always non-unique. You cannot specify a unique key. This means that standard tables can always be filled very quickly, since the system does not have to check whether there are already existing entries.
    Sorted tables are always saved sorted by the key. They also have an internal index. The system can access records either by using the table index or the key. The response time for key access is logarithmically proportional to the number of table entries, since the system uses a binary search. The key of a sorted table can be either unique or non-unique. When you define the table, you must specify whether the key is to be UNIQUE or NON-UNIQUE. Standard tables and sorted tables are known generically as index tables.
    Hashed tables have no linear index. You can only access a hashed table using its key. The response time is independent of the number of table entries, and is constant, since the system access the table entries using a hash algorithm. The key of a hashed table must be unique. When you define the table, you must specify the key as UNIQUE.
    Generic Internal Tables
    Unlike other local data types in programs, you do not have to specify the data type of an internal table fully. Instead, you can specify a generic construction, that is, the key or key and line type of an internal table data type may remain unspecified. You can use generic internal tables to specify the types of field symbols  and the interface parameters of procedures . You cannot use them to declare data objects.
    Internal Tables as Dynamic Data Objects
    Internal tables are always completely specified regarding row type, key and access type. However, the number of lines is not fixed. Thus internal tables are dynamic data objects, since they can contain any number of lines of a particular type. The only restriction on the number of lines an internal table may contain are the limits of your system installation. The maximum memory that can be occupied by an internal table (including its internal administration) is 2 gigabytes. A more realistic figure is up to 500 megabytes. An additional restriction for hashed tables is that they may not contain more than 2 million entries. The line types of internal tables can be any ABAP data types - elementary, structured, or internal tables. The individual lines of an internal table are called table lines or table entries. Each component of a structured line is called a column in the internal table.
    Choosing a Table Type
    The table type (and particularly the access method) that you will use depends on how the typical internal table operations will be most frequently executed.
    Standard tables
    This is the most appropriate type if you are going to address the individual table entries using the index. Index access is the quickest possible access. You should fill a standard table by appending lines (ABAP APPENDstatement), and read, modify and delete entries by specifying the index (INDEX option with the relevant ABAP command). The access time for a standard table increases in a linear relationship with the number of table entries. If you need key access, standard tables are particularly useful if you can fill and process the table in separate steps. For example, you could fill the table by appending entries, and then sort it. If you use the binary search option (BINARY) with key access, the response time is logarithmically proportional to the number of table entries.
    Sorted tables
    This is the most appropriate type if you need a table which is sorted as you fill it. You fill sorted tables using the INSERTstatement. Entries are inserted according to the sort sequence defined through the table key. Any illegal entries are recognized as soon as you try to add them to the table. The response time for key access is logarithmically proportional to the number of table entries, since the system always uses a binary search. Sorted tables are particularly useful for partially sequential processing in a LOOP if you specify the beginning of the table key in the WHEREcondition.
    Hashed tables
    This is the most appropriate type for any table where the main operation is key access. You cannot access a hashed table using its index. The response time for key access remains constant, regardless of the number of table entries. Like database tables, hashed tables always have a unique key. Hashed tables are useful if you want to construct and use an internal table which resembles a database table or for processing large amounts of data.
    regards,
    sreelakshmi.

  • Pre defined set types are not determined in CAtegory

    Hi all,
    when i try to create a category for a service product for SLA, the pre defined set types are not getting populated for me.
    I have created a new hierarchy, assigned to product and product type.....
    but still when i create a category the list of predefined some of the predefined set types are not getting displayed.
    Can anyone help this issue.
    kindly advice in this regard.
    Thanks,
    Subhashini.

    Hi,
    Thanks for the reply.
    I have assigned the product type service in the category.
    This is the only custom category available. only one std category has this set types. other than that nothing is there in the system.
    is there any services that has to be activated or any authorization that is missing for me...
    nut i have sap_all...could not able to trace out the problem.
    kindly guide.
    thanks,
    Subhashini.

Maybe you are looking for

  • I can't view my photo library after upgrading to version 9.1.3.. How do I fix?

    I recently updated my iphoto to verson 9.1.3. Now when I open up the application, it says "Your photo library will not be readable by previous versions of iPhoto after the upgrade." It then gives me a option to click upgrade. Once I click it, It says

  • When i update my backeup my all softower are missing in my phone

    when i update my backeup my all downlood softower are missing in my iphone phone. now i an out of UK. please call me 008801712793730

  • "This wav file could not be read"

    I have a DL project with 30 timelines. It has been playing and burning fine for the last 4 months--I've just been tweaking menus and replacing some of the assets with newer encodes. Yesterday when I attempted to preview I got the message "this wav fi

  • Should I upgrade to Snow?

    I'm thinking in buying the Snow Leopard, but I'm having doubts about this upgrade. At this moment my Macbook pro works like a charm. Is the process of upgrading from 10.5.8 to Snow with no problems? What do I really win in upgrading? I'm a graphic De

  • Error when undate solution manager from 700 to 701(700 enp1)

    Hi all, error when undate solution manager from 700 to 701(700 enp1),error:OCS package SAPKITL428 does not match the current software component vector. My current supportstack is as follows : SAP_ABA 700 0016 SAPKA70016 SAP_BASIS 700 0016 SAPKB70016