‎2007 Mar 15 7:21 AM
hi all
can anybody told me difference between
INTERNAL TABLE
WORK-AREA
DATABASE TABLES
with example in detail plz
no links plz any body who could explain it is rewarded points
regards,
virus
‎2007 Mar 15 7:25 AM
<b>Database table : </b>Here the data about the company .. that is for example take a bank ..
The daily transactions they need to store in some part of the system .. This part of the system is called Database . In this all the data will be stored in the form of database tables...
*******************
<b>Internal table : </b> These are used to process ( read , write , change ) the data in the database tables..
and to provide the data required for the user..
suppose u need the transactions that has the amount debited more 500000 since one month.. then we will retrieve the data from database tables and we willuse the internal tables to present the data in required fashion.. that is in sorted position of the username , or in amount.. like that..
And if u write any program or something then these internal tables exists onli in that program.. but the database tables are available centrally for any operations for any program...
It can store more than one same structured items at a time.. These are like arrays in <b>C language</b>.
************************
<b>Work area :</b> this is used with internal table and data base tables also.. It can store data of one record at a time.. but internal table stores more than one reord at a time..
reward if it helps u...
sai ramesh
‎2007 Mar 15 7:24 AM
Internal tables are temporary data objects used locally inside programs.
Work area is a line structure usually of an internal table or a db table or a view.
DB are global objects.
‎2007 Mar 15 7:27 AM
Example:
data: begin of itab occurs 0,
a1 type i,
a2 type i,
end of itab. " Example of internal table (visible locally in the program )
data: wa_itab like itab. " Work area , again (visible locally in the program )
EKKO, EKPO, KNA1, MSEG are db tables stored on the DB server.
these are visible globally.
‎2007 Mar 15 7:25 AM
<b>Database table : </b>Here the data about the company .. that is for example take a bank ..
The daily transactions they need to store in some part of the system .. This part of the system is called Database . In this all the data will be stored in the form of database tables...
*******************
<b>Internal table : </b> These are used to process ( read , write , change ) the data in the database tables..
and to provide the data required for the user..
suppose u need the transactions that has the amount debited more 500000 since one month.. then we will retrieve the data from database tables and we willuse the internal tables to present the data in required fashion.. that is in sorted position of the username , or in amount.. like that..
And if u write any program or something then these internal tables exists onli in that program.. but the database tables are available centrally for any operations for any program...
It can store more than one same structured items at a time.. These are like arrays in <b>C language</b>.
************************
<b>Work area :</b> this is used with internal table and data base tables also.. It can store data of one record at a time.. but internal table stores more than one reord at a time..
reward if it helps u...
sai ramesh
‎2007 Mar 15 7:26 AM
Hi,
Internal table is the Run time table which is used to fetch the data into it and to do further manipulations on the data.
There two types of Int tables, with header line and without.
With header line can hold multiple records,where as other just a single record.
Int table without header area can also called as structure or work area, which will hold a single record at run time.
Database tables are the tables which will hold multiple records and stored in database. in SAP complete data is stored in Database tables only. Again there are various table types, like transparent, pool, cluster and views.
Regards,
Hope this helps.
Anji
‎2007 Mar 15 7:29 AM
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)
Int Tab can have multiple records where as strcut 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 exist at the underlaying data base system level , it exist only at data dictionary level.
Difference between Work Area and Header Line
While adding or retrieving records to / from internal table we have to keep the record temporarily.
The area where this record is kept is called as work area for the internal table. The area must have the same structure as that of internal table. An internal table consists of a body and an optional header line.
Header line is a implicit work area for the internal table. It depends on how the internal table is declared that the itab will have the header line or not.
e.g.
data: begin of itab occurs 10,
ab type c,
cd type i,
end of itab. " this table will have the header line.
data: wa_itab like itab. " explicit work area for itab
data: itab1 like itab occurs 10. " table is without header line.
The header line is a field string with the same structure as a row of the body, but it can only hold a single row.
It is a buffer used to hold each record before it is added or each record as it is retrieved from the internal table. It is the default work area for the internal table.
If we don't want to use any explicit work area then its better to go for an internal table with header line.
Types of tables:
Standard table
Sorted table
Hashed table
DATA: BEGIN OF ITAB OCCURS 500,
costum_no type i,
name(30) type c,
END OF ITAB.
Database Tables: Examples
Add a single record to a database table
insert into <database table> values <work area>
Example:
tables: mytable.
mytable-number = 1.
mytable-name = 'John'.
insert into mytable values mytable.
Good Luck and Thanks
AK
‎2007 Mar 15 7:29 AM
Hi
Let us understand one by one.
Internal table: All the data in SAP will be stored in the underlying database. so if we want to get data everytime we have to go to the database and get it which is quite resource consuming. so to avoid that we declare an internal table which holds the data in the program and exists as long as the program is running. outside the program the internal table cannot be used
DataBase Tables: some tables have to used across multiple applications(programs). such tables are stored globally in a central repository so that they can be reused when wanted.
Work Area: work area has the same structure as an internal table but the difference is workarea can hold only one record at a time
Hope this helps u
Regards
Chaitanya
‎2007 Mar 15 7:30 AM
Hi!
Internal table is a table(data object) to store large amount of data having same structure.(like arrays in C).but these are stored at data dictionary , i.e. application server level.
Work-area is a data object having some structure which can store only one record at a time.
Database tables are also tables stored at database level.
Reply if any other doubt.
Regards,
Neha Bansal