Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

difference between delete and refresh

Former Member
0 Kudos

hi friends,

can anyone tell me clearly what is the difference between deleting some records from an internal table and refreshing few records in an internal table.what does both the statements do exactly.

7 REPLIES 7

Former Member
0 Kudos

Hi!

REFRESH is working for deleting complete internal tables. The other ways of this statement is obsolete. While DELETE can delete simple lines, multiple lines, etc...

Some performance tips:

Performance:

The runtime required to delete an internal table depends on theamount of memory previously occupied by that table.

Resetting a small internal table takes around 15msn (standard microseconds). Resetting a200 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 wasedited using INSERT, DELETE, SORT or COLLECT), the runtime increases slightly, since the index or hash table hasto be released as well as the table itself.

Regards

Tamá

Former Member
0 Kudos

refreshing few records in an internal table clears records from table doesnt free memory cannot give any condition

refresh itab.

deleting some records from an internal table deletes internal table records thru condition

delete itab where ..........

regards

Former Member
0 Kudos

Hi,


CLEAR itab. " Deletes itab header
DELETE itab. "Deletes single record when you are in loop.
DELETE itab FROM <index>. "Deletes records from particular index
REFRESH itab. " Deletes contents of itab.
REFRESH itab[]. "Deletes itab contents and header aswell..

Message was edited by:

Perez C

former_member194152
Contributor
0 Kudos

Hi,

Using Refresh u can delete all records from internal table but structure of table still alive you can use same internal table further in same program but if u use delete itab statment then records of table as well as existence of that table will be deleted u can not use deleted itab again in same program.

Rewards Point if helpful.

Regards

Gagan

Former Member
0 Kudos

hi,

REFRESH <itab>. it empties internal table.

DELETE <itab>. Deletes current line in LOOP - ENDLOOP

DELETE <itab> INDEX <idx>. it deletes line with the index <idx>.

DELETE <itab> [FROM <n1>] [TO <n2>] [WHERE <condition>]. it deletes selected entries.

Former Member
0 Kudos

Hi

The statement DELETE deletes one or more rows from the database table specified in target. The rows that are to be deleted are specified either in a WHERE condition sql_cond or with data objects in source.

This statement sets an internal table itab to its initial value, meaning that it deletes all rows of the internal table. The memory space required for the table is freed up to the initial memory size INITIAL SIZE. For itab, you must specify an internal table.

To delete all rows and free the entire memory space occupied by rows, you can use the statement FREE.

Reward pionts if useful

Regards

Sreenivas

Former Member
0 Kudos

HI

REFRESH <itab>.

statement. This always applies to the body of the table. As with the CLEAR statement, the

memory used by the table before you initialized it remains allocated. To release the memory

space, use the statement

DELETE <itab>

THis will delete the values from the internal table based on the WHERE condition

<b>Reward if usefull</b>