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

Delete from table type.

Hello,

I have a need to delete some entries from a table type where ID = some string.

Is it possible to do it in code without loops?

Can you plese provide correct syntax?

Thank you.

Georgy

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Oct 19, 2006 at 09:58 PM

    I assume that you have an internal table describe by a table type. You can use the syntax below.

    delete itab where ID = <some_value>.

    Regards,

    Rich Heilman

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 19, 2006 at 10:00 PM

    Hi,

    Use the where condition in the delete statement..

    DELETE ITAB WHERE FIELDNAME = 'SOME STRING'..

    Thanks,

    Naren

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 19, 2006 at 10:04 PM

    Hi Georgy

    It must be an internal table which might have been defined from table type.

    Yes you can delete records from internal table. Here are few statements and use whichever suits your requirement.

    - DELETE itab INDEX idx.

    - DELETE itab FROM idx1 TO idx2.

    - DELETE itab WHERE Field = Value.

    - DELETE ADJACENT DUPLICATES FROM itab Comparing Field1 Field2 .... (Sort the table by Field1 Field2 .. before deleting duplicate entries)

    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.