Monday, September 21, 2020

Details about Internal Table in SAP ABAP.

Details about Internal Table in SAP ABAP.



Internal Table:

Ø Internal table is a temporary table created in RAM in Application Server

Ø It is created & filled with data during run time (execution time)

Ø Once execution is performed it is rolled out (or) discarded

 

Note:

Use Internal table for storing multiple records during run time

 

Difference between Database table & Internal table:

                   Database Table                                          Internal Table

1.     It is created in Database Server ------- 1. It is created in Application Server

2.     It holds data permanently                   ------- 2. It holds data temporarily

3.     It holds only specific type of data ----- 3. It holds data of different tables of at one place

 

Que: What is exact purpose of Internal table. Do you think should be created in ABAP

         programming?

Ans: In real time we are creating Internal table for storing different types of application data

         from different tables at one place

 

Every Internal table is having 2 parts

They are:

1.     Internal Table Body

2.     Header Line

 

1. Internal Table Body:

The name Internal table itself specifies body of Internal table & it holds multiple records

 

2. Header Line:

It is a default Work Area & holds single record

 

Note:

Header Line is system defined Work Area & Work Area is user defined Header Line

 

Syntax:

DATA:  BEGIN    OF   it_kna1   OCCURS   0,

              customer(20)    TYPE   C,

              name(20)          TYPE   C,

              city(20)            TYPE   C,

              END       OF    it_kna1.


 

Note:

1.     With above syntax an Internal table it_kna1 is crated in Application Server

2.     You can provide any name. But in real time Internal table should always begins with it_ (or) i_ followed by table name

3.     With BEGIN option Header Line is created & OCCURS option Body is created

4.     0, 1, 2, 3, …..9 is called Size Category

5.     Both Header Line & Body name is same (it_kna1)

 

Flow of Data in Internal Table:

1.     Database Table ----à Body---à Header Line--à Virtual Page ---à Presentation Server

2.     Database Table ---à Body---à Presentation Server

No comments:

Post a Comment