Sie sind auf Seite 1von 4

Internal table

Internal table is a user-defined temporary work area to store the database table records. If you want to make any changes to the table records, make the changes in internal table and then update the records back into the database table.

Syntax:
Data <internal_table_name> like <database_table_name> occurs <size> with header line Here, OCCURS 0 specifies that internal table should initially take 8 KB of memory area These internal tables are used in Batch data Communication, SAP scripts, Smart Forms, module pool programs, subroutines and function modules etc.
Types of internal tables:

Internal tables are basically divided in to two types. They are 1) Indexed internal table 2) Non indexed internal table
Indexed internal table: 1. Standard internal table:

This type of internal table performs the search for a record in the body area using LINEAR SEARCH TECHNIQUE.
SYNTAX:

DATA <internal_table_name> LIKE STANDARD TABLE OF<database_table_name>. WITH DEFAULT/NON-UNIQUE KEY WITH HEADER LINE INITIAL SIZE <size>
2. Sorted internal table:

This internal table will hold the records from the database table in a sorted manner.

Syntax:

DATA <internal_table_name> LIKE SORTED TABLE OF <database_table_name> WITH DEFAULT/NON-UNIQUE KEY WITH HEADER LINE INITIAL SIZE <size>.
Non Indexed Internal table: 1. Hashed internal table:

This internal table is not assigned any index value. The retrieval of records from internal Body area is based on key field or a row.
Syntax:

DATA <internal_table_name> LIKE HASHED TABLE OF<database_table_name> WITH DEFAULT/NON-UNIQUE KEY WITH HEADER LINE INITIAL SIZE <size>.
APPEND:

This statement is used to insert the values into body area of the internal table even if the record already exists.
COLLECT:

This statement is also used to insert the values into body area of the internal table, but will check for index value. If the record already exists, it wont insert the same value.

Field symbols:

Field symbols are symbolic names for other fields. They do not physically reserve space for a field, but point to its contents. A field symbol can point to any data object. The data object to which a field symbol points is assigned to it after it has been declared in the program.
Syntax:

FIELD-SYMBOLS <fs> [typing].

Work Area:

Work area is a single row of data and has the same format as that of the internal table. It is used to process the data present in the internal table, one row at a time.
Syntax:

DATA : wa_mara type mara .

STRUCTURES:
A structure can hold only one record. To make the structure hold more than one record, declare an internal table.
Syntax:

Types: Begin of str1, ------------------, ------------------, ------------------, End of str1.


Type:

Type refers the existing data type.


Like:

Like refers the existing data object.


PARAMETERS:

It is single I/p field for user on selection screen. Parameters v1_matnr type matnr.
SELECT-OPTIONS:

With this user can enter range of I\p values on selection screen.

DATA V1 LIKE MARA-MATNR. SELECT-OPTIONS V_MATNR FOR V1.


STRUCTURE OF SELECTOPTIONS:

LOW HIGH SIGN OPTIONS NO-EXTENSION NO INTERVALS

- Lower value - upper value -include (default)/exclude ('I'/'E') -'BT'(Default for I/p range)/'NB'/'EQ'(Default for single I/p)/NE. : To remove or suppress extension property for select options. : To avoid ranges options for select options

CHECK BOX: User can check the check box on selection screen.

PARAMETERS P1_KUNNR AS CHECK BOX.


RADIO BUTTON: User can check the radio button on selection screen.

PARAMETERS: R1 RADIO BUTTON GROUP G1, R2 RADIO BUTTON GROUP G1

Das könnte Ihnen auch gefallen