Creating table type

Hi,
I am new to ABAP, can any one tell me how to create Table type for a database table in se11.
Example, I created a table ZEMP in se11, now I want to create a table type for this table. How can I do this?
Thanks,
Satish

In SE11,  on initial screen, select Data Type radiobutton, enter your table type name, click create, select Table Type radiobutton, enter the attributes, click save.
Regards,
Rich Heilman

Similar Messages

  • How to create table type in SAP3.1i ?

    Hi Friends,
    Is it posible to create table type in SAP 3.1i server ?

    Hi amit,
    I think there were no table types in 3.1i. Still you can define a structured table, i.e.
    DATA: BEGIN OF SORT_SPFLI OCCURS 100,
            CARRID   LIKE SPFLI-CARRID,
            CONNID   LIKE SPFLI-CONNID,
            CITYFROM LIKE SPFLI-CITYFROM,
            CITYTO   LIKE SPFLI-CITYTO,
            SFLIGHT  LIKE SORT_SFLIGHT OCCURS 100,
          END OF SORT_SPFLI.
    You can use field-symbols, but no loop assigning.
    What is it you want to do?
    Anyway: Have fun with good old 3.1 - I put my old docu CD in the trash recently.
    Regards
    Clemens

  • Create Table type

    Hi All,
    How to create table type of record type which is declared in another package. For example,
    package a has record type lr_rec_type. i have to create table type of lr_rec_type in package b. how can this be done
    Thanks and Regards,
    Mahesh
    Edited by: magu on May 4, 2009 2:00 PM

    Are you looking for this?
    satyaki>
    satyaki>create or replace package bb_pack
      2  is
      3    type a is table of number;
      4    b a;
      5  end;
      6  /
    Package created.
    Elapsed: 00:00:01.07
    satyaki>
    satyaki>ed
    Wrote file afiedt.buf
      1  declare
      2    aa bb_pack.a;
      3  begin
      4    dbms_output.put_line('Executes');
      5* end;
    satyaki>/
    Executes
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.00
    satyaki>
    satyaki>Regards.
    Satyaki De

  • How to create table type

    I have created table type like this..
    type type_cname_tab is table of varchar2(20)
    index by binary_integer;
    i want to know that only 20 columns are added in this table type..

    i want to know that only 20 columns are added in this table type.. Maybe you may change it to a VARRAY type?
    Then
    SQL> declare
       type type_cname_tab is varray (20) of varchar2 (20);
       cname   type_cname_tab := type_cname_tab ();
    begin
       cname.extend (20);
    end;
    PL/SQL procedure successfully completed.
    But
    SQL> declare
       type type_cname_tab is varray (20) of varchar2 (20);
       cname   type_cname_tab := type_cname_tab ();
    begin
       cname.extend (21);
    end;
    Error at line 11
    ORA-06532: Subscript outside of limit
    ORA-06512: at line 6

  • Proble creating Table Type = Select in 10gR3

    In a very simple example case I have a customers table that I am trying to create a Table Type of Select in the physical layer.
    Using the Admin tool I create "New Physical tabe" and enter select * from customer where region = 'East'
    If I "Update All Row Counts" it now shows 56 rows - which is correct
    If I try and "view data" I get an error
    [nQSError: 17001] Oracle Error Code: 936, messgae: ORA-00936: missing expression at OCI cal OCIStmtExecute.
    [nQSError: 17010] SQL Statement preparation failed.
    If I deploy the view I can go to sqlplus and select from it.
    I have tried qualifying table name and selecting specific columns - I know its not a permission issue and presumably the fact that it counted rows correctly confirms it must have generated correct SQL.
    I'm puzzled - what am I missing here?

    This is standard behavior..Update Row Count work fine since SELECT COUNT (*) FROM (select * from customer where region = 'East') is a valid SQL, View Data doesn't work since your columns aren't named, so OBI cant select col1, col2, etc.
    Hope this explains.
    Michael
    Edited by: mkooloos on Jan 17, 2011 3:48 PM

  • Creating table types for procedures at design time: Where is the "Local Table Type" tab?

    Hello,
    I want to write a stored procedure (development perspective, repository object) and need to create a table type for the result table.I am working on HANA Studio 1.80.1 and the documentation tells me that I should open the "Local Table Types" tab. However, I do not see where this tab is.
    I get an SQLScript tab nothing else. Any hints?
    Regards,
    Andreas

    Hi ,
    Have a look on this discussion:
    Table type creation via HS repository / CDS / DDl Source
    Regards,
    Krishna Tangudu

  • How to create a table type context node

    Hi,
    I am trying to create table type context node. While creating, in the wizard no where I can see the option for this.
    Could you please let me know how can I do this?
    In one standard component: SRQM_INCIDENT_H, I can see multiple table type context nodes. Not sure how and why?
    Thanks,
    Sandeep

    HI Sandeep,
      When you right click on context node and create , a wizard will open. In that Wizard in one sreen it will ask for type of view. There you have to select Table View.
    Regards,
    Lakshmi.Y

  • Creation of a Table Type value set with 'ALL' as one of the  value

    Gurus,
    My requirement is to create [table type]value set which would show the [LOV]values in parameter of Conc Progr .
    So far we have three such values to chose from ,they are, 'Frozen', 'Pending' and 'Testing'. I achieved it.
    My question is ,
    if user wants to choose 'ALL' three values , how shall I accommodate it in this table type value set?
    Giving fourth option as ALL, which would eventually select 'ALL' three values 'Frozen', 'Pending' and 'Testing'.
    thanks in advance.
    -sDJ

    You can't have UNION in the value set.
    Try creating a view, which is having UNION with ALL.
    Check the following links.
    Table Value Set.
    ORA-00907 Missing Right Parenthesis in Value Set
    By
    Vamsi

  • Reg: Creation of Table Types

    Hi All,
    I have a small question regaridng the creation of Table type.
    Let us suppose I am creating Table type for a custom table zsample which is having 5 fields. I am generally creating a structure similar to custom table and using that structure as line type for the table type. Let us suppose if there are any changes in the custom table like change in the order of fields or if new fields are added the table type will give dump.
    My question is If I use the custom table itself as a line type, will there be any effect in the performance or some thing or I can go ahead and use it..
    Thanks,
    Ravee

    What dump are you expecting ???
    It is idea behind the creation with reference to get structures and tables which always look like
    the tables they refer to.
    I can not see a possibilty for a dump as long as you create only an internal table.
    A dump could appear, if the internal table is later used to update another db-table. But there it should be clear that the structure of an internal should be created with reference to the tables which they change.
    Siegfried

  • Table type row engine

    Hello,
    We are using procedures with table type:
    create type <type_name> as table (....)
    using explain plan we discover that it uses row engine.
    Is there an alternative??
    Thanks,
    Amir

    hi Srinivas,
    table type
    http://help.sap.com/saphelp_nw2004s/helpdata/en/90/8d7304b1af11d194f600a0c929b3c3/frameset.htm
    In SE11 you can create table type.
    This table type is similar to tables, but not the same way as you create tables. You can create table type with either Line type ( Nothing but a structure), Built-in ABAP types or Reference type. Assume that we have created one table type TYTAB with line type LITYP.
    So when you declare like this,
    DATA: ITAB type TYTAB - Now ITAB acts as a internal table of type TYTAB.
    DATA: LS_TYP TYPE LITYP - This LS_TYP now acts as a structure.
    So, it is clear that linetype and structure are one and the same.
    Regards,
    Santosh

  • Dynamically create a type

    Hi,
    is it possible to create dynamically a type ? I take a look on class CL_ABAP_TYPEDESCR but i can't create a new type, so is there a solution ?
    Cheers

    With all due respect to all, I think he means to create dynamic data types by means of RTTS.
    @ ToraTora
    Like this
    "example table
    DATA: BEGIN OF it OCCURS 3,
            pernr TYPE persno,
            kostl TYPE kostl,
            endda TYPE endda,
          END OF it.
    "data references
    DATA: r_type_struct TYPE REF TO cl_abap_structdescr,
          r_type_table  TYPE REF TO cl_abap_tabledescr,
          r_data_tab    TYPE REF TO data,
          r_data_str    TYPE REF TO data.
    " 1. ------------- filling example table IT
    it-pernr = '12345678'.
    it-kostl = '0112345678'.
    it-endda = sy-datum.
    APPEND it.
    it-pernr = '45678909'.
    it-kostl = '3452345678'.
    it-endda = sy-datum - 1.
    APPEND it.
    " 2. ------------ components structure type
    gs_comp-name = 'PERNR'.
    gs_comp-type ?= cl_abap_elemdescr=>describe_by_name( 'PERSNO' ).
    APPEND gs_comp TO gt_comp.
    gs_comp-name = 'KOSTL'.
    gs_comp-type ?= cl_abap_elemdescr=>describe_by_name( 'KOSTL' ).
    APPEND gs_comp TO gt_comp.
    gs_comp-name = 'BEGDA'.
    gs_comp-type ?= cl_abap_elemdescr=>describe_by_name( 'BEGDA' ).
    APPEND gs_comp TO gt_comp.
    " 3. ------------- create structure type
    TRY.
        r_type_struct = cl_abap_structdescr=>create(
                                  p_components = gt_comp ).
      CATCH cx_sy_struct_creation .
    ENDTRY.
    " 4. ------------- create table type
    TRY.
        r_type_table = cl_abap_tabledescr=>create( r_type_struct ).
      CATCH cx_sy_table_creation .
    ENDTRY.
    " 5. -------------- create table based on RTTS types
    CREATE DATA: r_data_tab TYPE HANDLE r_type_table,
                 r_data_str TYPE HANDLE r_type_struct.
    FIELD-SYMBOLS: <fs_table> TYPE INDEX TABLE,
                   <fs_wa>    TYPE ANY.
    ASSIGN: r_data_tab->* TO <fs_table>,
            r_data_str->* TO <fs_wa>.
    You can also create any component you want without knowledge about data element it is refering to (without using methods describe_by_name or describe_by_data ).
    So the 2nd step could be replaced with
    gs_comp-name = 'PERNR'.
    gs_comp-type ?= cl_abap_datadescr=>get_n( 8 ).   "PERNR if of type N(8)
    APPEND gs_comp TO gt_comp.
    gs_comp-name = 'KOSTL'.
    gs_comp-type ?= cl_abap_elemdescr=>get_c( 10 ).  "C(10)
    APPEND gs_comp TO gt_comp.
    gs_comp-name = 'BEGDA'.
    gs_comp-type ?= cl_abap_elemdescr=>get_d( ).   "D
    APPEND gs_comp TO gt_comp.
    Regards
    Marcin

  • 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.

  • 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

  • Create "Object" Type based on columns of a table

    Hi Experts
    is it possible to create an Object Type based on columns of a table?
    for example the syntax for creation of type is
    CREATE OR REPLACE TYPE temp_t
    AS OBJECT (ID number, code number)
    can we create a type that is based on columns of an existing table? so that we donot have to write down all the column names in each type as i have to create types based on 100 and above tables :-s
    Please help me out here!
    Best Regards

    You cannot do that Zia, check below code:
    SQL> create or replace type temp_t as object(object_name all_objects.object_name%TYPE);
      2  /
    Warning: Type created with compilation errors.
    SQL> sho err
    Errors for TYPE TEMP_T:
    LINE/COL ERROR
    0/0      PL/SQL: Compilation unit analysis terminated
    1/35     PLS-00201: identifier 'ALL_OBJECTS.OBJECT_NAME' must be declared

  • Creating abap program to develop and activate a global table type and global structure.

    Hi friends,
    I want to create and activate a global structure and global table type by coding in ABAP editor only. so can I do that anyhow.
    Please help me.
    Thanks in advance.

    Thanks guys for your fruitful replies, as most of you asked the main purpose of my question, the answer is as follows:
    in fact my purpose to do so is to create a function module that can fetch data dynamically from different database tables based on the codings in different abap program.
    for example: in one abap program i am coding as follows:
    tables: kna1.
    types: begin of itab,
              kunnr type kna1-kunnr,
              name1 type kna1-name1,
              end of itab.
    data: it_tab type standard table of itab,
             wa_tab type itab.
    similarly in other program i am coding as follows:
    tables: vbrp.
    types: begin of itab,
              posnr type vbrp-posnr,
              matnr type vbrp-matnr,
              arktx type vbrp-arktx,
              end of itab.
    data: it_tab type standard table of itab,
             wa_tab type itab.
    so now for both programs i want to call the same function module and fetch data as required in relative programs as mentioned above. in that case how to create that function module?

