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: 

Information about Table Type

Former Member
0 Kudos

Hi Guys,

What does Table Type mean?

What are uses of Table Type?

Regards,

Chandru

1 ACCEPTED SOLUTION

Former Member
0 Kudos

TABLE TYPE IS NOTHING BUT A DEFINITION OF DB TABLE.

Definition:

-


A table type is the data type of an internal table. It defines row type, table category, and table key of an internal table. The table can be generic regarding the key. A table type can be defined wit TYPES in an ABAP Program or in the ABAP Dictionary. In ABAP Dictionary, a table type must not be mixed up with database tables. The data type behind a database table is not a table type but a flat structure.

You can define a table type in your program something like this:

types: begin of tt_tab,

data1(10),

data2(30),

end of tt_tab,

ttt_tab type tt_tab occurs 0.

data: lt_tab type ttt_tab.

FOR USING IT IN SMARTFORM U HAVE TO DECLARE IT IN DATABASE(IE,CREATE IN se11) .unless u create it u cannot include in the interfac e definition of smartform.

And also check the below link for more information:

http://help.sap.com/saphelp_46c/helpdata/en/4f/991f82446d11d189700000e8322d00/frameset.htm

Please reward points if helpful.

Thank you.

5 REPLIES 5

Former Member
0 Kudos

TABLE TYPE IS NOTHING BUT A DEFINITION OF DB TABLE.

Definition:

-


A table type is the data type of an internal table. It defines row type, table category, and table key of an internal table. The table can be generic regarding the key. A table type can be defined wit TYPES in an ABAP Program or in the ABAP Dictionary. In ABAP Dictionary, a table type must not be mixed up with database tables. The data type behind a database table is not a table type but a flat structure.

You can define a table type in your program something like this:

types: begin of tt_tab,

data1(10),

data2(30),

end of tt_tab,

ttt_tab type tt_tab occurs 0.

data: lt_tab type ttt_tab.

FOR USING IT IN SMARTFORM U HAVE TO DECLARE IT IN DATABASE(IE,CREATE IN se11) .unless u create it u cannot include in the interfac e definition of smartform.

And also check the below link for more information:

http://help.sap.com/saphelp_46c/helpdata/en/4f/991f82446d11d189700000e8322d00/frameset.htm

Please reward points if helpful.

Thank you.

Former Member
0 Kudos

DATA: it1_mara type standard table of mara.

with header line and occurs 0 are forbidden on OO ABAP...Internal tables shouldn't have header lines...

When Initial it's because there's no record inside the table...Also, it have been created but nothing attached to it -:)

matt
Active Contributor
0 Kudos

In the data dictionary, you have data elements and structures, which you can use as types in your ABAP program. If you want a table of particular structures or data element, you can also define this in the data dictionary as a table type, and you can define your variable in ABAP as one of these types.

The table types defined in the data dictionary have exactly the same attributes as table types defined in ABAP. They can be STANDARD, HASHED, SORTED, and you can define that they have unique or non-unique keys, including TABLE_LINE keys.

STRING_TABLE is one standard SAP table type. If you define

DATA: lt_str TYPE string_table.

Then lt_str will be a STANDARD table of type STRING, with non-unique standard key.

The advantage of table types is that you can use them as parameters of Forms, methods, function modules etc. all defined in the data dictionary.

matt

former_member404244
Active Contributor

Former Member
0 Kudos

Hi

Analogous to the predefined ABAP types such as C or I , one may define user-defined types in the dictionary.

The following user-defined types are allowed

Data elements: Describe an elementary type by defining the data type, length and possibly decimal places.

Structures: Consist of components that can have any type.

Table types: Describe the structure of an internal table.

Elaboration on the type categories.

There are three different type categories in the ABAP Dictionary:

Data elements (elementary types) Elementary types have no structure. They describe the data type attributes (such as given Dictionary data type, number of places) and information that is relevant for the screen (such as title) of unstructured data objects (variables/fields).

Structures (structured types) Structured types describe the structure and functions of any structured data objects, that is of data structures with components of any type. A component can be a field with an elementary type or can itself be a structure. A table can also be used as a component in a structure. A database table always has a structure and is therefore implicitly a structured type. However, the fields of a database table can only have an elementary type.

Table types Table types describe the structure and functions of internal tables in the ABAP program. Their rows can have any row type. Table types with elementary row type therefore can be defined just the same as multi-dimensional table types (table types with a table type as row type) or table types using structures with table-like components.

Any complex user-defined type may be built using the

previously mentioned basic types.