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: 

Deleting from Dynamic Internal table

former_member212005
Active Contributor
0 Kudos

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.

1 ACCEPTED SOLUTION

former_member555112
Active Contributor
0 Kudos

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

6 REPLIES 6

former_member555112
Active Contributor
0 Kudos

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

0 Kudos

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...

0 Kudos

Hi Ankur....any other suggestion

Former Member
0 Kudos

Hi,

Check the Rich Heilman answer in the thread..

0 Kudos

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.

Former Member
0 Kudos

Hi,

Try this

data : key(4) value 'field1'.

DELETE <fs_dyn_table> WHERE (key) = '10'

Regards

Ramakrishna L