Application Development and Automation 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: 
Read only

diff between delete and refresh

Former Member
4 REPLIES 4
Read only

Former Member
0 Likes
800

Hi,

You haven't specified where you want to know the difference between them.

Anyways generally we apply Delete and Refresh keywords for internal tables.

Delete statement deletes the internal table where as Refresh statement clears the data but not memory alloted to it.

Hope its Useful..

Kota

Read only

Former Member
0 Likes
800

refresh : It will delete the records but memory will be there.

delete : delete the required records.

Syntax

REFRESH itab.

Effect

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.

Note

The statement REFRESH itab acts for all internal tables like CLEAR itab[]. If an internal table itab has a header line, then the table body and not the header line is initialized. If the internal table itab has no header line, REFRESH itab acts like CLEAR itab. Therefore, you should always use CLEAR instead of REFRESH.

Exceptions

Non-Catchable Exceptions

Cause: No more memory space available to create the table

Runtime Error: REFRESH_NO_SHORT_MEMORY

DELETE

delete <itab> where <condition>

DELETE for Files

Deletes files on the application server

Syntax

DELETE DATASET <dsn>.

Deletes the file <dsn> from the file system of the application server.

DELETE for Database Table Entries

Deletes entries from database tables.

Syntax

DELETE FROM <dbtab> WHERE <cond>.

All of the lines in the database table that satisfy the conditions in the WHERE clause are deleted.

Syntax

DELETE <dbtab> FROM <wa>.

DELETE <dbtab> FROM TABLE <itab>.

This deletes the line that has the same primary key as the work area <wa>, or deletes all the lines in the database that have the same primary key as a line in the internal table <itab>. The work area <wa> or the lines of the internal table <itab> must have at least the same length as the work area of the database table.

DELETE for Cluster Databases

Deletes data clusters from cluster database tables.

Syntax

DELETE FROM DATABASE <dbtab>(<ar>) ID <key>.

Deletes the entire cluster in area <ar> with the name <key> from the cluster database table <dbtab>.

DELETE for the Cross-Transaction Application Buffer

Deletes data clusters from the cross-transaction application buffer.

Syntax

DELETE FROM SHARED BUFFER <dbtab>(<ar>) ID <key>.

Deletes the data cluster for the area <ar> with the name <key> stored in the cross-transaction application buffer for the table <dbtab>.

DELETE for Lines from an Internal Table

Deletes lines from internal tables of any type.

Syntax

DELETE TABLE <itab> FROM <wa>.

DELETE TABLE <itab> WITH TABLE KEY <k1> = <f 1>... <k n> = <f n>.

Deletes using the table key. All lines with the same key are deleted. The key values are taken either from a compatible work area <wa> or specified explicitly.

Syntax

DELETE <itab> WHERE <cond>.

Deletes using conditions. Deletes all table entries that satisfy the logical expression <cond>. The logical condition can consist of more than one comparison. In each comparison, the first operand must be a component of the line structure.

Syntax

DELETE ADJACENT DUPLICATE ENTRIES FROM <itab> http://COMPARING. .

Deletes adjacent duplicate entries, either by comparing the key fields or the comparison fields specified explicitly in the COMPARING addition.

DELETE for Lines from Index Tables

Deletes entries from index tables.

Syntax

DELETE <itab> INDEX <idx>.

If you use the INDEX addition, the line with index <idx> is deleted from the table <itab>. Without the INDEX addition, you can only use the above statement within a LOOP. In this case, you delete the current line.

Syntax

DELETE <itab> FROM <n1> TO <n 2> WHERE <cond>.

The system deletes all of the lines of <itab> whose index lies between <n 1 > and <n 2 > and who meet the conditions specified in the WHERE clause. If you do not specify a FROM addition, the system deletes lines from the first line onwards. If you do not specify a TO addition, the system deletes lines up to the last line. The logical condition can consist of more than one comparison. In each comparison, the first operand must be a component of the line structure.

REFRESH

Initializes an internal table.

Syntax

REFRESH <itab>.

Resets the internal table <itab> to its initial value, that is, deletes all of its lines.

