Ways To Create Internal Table

How many ways can we create internal table and process it?

We can create internal table in 3 ways.

1) Creation of internal table with a new structure.

Example:

*TO CREATE ITAB WITH  NEW STRUCTURE.******

 DATA : BEGIN OF ITAB OCCURS 10,
                  ENO(3) TYPE N,
                  ENAME(30) TYPE C,
                  ESAL TYPE I,END OF ITAB.

Begin of with OCCURS creates table with HEADERLINE.

To create TABLE OCCURS SIZE is must in this SYNTAX.

2) Creation of internal table referring to structure.

*****TO CRAETE STRUCTURE****

TYPES : BEGIN OF STRUCT1,
             ENO(3) TYPE N,
                  ENAME(30) TYPE C,
                  ESAL TYPE I,END OF ITAB.
            END OF STRUCT1.

********CREATE ITAB REFERING TO ABOVE STURUCTURE*********

DATA ITAB TYPE STRUCT1 OCCURS 10.

***********HEADER LINE NOT CREATED.*******
**********CREATE HEADER LINE************

DATA WA TYPE STRUCT1.

3) Creation of internal table referring to another table.

DATA ITAB TYPE TABLE OF MARA WITH HEADERLINE.

ABAP

Read Also
ALV Sample Using Inner Join

ABAP Books List
ABAP/4 Certification, Programming, Smartforms, Sapscripts and Object Oriented Programming Books

Smart Forms
SAP Smartforms

ABAP Menu:
ABAP Example Hints and Tips

Return to Index:-
SAP ABAP/4 Programming, Basis Administration, Configuration Hints and Tips

(c) www.gotothings.com All material on this site is Copyright.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
All product names are trademarks of their respective companies.  The site www.gotothings.com is in no way affiliated with SAP AG.
Any unauthorised copying or mirroring is prohibited.