INTERNAL TABLES:
Before moving to internal tables ,some of the STANDARD Database Tables(these tables are given by SAP default.)
don not about database tables i will discuss in data dictionary.
1. T001 ------> Company Codes Table.
2. KNA1 -------> Customer Master Table.
3. LFA1 --------> Vendor Master Table.
SOME OF FIELDS IN T001:
1. BUKRS -----> Company Code.
2. BUTXT ------>Company Name.
3. ORT01 -------> City.
4. LAND1 ------> Country.
5. SPARS --------> Language.
SOME OF FIELDS IN KNA1:
1. KUNNR -----> Customer Number.
2. NAME1 ------>Name of the Customer.
3. ORT01 -------> City.
4. LAND1 ------> Country.
5. SPARS --------> Language.
SOME OF FIELDS IN LFA1:
1. LIFNR -----> Vendor Number.
2. NAME1 ------>Name of the Vendor.
3. ORT01 -------> City.
4. LAND1 ------> Country.
5. SPARS --------> Language.
Need Of The INTERNAL TABLES:
>> Main reason to go internal tables.In real time senario we will not be given access to database table, because if any company gives access to database they may change the data whic is present in the database.
>> suppose there are two tables 1. employees salary, 2. employee details.
1. employee salary contains fields(columns)[empid, empsalary].
2 employee details contains fields[empid, empname, empaddress].
if you are given a task to print a table with fields from both the tables then we go internal tables.
Internal table are temparary tables .which are used only for particular task.
WORKAREA:
>>Work area is single record of an internal table through work area only we can write into an internal table and read from the internal table.
DECLARING THE WORKAREA:
>> Data : Begin of EMP ,
EID(10) Type C ,
ENAME(25) Type C,
EADDRESS(35) Type C,
End of EMP.
>> EID , ENAME , EADDRESS, are the fields in the EMP .
>> This above one row is called as record(details of single employee).
SYNTAX OF declaring the structure or internal table in ABAP editor:
Data : Begin of <structure/table name>,
list of fields,
list of fields,
end of <structure/table name>.
note:
since the work area can holds or stores only one record. so we go for internal table at a time.
Internal table:
>> Internal Table is the collection of records.
>>Internal table s are temporary table ,that means the data in the internal table will not save anywhere in the SAP.
>>Internal table are dynamic memory allocation that means we need not provide the size of the internal table.
>> the scope(accesability) of internal table is upto that program.
Backend Picture of Internal Tables:
Differences between database table and internal table.
Database Table Internal Table
1. Database tables are perma- 1. Internal tables are
nent storage location. temparary storage locat ion.
2. we can access he database 2. We can access the
from any where in the SAP. internal table upto that
(globally). program(locally).
3. we must provide the size 3. Internal table are dynamic
of the database table. so we need not provide
the size.
syntax of declaring the internal table:
>> Data <internal table> like Table of <work area>.
eg: Data emp1 like Table of emp.
in the above diagram emp1 is internal table name
syntax of accessing the fields from workspace:
syntax of accessing the fields from workspace:
<work area name>--< field name>
eg: emp-eid.
emp-ename.
note:
APPEND is the keyword to transfers data from work area to internal table.
message: we perform task in the next post.




Comments
Post a Comment