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: 

How to delete multiple lines from <itab>?

Former Member
0 Kudos

Hi Experts,

I have two field-symbols internal tables <itab>, <items>. I want to delete all records in <itab> if they are existing in <items>. I can complete it by doing LOOP but it's time-consuming. Is there any better way to do it?

Thanks.

Tom

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

I don't think there if there is any other technique to solve other than using LOOP AT ...

Thanks,

Naren

3 REPLIES 3

Former Member
0 Kudos

Hi,

I don't think there if there is any other technique to solve other than using LOOP AT ...

Thanks,

Naren

Former Member
0 Kudos

You could use the following

DELETE itab WHERE field like '*'.

or

DESCRIBE TABLE itab LINES idx2.

DELETE itab FROM 1 TO idx2.

Regards,

Dennis

Former Member
0 Kudos

If you do a binary search on the second table, it won't take as much time. If there are multiple records in the second table for records in the first table you can use an indexed read to get rid of those.

Rob