REFRESH CONTROL

Initializes a control.

Syntax

REFRESH CONTROL <ctrl> FROM SCREEN <scr>.

The control <ctrl> defined in the CONTROLS statement is reset with the initial values specified for screen <scr>.

hope it will be useful.

Reward points Please..

Read only

Former Member
0 Likes
800

hi,

CLEAR Sets the contents of the internal table to the right initial value for the column type.

REFRESH works like CLEAR.

FREE Deletes the internal table and releases the memory.

Hope this helps, Do reward.

Read only

Former Member
0 Likes
800

Hi

DELETE for Files

Deletes files on the application server

Syntax

DELETE DATASET <dsn>.

Deletes the file <dsn> from the file system of the application server.

DELETE for Database Table Entries

Deletes entries from database tables.

Syntax

DELETE FROM <dbtab> WHERE <cond>.

All of the lines in the database table that satisfy the conditions in the WHERE clause are deleted.

Syntax

DELETE <dbtab> FROM <wa>.

DELETE <dbtab> FROM TABLE <itab>.

This deletes the line that has the same primary key as the work area <wa>, or deletes all the lines in the database that have the same primary key as a line in the internal table <itab>. The work area <wa> or the lines of the internal table <itab> must have at least the same length as the work area of the database table.

DELETE for Cluster Databases

Deletes data clusters from cluster database tables.

Syntax

DELETE FROM DATABASE <dbtab>(<ar>) ID <key>.

Deletes the entire cluster in area <ar> with the name <key> from the cluster database table <dbtab>.

DELETE for the Cross-Transaction Application Buffer

Deletes data clusters from the cross-transaction application buffer.

Syntax

DELETE FROM SHARED BUFFER <dbtab>(<ar>) ID <key>.

Deletes the data cluster for the area <ar> with the name <key> stored in the cross-transaction application buffer for the table <dbtab>.

DELETE for Lines from an Internal Table

Deletes lines from internal tables of any type.

Syntax

DELETE TABLE <itab> FROM <wa>.

DELETE TABLE <itab> WITH TABLE KEY <k1> = <f 1>... <k n> = <f n>.

Deletes using the table key. All lines with the same key are deleted. The key values are taken either from a compatible work area <wa> or specified explicitly.

Syntax

DELETE <itab> WHERE <cond>.

Deletes using conditions. Deletes all table entries that satisfy the logical expression <cond>. The logical condition can consist of more than one comparison. In each comparison, the first operand must be a component of the line structure.

Syntax

DELETE ADJACENT DUPLICATE ENTRIES FROM <itab> http://COMPARING. .

Deletes adjacent duplicate entries, either by comparing the key fields or the comparison fields specified explicitly in the COMPARING addition.

DELETE for Lines from Index Tables

Deletes entries from index tables.

Syntax

DELETE <itab> INDEX <idx>.

If you use the INDEX addition, the line with index <idx> is deleted from the table <itab>. Without the INDEX addition, you can only use the above statement within a LOOP. In this case, you delete the current line.

Syntax

DELETE <itab> FROM <n1> TO <n 2> WHERE <cond>.

The system deletes all of the lines of <itab> whose index lies between <n 1 > and <n 2 > and who meet the conditions specified in the WHERE clause. If you do not specify a FROM addition, the system deletes lines from the first line onwards. If you do not specify a TO addition, the system deletes lines up to the last line. The logical condition can consist of more than one comparison. In each comparison, the first operand must be a component of the line structure.

REFRESH

Initializes an internal table.

Syntax

REFRESH <itab>.

Resets the internal table <itab> to its initial value, that is, deletes all of its lines.

REFRESH CONTROL

Initializes a control.

Syntax

REFRESH CONTROL <ctrl> FROM SCREEN <scr>.

The control <ctrl> defined in the CONTROLS statement is reset with the initial values specified for screen <scr>.

REFRESH itab.

This always applies to the body of the table. With REFRESH, too, the initial memory requirement fort he table remains reserved. To release this memory space, use the statement

hope it will be useful.

Regards,

Rohini