Application Development and Automation 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: 
Read only

Difference between Tabletype and Structure

Former Member
0 Likes
13,098

Hi Everyone

Can anyone please tell me the difference between a Tabletype and a Structure

1 ACCEPTED SOLUTION
Read only

SantoshKallem
Active Contributor
3 REPLIES 3
Read only

Former Member
0 Likes
5,049

hi,

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.

In a simple words,

Structure is just a flat structure but Table type is an internal table.

Sample code how to use them to create internal table:

  • Create Internal table from a structure:

DATA: IT_DATA TYPE STANDART TABLE OF Structure.

  • Create Internal table from a table type:

DATA: IT_DATA TYPE table_type.

Regards,

gokul.

reward if usefull

Read only

varma_narayana
Active Contributor
5,049

Hi Prathiba..

Structure : It is a Data type used to define a stuctured data object like Work area.

DATA: WA1 TYPE <STRUCTURE>. "this will create a Work area

Table Type:It is a Data type used to define a Internal data object. It will store all the attributes to define an internal table, such as Table type, Key fields etc.

DATA: it1 TYPE <table type>. "this will create a Internal table

REWARD IF HELPFUL.

Read only

SantoshKallem
Active Contributor