REFRESH - Delete an internal table

Variants:

1. REFRESH itab.

2. REFRESH itab FROM TABLE dbtab.

3. REFRESH itab FROM SELECT-OPTIONS.

Variant 1

REFRESH itab.


Effect

The internal table itab is reset to its initial state, i.e. all table entries are deleted.

Der Return Code SY-SUBRC is undefined.

Notes

Note

Performance:

The runtime required to reset an internal table depends on the amount of memory previously occupied by that table.
Resetting a small internal table takes around 15 msn (standard microseconds). Resetting a 200 KB table takes around 400 msn, and a 1 MB table, around 3000 msn.
If the internal table has an index or a hash table (because it was edited using INSERT, DELETE, SORT or COLLECT), the runtime increases slightly, since the index or hash table has to be released as well as the table itself.

Variant 2

REFRESH itab FROM TABLE dbtab.


In some cases, the syntax rules that apply to Unicode programs are different than those for non-Unicode programs. See Key Specifications and Unicode.

This variant is not allowed in an ABAP Objects context. See REFRESH FROM not Allowed.

Note

This variant is no longer maintained and should no longer be used (see also obsolete key words). Please use the SELECT ... INTO TABLE statement instead.

Effect

The internal table itab is deleted and it is then filled with the contents of the database table dbtab.
A generic argument can be used to specify a restriction to a particular part of the database table when filling ( LOOP AT dbtab, READ TABLE dbtab).
The table dbtab must be declared in the program using TABLES.

Der Return Code SY-SUBRC is undefined.

Example

Delete an internal table MESSAGES, then fill the table with all messages from the table T100 with language key 'D' and ID 'RF'.

TABLES T100.
DATA MESSAGES TYPE TABLE OF T100 WITH HEADER LINE

MESSAGES-TEXT = 'Delete me'.
APPEND MESSAGES.
T100-SPRSL = 'E'.
T100-ARBGB = 'RF'.
REFRESH MESSAGES FROM TABLE T100.

Variant 3

REFRESH itab FROM SELECT-OPTIONS.


Note

This variant is no longer supported (see also obsolete key words). The equivalent functionality is now available in the function module RS_REFRESH_FROM_SELECTOPTIONS.

Effect

Deletes the internal table itab and then transfers the database selections and the selection parameters together with the values entered by the user.

Exceptions

Non-Catchable Exceptions

Additional help

Initializing Internal Tables