Internal Tables in SAP ABAP [ Part 3 ]

Deleting contents of internal table:

DELETE : This statement either deletes one or more rows in internal table, specified with the table key or table index, or it deletes neighboring duplicate rows.

1 )
DELETE itab INDEX sy-tabix.
 Delete the row number specified by sy-tabix


2 )
DELETE TABLE itab FROM wa.
Delete all occurrences of row specified by workarea wa from internal table

3 )
DELETE TABLE itab WITH TABLE KEY field1 = ‘123 ‘. 
Delete all occurrences of row where table key field1='123'

4 )
DELETE itab FROM idx.
Delete all rows from line number idx

5 )
DELETE itab TO idx. 
Delete all rows to line number idx

6 )
DELETE itab where field1 = ‘321 ‘. 
Delete all occurrences of row where field1='321 '

7 )
DELETE ADJACENT DUPLICATES FROM itab COMPARING field1 field2.
Remove duplicates from itab (provided that itab is sorted)