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

Structure & Internal Tables

Former Member
0 Likes
3,548

What is the difference between Structure & Internal Tables,

Regards.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,601

both are contains information at run time only.

only one difference is that at run time sturcture contains only one record, internal table can contain more than one record (many no of records)

Madhavi

13 REPLIES 13
Read only

Former Member
0 Likes
2,602

both are contains information at run time only.

only one difference is that at run time sturcture contains only one record, internal table can contain more than one record (many no of records)

Madhavi

Read only

Former Member
0 Likes
2,601

Structure can store only one record. Itself can be considered as workarea.

Internal Table can contain many records. Contains Header Line as workarea.

awrd points if helpful

Bhupal

Read only

Former Member
0 Likes
2,601

Hi,

Structure meant for GLOBAL EXISTANCE(these could be used by any other program without creating it again).

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.

It can hold only one record.

tables: There is a physical table on the database for each transparent table.

The names of the physical tables and the logical table definition in the ABAP/4 Dictionary correspond.

All business data and application data are stored in transparent tables.

It can hold lot of records.

Pls. reward if useful.

Read only

Former Member
0 Likes
2,601

hi,

Structure during runtime contails only one record

but internal table during runtime contails no of records

Read only

Former Member
0 Likes
2,601

Internal Table :

is a structure which is defined with a 'OCCURS 0' extension with the definition of the structure and can hold data.

Structure:

is a definition with the field details and which can not hold any data in it.

in the case given by you:

1) Data: lt_filetable TYPE filetable, (Table type)

The 'filetable' is a table declaration with 'OCCURS 0' parameter.

2) ls_file TYPE file_table. (Structure).

the 'file_table' is a structure definition.

Rewards if useful.

Read only

Former Member
0 Likes
2,601

Hi

internel tables are created in the programming itself and the data are read from the application level. Internel tables of one program cant be used in other programs. But structures once you create you can use it again and again.

There are theree types of structure:-

1. Flat structure( elementry fields)

2. Nested structure ( type reference to other structure)

3. deep structure ( type reference to database tables)

with regards,

sowjanya.gosala

Read only

Former Member
0 Likes
2,601

hi chidambar,

these are some differneces ---

internel tables are created in the programming itself and the data are read from the application level. Internel tables of one program cant be used in other programs. But structures once you create you can use it again and again.

There are theree types of structure:-

1. Flat structure( elementry fields)

2. Nested structure ( type reference to other structure)

3. deep structure ( type reference to database tables)

Internal Table can have multiple records where as strcuture can only have a single record.

Structure is used to see the what are the records are available in database.

But internal table is used to store the records from database.It stored in temporary storage. We can work with intenal table records instead of database.

if we declare structure with TYPE then it is only a definition.

if we declare structure with DATA then it creates objet and contains one record.

it we declare structure with TABLE OF then it creates internall table of initial size.

internall table must create through standard tables or structures only

Structure is does not exit at the underlaying data base system level , it is exit only data dictionary level.

Read only

Former Member
0 Likes
2,601

hi Chindambar,

Internal tables provide a means of taking data from a fixed structure and storing it in working memory in ABAP. The data is stored line by line in memory, and each line has the same structure. In ABAP, internal tables fulfill the function of arrays. Since they are dynamic data objects, they save the programmer the task of dynamic memory management in his or her programs. You should use internal tables whenever you want to process a dataset with a fixed structure within a program. A particularly important use for internal tables is for storing and formatting data from a database table within a program. They are also a good way of including very complicated data structures in an ABAP program.

Like all elements in the ABAP type concept, internal tables can exist both as data types and as data objects A data type is the abstract description of an internal table, either in a program or centrally in the ABAP Dictionary, that you use to create a concrete data object. The data type is also an attribute of an existing data object.

Structures are freely-definable reports that consist of combinations of characteristics and basic key figures (for example, as calculated or restricted key figures) of the InfoCube. A structure can be a plan / actual comparison or a contribution margin schema, for example.

You can use structures in several different queries. To do this, you have to save the InfoCube that you want to use again. These structures are then called reusable structures.

