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

diff b/w tables and structures

Former Member
0 Likes
1,421

plz can any one send the diff b/w tables and structures...

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,382

Hi kota sandy,

In general, Data / information should be stored for future use.

Tables :

1. The place where the data is stored so that you can retrieve at any time.

2. There can be more than one record stored

Structures :

1. The data / info stays only during the runtime of the application and will not get stored at all during the run time ....

2. Only one record can be stored at the runtime .....

Hope this also adds to the replies from other friends

Cheers

Kripa Rangachari.

14 REPLIES 14
Read only

suresh_datti
Active Contributor
0 Likes
1,382

Tables reside in the database & hold the data whereas structures help holding one record at a time during the runtime.

~Suresh

Read only

Former Member
0 Likes
1,382

hi,

the main difference between table and a structure is database base table lie on the underlying layer of the sap database where as structure doest not,

database table occupy memory but where as structure does not.

hope the answer the question.

Regards

fareed

Read only

Former Member
0 Likes
1,382

Hi

A table can contain multiple number of records in it ( as it is alloted with memory ) but a ABAP Dictionary Structure cannot hold any value with it ( as it doesnot have any memory allocated ).

A structure will however be allocated memory in an ABAP program, and this is during the run-time of the program.

Hope I am clear..

Ask again if the answer is not clear, else close the Thread.

Thanks.

Read only

Former Member
0 Likes
1,382

Hi,

<b>Tables:</b>a physical table definition is created in the database for the table

definition stored in the ABAP Dictionary.

<b>Structures:</b>Structures are used to define the data at the interface of module pools and screens and to define the parameter types of function modules.

Regards,

MD

Read only

Former Member
0 Likes
1,383

Hi kota sandy,

In general, Data / information should be stored for future use.

Tables :

1. The place where the data is stored so that you can retrieve at any time.

2. There can be more than one record stored

Structures :

1. The data / info stays only during the runtime of the application and will not get stored at all during the run time ....

2. Only one record can be stored at the runtime .....

Hope this also adds to the replies from other friends

Cheers

Kripa Rangachari.

Read only

0 Likes
1,382

Thanx a lot..i know this diff..can u still explain me with an example..so that i ll b more clear...

Read only

Former Member
0 Likes
1,382

Hi,

Example....

Say iam creating from SE11 (ABAP Dictionary) a,

<b>1. Table "ZTABLE" </b> and its fields are ....

1. Field1

2. Field2

3. Field3.

<b>2. Structure "ZSTRU</b> and its fields are .....

1. Field1

2. Field2

3. Field3.

I have written a program in which i have declared as follows :

-


COde -


1. Tables: ZTABLE,

2. Data : ls_zstru type zstru

lt_zstru type table of zstru.

Now, u can use this "ls_zstru" and append one by one row to the main table "ZTABLE".

like. ...

Loop at lt_zstru into ls_zstru.

.....

......

append ls_zstru to lt_zstru.

endloop.

Update .... ztable from lt_zstru.

-


COde -


Now, u can see that .... using the structure u can operate or work with ONE record per time and that too the record will be accessed / filled only at the runtime.....

where as u can append any number of entries to the table.

Hope this helps If not,

Could you please tell us, What kind of info you need on this ?

Cheers

Kripa Rangachari.

Kripa Rangachari

Read only

Former Member
0 Likes
1,382

hi,

table is an entity.that saves the data in a specified reference structure format.

but the structure is not able to effect data saving format in data base by it's own.

structure is defined in dictionary level itself.In relational data base the data is saved in table format and relations are saved in data base itself.but the sap environment makes some more distinct feature that it creates in dictionsary it self.

such that with central administration of data and synchronized with workbench.

i hope that this example helps u alot.

DATA: BEGIN OF line,

col1(1) TYPE c,

col2(1) TYPE c,

END OF line.

DATA: etab LIKE TABLE OF line WITH HEADER LINE,

ftab1 LIKE TABLE OF line.

line is a structure which is not created in data base level.

etab is a table of line structure but after activation it saves that structure in data base it self.

Message was edited by:

sunil kumar

Read only

Former Member
0 Likes
1,382

Hi,

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

Has Primary key and foreign key

1) Structure: It don't have data and no reelation with the database. No such keys

2) Table is a table that has been created in the database.

2) A structure is just a list of fields defined under a name. Structures are useful for painting screen fields, and for manipulating data that has a consistent format defined by a discrete number of fields.

Just have a look at these links:

/people/rich.heilman2/blog/2005/07/27/dynamic-internal-tables-and-structures--abap

https://www.sdn.sap.com/irj/sdn/advancedsearch?query=table%20and%20structure&cat=sdn_all

Regards,

Gunasree.

Read only

Former Member
0 Likes
1,382

hiii there are a lot of diiferences between tables and structures to name a few,

1. tables have a meta data (ie structure) and data but structures only have meta data. meta bata means the fields (matnr,mtart etc in material master)

2 tables hold some memory in data base, structures practically doesnot,

3. tables can have multiple lines but structures have only one,

in short structures are line a table header with only one row,

i hope now its clear

Read only

Former Member
0 Likes
1,382

Hi,

Structure is a blueprint or skeleton it won't hold values it is aline type of table.Defining a single structure we can create multiple number of tables.These can't be created but defined since these don't have any memory pointers.

Table is an abject it points to memory it holds values u can Define a structure with the linetype of the table.Tables are physical existing entities.

Think is helpful for u

Reward if found helpfull.

Regards,

Ravi Kumar

Read only

Former Member
0 Likes
1,382

Hi,

In viewing them there is a very little difference. Bcos a table is a description of actual data base i.e., it is a structure of a table in the database,,,,

Neverthless the major difference between them is :-

A table has an underlying database assaociated with it but a structure doesn't.

do reward the helpful answers..

Read only

Former Member
0 Likes
1,382

hi

A structure forms the skeleton of the table.

A structure comprises components i.e., 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

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.

regards,

kiran kumar k

Read only

Former Member
0 Likes
1,382

Hi

STRUCTURES : it does not contain any value.

You can create multple table fields.

It has no memory space.

TABLES: It hold data.

Different types of tables like Transparent,pooled....

All tables are containted memory....

Thanks...