‎2008 Jan 17 5:42 AM
Hi,
How to do Conditional delete on an internal table using a negative clause
Thanks,
Manjula.
‎2008 Jan 17 6:45 AM
Hi,
Assume an internal table TAB1 with the following definition. TAB1 is built from the database table DBTAB and contains many possible values for the table column FLAG (except the initial value). The functionality covered in this example is the case where all the internal table values with the value of FLAG not equal to D have to be deleted. The table contains 100,000 rows.
LOOP AT TAB1
IF TAB1-FLAG <> D.
TAB1-FLAG = SPACE.
MODIFY TAB1 INDEX SY-TABIX
TRANSPORTING FLAG.
ENDIF.
ENDLOOP.
DELETE TAB1 WHERE FLAG = SPACE
Reward points if found helpfull...
Cheers,
Chandra Sekhar.
‎2008 Jan 17 5:45 AM
You wanted to delete all entires with f1 LE 7.
delete itab where itab-f1 GR 7.
reward points if helpful.
‎2008 Jan 17 5:46 AM
Hi,
Use the code..
delete <itab> where <itab-fieldname> NE ''value'.
eg.
delete itab where matnr NE 10.
‎2008 Jan 17 5:48 AM
Hi,
if certain action has done on the internal table then delete the record,
for example,
if it_tab-fname ne 'X'.
delete it_tab with index sy-tabix.
endif.
Plzz reward points if it helps.
‎2008 Jan 17 6:45 AM
Hi,
Assume an internal table TAB1 with the following definition. TAB1 is built from the database table DBTAB and contains many possible values for the table column FLAG (except the initial value). The functionality covered in this example is the case where all the internal table values with the value of FLAG not equal to D have to be deleted. The table contains 100,000 rows.
LOOP AT TAB1
IF TAB1-FLAG <> D.
TAB1-FLAG = SPACE.
MODIFY TAB1 INDEX SY-TABIX
TRANSPORTING FLAG.
ENDIF.
ENDLOOP.
DELETE TAB1 WHERE FLAG = SPACE
Reward points if found helpfull...
Cheers,
Chandra Sekhar.