Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

table type

Former Member
0 Kudos

Hi,

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

1 ACCEPTED SOLUTION

p190355
Active Contributor
0 Kudos

Hi,

1) In SE11 in Data Type Enter your Table type's name.

2) Click Create; Choose Table Type

The maintenance screen for Table types appears.

3) In Row Type , you can specify : a Data type/Data element/Structure

4) You can change:

The access mode as desired on the Access category.

Define the Key of the table type on the Key tab page.

5) Save and Activate the table type.

To start off, create a ztab_type with Structure, say zrow_type.

The Table type can be used in a pgm :

data it_tab type ztab_type.

data wa_tab type zrow_type.

Cheers,

Remi

7 REPLIES 7

p190355
Active Contributor
0 Kudos

Hi,

1) In SE11 in Data Type Enter your Table type's name.

2) Click Create; Choose Table Type

The maintenance screen for Table types appears.

3) In Row Type , you can specify : a Data type/Data element/Structure

4) You can change:

The access mode as desired on the Access category.

Define the Key of the table type on the Key tab page.

5) Save and Activate the table type.

To start off, create a ztab_type with Structure, say zrow_type.

The Table type can be used in a pgm :

data it_tab type ztab_type.

data wa_tab type zrow_type.

Cheers,

Remi

Former Member
0 Kudos

Hi,

see this link there is create table type hyper link in the bottom go for that.

http://help.sap.com/saphelp_nw04/helpdata/en/90/8d7304b1af11d194f600a0c929b3c3/frameset.htm

line type means that u can use just like a work area

see the example.

TYPES table_type TYPE struct_table.

DATA: table_wa TYPE table_type,

line_wa LIKE LINE OF table_wa.

...

LOOP AT table_wa INTO line_wa.

...

WRITE: line_wa-col1, line_wa-col1, line_wa-col1.

...

ENDLOOP.

rgds,

Hi.

Former Member
0 Kudos

Way: 1:

Go to SE84 --> Select ABAP Dict --> Table Types -->

Enter the short names like ORDER wih leading and ending * on the Table Types Field. ---> F8

This will bring all related entries of Table Types(Line Types) having ORDER has a part of its Name.

Way:2:

If you know the Table Name, then go SE11 --> Putch in the Table Name --> Press Display

Now put the cursor on the Table Name field, press CNTLSHFTF3, on the WHERE USED LIST Pop up, Select only the TABLE TYPE Option and press EXECUTE.

This will bring the Table Types and Line Types.

SAP Table Types

I. Transparent tables (BKPF, VBAK, VBAP, KNA1, COEP)

• Allows secondary indexes (SE11->Display Table->Indexes)

• Can be buffered (SE11->Display Table->technical settings) Heavily updated tables should not be buffered.

II. Pool Tables (match codes, look up tables)

• Should be accessed via primary key or

• Should be buffered (SE11->Display Table->technical settings)

• No secondary indexes

• Select * is Ok because all columns retrieved anyway

III. Cluster Tables (BSEG,BSEC)• Should be accessed via primary key - very fast retrieval otherwise very slow

• No secondary indexes

• Select * is Ok because all columns retrieved anyway. Performing an operation on multiple rows is more efficient than single row operations. Therefore you still want to select into an internal table. If many rows are being selected into the internal table, you might still like to retrieve specific columns to cut down on the memory required.

• Statistical SQL functions (SUM, AVG, MIN, MAX, etc) not supported

• Can not be buffered

IV. Buffered Tables (includes both Transparent & Pool Tables)

While buffering database tables in program memory (SELECT into internal table) is generally a good idea for performance, it is not always necessary. Some tables are already buffered in memory. These are mostly configuration tables. If a table is already buffered, then a select statement against it is very fast. To determine if a table is buffered, choose the 'technical settings' soft button from the data dictionary display of a table (SE12). Pool tables should all be buffered.

Table Types : A table type describes the structure and functional attributes of an internal table in ABAP. In ABAP programs you can reference a table type TTYP defined in the ABAP Dictionary with the command

DATA : itab TYPE TTYP.

Reafer these links below for clear ideas.

http://help.sap.com/saphelp_nw04/helpdata/en/fb/f14736a1f0ad1fe10000009b38f839/frameset.htm

http://help.sap.com/saphelp_nw04/helpdata/en/90/8d7304b1af11d194f600a0c929b3c3/frameset.htm

Thanks

Allot points if this helps!

Former Member
0 Kudos

hi,

just follow these steps.

1.Goto se11.

2.in the datatype u have an option 'table type'.

3. in the line type u can give ur ztable name for which u want to create a table type.(just give the table name) and then activate it.

regards,

bharathi.

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi

goto se11 transaction--->select datatype-->give name -


>create.

now u will get a pop up in that there is a radio button called TABLE TYPE -->continue.

now give short description and in line type give a structure which already exists.

u can create a structure through se11 only--->instead of TABLE TYPE u can select STRUCTURE-.

and call that in table type.

u can use table type as internal table.

Former Member
0 Kudos

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.