Maybe you are looking for

  • Impossible to install arch in UEFI mode on my Acer Aspire S3-391

    Hi there, I am trying to install arch-linux on my Acer Aspire S3-391, which came with a pre-shipped Windows 8. I am trying to make a dual boot, so I would like to keep the UEFI mode at startup. However, my computer won't boot on the Arch Linux USB Fl

  • Original iMac will not boot from new disk

    I am having considerable difficulty getting a new disk to boot in an original 'Bondi blue' iMac. I think I have researched this issue reasonably well and found a few references to it but no solution. I have more resources than most and have tried eve

  • Videos won't load !

    Hey all , I have a 2008 Macbook air and for some reason video just won't load anymore . This was originally my mom's , and when we wiped it and installed mavericks again everything started going slow. It's only 2gb ram , so I know that's a factor. Ne

  • Java.nio package Runtime error java.lang.UnsupportedClassVersionError.

    Hi I am using nio package and create a java program for file locking (FileLocking.java). Here is the sample try { file = new File("C:/acc.txt"); channel = new RandomAccessFile(file, "rw").getChannel();      lock = channel.lock(0, Long.MAX_VALUE, true

  • Minimize/Maximize Encoder window

    When loading Adobe Flash Media Encoder 2.5, the START encoding button appears below and mostly out of sight on the screen. Maximizing the window allows us to "click" the START encoding button. Forcing the program to run in Maximize mode by using the