07-02-2009 2:56 PM
Hi,
How can we delete data from dynamic internal table...
I have a dynamic internal table <fs_dyn_table> which is of type any and can have any fields...
I want to delete all those records which have a value of '10' in a field named field1
I have written my delete statement in the following manner..
DELETE <fs_dyn_table> WHERE field1 = '10'.....but it is not working...it gives me an error...stating that the line type of table must be statically defined.
07-02-2009 3:01 PM
Hi,
Loop on the internal table into a field-symbol of line type same as the internal table.
Use assign component statement and then delete the corresponding record.
Regards,
Ankur Parab
07-02-2009 3:01 PM
Hi,
Loop on the internal table into a field-symbol of line type same as the internal table.
Use assign component statement and then delete the corresponding record.
Regards,
Ankur Parab
07-02-2009 3:02 PM
Ankur...thanks for the reply...
What you have suggested is DELETE statement inside LOOP...which is not feasible as there might be more than lacs of record...
07-02-2009 3:11 PM
07-02-2009 3:21 PM
07-03-2009 6:40 AM
Thanks Avinash...the answer given by Rich Heilman is same as Ankur's...
It gives me a feeling that this is the only way...we cannot avoid the delete statement inside the LOOP.
09-08-2009 8:16 PM
Hi,
Try this
data : key(4) value 'field1'.
DELETE <fs_dyn_table> WHERE (key) = '10'
Regards
Ramakrishna L