So it is easier to tell the difference, structures that are not saved as reusable structures are called local structures. Local structures are only used in one query.

Reward if helpful.

Thankyou,

Regards.

Read only

Former Member
0 Likes
2,601

hi,

Structure or work area contains only one record.

Internal table contains more than one record.

Read only

Former Member
0 Likes
2,601

HI,

Structure can hold only one record if u want to hold multiple records then u should go for internal table

data:

it_tab like standard table of splfi.

this statement creates the internal table which holds multiple lines

data:

fs_stru like standard line of spfli.

this statement creates structure which holds single line

plzz reward if it is usefull to u..

plzz dont forget to reward....

Read only

Former Member
0 Likes
2,601

Hi chidambar,

to say simply the internal table can have data within it but a structure is that which can be used by an internal table to define its columns ,it cannot have data on its own

coming to thoery this may help you,but dont confuse more with the theory

Structures

A structure is a sequence of any elementary types, reference types, or complex data types.

You use structures in ABAP programs to group work areas that logically belong together. Since the elements of a structure can have any data type, structures can have a large range of uses. For example, you can use a structure with elementary data types to display lines from a database table within a program. You can also use structures containing aggregated elements to include all of the attributes of a screen or control in a single data object.

The following terms are important when we talk about structures:

Nested and non-nested structures

Flat and deep structures

A nested structure is a structure that contains one or more other structures as components. Flat structures contain only elementary data types with a fixed length (no internal tables, reference types, or strings). The term deep structure can apply regardless of whether the structure is nested or not. Nested structures are flat so long as none of the above types is contained in any nesting level.

Any structure that contains at least one internal table, reference type, or string as a component (regardless of nesting) is a deep structure. Accordingly, internal tables, references, and strings are also known as deep data types. The technical difference between deep structures and all others is as follows. When you create a deep structure, the system creates a pointer in memory that points to the real field contents or other administrative information. When you create a flat data type, the actual field contents are stored with the type in memory. Since the field contents are not stored with the field descriptions in the case of deep structures, assignments, offset and length specifications and other operations are handled differently from flat structures.

Internal Tables

Internal tables consists of a series of lines that all have the same data type. Internal tables are characterized by:

The line type, which can be any elementary type, reference type, or complex data type.

The key identifies table rows. It is made up of the elementary fields in the line. The key can be unique or non-unique.

The access method determines how ABAP will access individual table entries. There are three access types, namely unsorted tables, sorted index tables and hash tables. For index tables, the system maintains a linear index, so you can access the table either by specifying the index or the key.

Hashed tables have no linear index. You can only access hashed tables by specifying the key. The system has its own hash algorithm for managing the table.

You should use internal tables whenever you need to use structured data within a program. One imprint use is to store data from the database within a program.

plz reward if helpful,

plz get back to me for further queries.

thanks and regards,

srikanth tulasi.

Read only

Former Member
0 Likes
2,601

hi ,

if you want more material plz give me your mail id so that

i can send some material.

thanks in advance.

srikanth tulasi..

Read only

Former Member
0 Likes
2,601

Hi Chidambar,

Structure: The object structure refers to the defination of object that does not have any contents. It is like table or view . But it never has entries i.e it is only a structure. the basic difference between structure and table is tht the structure doesnot exist in the underlying database whereas table data exist in the underlying database.A structure does not occupy any memory until a variable is declared of its type

Internal Table: Long life data is stored in database tables . You cant afford to lose data frm database tables in such cases where you can not work directly with database table. Hence need of intermediate table where you can put all the data from database tables where you can put in alll the data frm the database table and work with this data frm database table and work without accidentral loss of data these intermediate tabels are called as internal tables.

NO memory is reserved for these tables. they are created during run time only.

Internal table has both work area and body .

There are two kinds of internal tables they are

1. With header and

2. Without header.

With header : Here both the name of work area and body will be same.

Without Header: Here the name of work area and body have different name.

Reward if helpfull,

Regards,

Kashyap Ivaturi