Hi,
<b>Structures (structured types)</b>
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.
<b>Table types</b>
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,
Difference between structure and table type is
Table type
The table type specifies how you can access individual table rows via ABAP.
Generally all internal tables are treated as table types.
There are different types of table types like standard,sorted and hashed.
Internal tables are used only during program execution i.e data flows into internal table only during program execution.
Data manipulations in internal table during debugging will not effect database.No memory is allocated for table types like internal table.
structure
Structure contains data only when it is inserted in database table using append or include.
We change the data in structure which will effect Database.
Memory is allocated to structure only when it is included in table using append or include.
Add a comment