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

how to delete a record from an internal table based on two internal fields.

Hi all,

I have selected some data from WITH_ITEM table into internal table t_with_item.

Now i want to delete those record where t_with_item-belnr EQ t_with_item-augbl .

Please suggest how to do this.

Regards,

Amit.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 28, 2008 at 10:16 AM

    Hello,

    Do like this.

    loop at t_with_item.
    if t_with_item-belnr EQ t_with_item-augbl.
    delete t_with_item.
    endif. 
    

    Hope this code will helps you.

    Regards,

    Vasanth

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 28, 2008 at 10:18 AM

    Hi,

    loop at t_with_item.

    delete t_with_item

    where augbl eq with_item-belnr.

    endloop.

    regards

    NIcole

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 28, 2008 at 10:21 AM

    Hi Amit,

    Try this one.Follow the below logic ok,

    loop at with_item.

    delete table with_item where t_with_item-belnr EQ t_with_item-augbl.

    endloop.

    or

    loop at with_item where t_with_item-belnr EQ t_with_item-augbl.

    delete table with_item index sy-tabix.

    endloop.

    Reward points if helpful

    Kiran Kumar.G.A

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 28, 2008 at 10:22 AM

    Hi,

    Try it

    loop at t_with_item.

    if t_with_item-belnr EQ t_with_item-augbl.

    delete t_with_item.

    endif.

    endloop.

    L.Velu

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 28, 2008 at 10:26 AM

    Hi Amit,

    instead deleting internal table.. why can't you put cond. in SELECT statment itself..

    
    SELECT <fld1> <fld2>... INTO CORRESPONDING FILEDS OF TABLE t_with_item
    FROM WITH_ITEM
    WHERE <cond> AND
    belnr NE augbl.
    
    

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2008 at 06:24 AM

    Thanks a lot for all your replies...

    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.