Skip to Content
author's profile photo Former Member
Former Member

How to delete multiple lines from <itab>?

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 26, 2006 at 05:57 PM

    Hi,

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

    Thanks,

    Naren

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 26, 2006 at 06:02 PM

    You could use the following

    DELETE itab WHERE field like '*'.

    or

    DESCRIBE TABLE itab LINES idx2.

    DELETE itab FROM 1 TO idx2.

    Regards,

    Dennis

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 26, 2006 at 06:02 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.