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

table and structure

Former Member
0 Likes
2,508

friends,

pl give me some useful information on a table and a structure. how r they different. why we use some times a table and sometimes a structure.

thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,788

Hi

Table is used to store data with multiple records and exists in Database.

Structure basically doesn't store data , stores a record at run time, acting as a Work area

see the doc about different types of Tables

The following are the table types used in SAP :

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.

reward if useful

regards

Anji

Message was edited by:

Anji Reddy Vangala

9 REPLIES 9
Read only

Former Member
0 Likes
1,788

hi,

The <b>structure</b> that we create in program are workareas where we can store the data from internal tables.

They are similar to headerline of the internalt table.

We declare structure using data statement.

data : begin of itab,

ebeln like ekpo-ebeln,

ebelp like ekpo-ebelp,

end of itab.

Or we can declare a type.

types : begin of ttab,

ebeln like ekpo-ebeln,

ebelp like ekpo-ebelp,

end of ttab.

data : itab type ttab.

Or the header lines of the table can be used as workarea which are structure which have the same type

and same name as that of table.

data : itab type ttab with header-line.

<u>TABLE</u>

it is use to store data. There are mainly 2 types of table.

transparent and master table.

just go thru this link f0r more info.

Just go thorugh this link

http://help.sap.com/saphelp_46c/helpdata/EN/fc/eb35de358411d1829f0000e829fbfe/frameset.htm

Regards

'Reshma

Read only

Former Member
0 Likes
1,789

Hi

Table is used to store data with multiple records and exists in Database.

Structure basically doesn't store data , stores a record at run time, acting as a Work area

see the doc about different types of Tables

The following are the table types used in SAP :

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.

reward if useful

regards

Anji

Message was edited by:

Anji Reddy Vangala

Read only

Former Member
0 Likes
1,788

Hi,

Tables.

Use to store the permanent Values for the fields in the Table.

Structure

Values will be stored only at the Runtime.

Rewards points if it helpful.

Regards,

Sangeetha.A

Read only

Former Member
0 Likes
1,788

Hi,

Tables: It will store data and have the relation with the underlaying database

Has Primary key and foreign key

Structure: It don't have data and no relation with the database.

No key fields like primary keys and secondary keys. It contains components.

In simple words Tables(has key relationships)can hold data whereas structure has just fields in it ( w/o keys ) and doesnt contain data .

Regards,

Varun.

Read only

Former Member
0 Likes
1,788

hi,

we can use strcture for global existence.we can call the strcture in any program.

<b>Database table</b>

Tables can be defined independently of the database in the ABAP Dictionary. The fields of the table are defined together with their (database-independent) data types and lengths.

A table definition in the ABAP Dictionary has the following components:

Table fields: The field names and the data types of the fields contained in the table are defined here.

Foreign keys: The foreign keys define the relationships between this table and other tables.

Technical settings: The technical settings define how the table is created on the database.

Indexes: Indexes can be defined for the table to speed up data selection from the table.

There are three categories of database tables in the ABAP Dictionary.

A physical table definition is created in the database for the table definition stored in the ABAP Dictionary for transparent tables when the table is activated. The table definition is translated from the ABAP Dictionary to a definition of the particular database.

On the other hand, pooled tables and cluster tables are not created in the database. The data of these tables is stored in the corresponding table pool or table cluster. It is not necessary to create indexes and technical settings for pooled and cluster tables.

<b>Structure</b>

A structure (structured type) consists of components (fields) whose types are defined.

A component can have an elementary type, a structured type, a table type or a reference type.

Structures are used especially to define the data at the interface of module pools and screens and to define the types of function module parameters.

Structures that are used more than once can be changed centrally because they were defined centrall. The active ABAP Dictionary makes this change at all relevant locations. ABAP programs or screen templates that use a structure are automatically adjusted when the structure changes.

regards

Read only

Former Member
0 Likes
1,788

hi

a table is a structure which can hold some data

where as a structure cannot hold data

table occupies memory

structure does not

Read only

Former Member
0 Likes
1,788

Hi,

Data Base Tables are used to store Permanent data in the Data base.

Structures are used as work areas.

When we run standard Transactions, data is populated to structures during run time.

Reward if useful.

Thanks,

USR

Read only

Former Member
0 Likes
1,788

hi,

<b>Tables:</b>Tables can be defined independently of the database in the ABAP Dictionary. The fields of the table are defined with their (database-independent) data types and lengths.

When the table is activated, a physical table definition is created in the database for the table definition stored in the ABAP Dictionary. The table definition is translated from the ABAP Dictionary to a definition of the particular database.

<b>Structure:</b>A structure (structured type) comprises components (fields). Types are defined for the components A component can refer to an elementary type (via a data element or by directly specifying the data type and length in the structure definition), another structure or a table type. A structure can therefore be nested to any depth.

Structures are used to define the data at the interface of module pools and screens and to define the parameter types of function modules.

<b>plz reward points if helpful or if it solves ur query.</b>

Thanks

Chinmay

Read only

Former Member
0 Likes
1,788

thanks to all.. this is a super fast forum.. tried my best to give points.

thanks for the info.