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

INTERNAL TABLE

Hi ,

based on some condion on one internal table i have to delete records in another internal table so how it is possible pls tellme.

if one record is i can use READ but i have to check with multiple records.

pls help me

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2007 at 04:39 AM

    hi,

    Loop (internal table2 which has many records)

    read each record coming inside the loop for the condition to satisfy in the other internal table1

    if sy-subrc = 0.

    delete the content of the internal table1 .

    endif.

    endloop.

    regards,

    karthik

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2007 at 04:35 AM

    hi,

    ex : consider ITAB & ITAB1 having a field PERNR.

    if u want to delete the ITAB1-Pernr, who are all there in ITAB..

    <b> Loop at ITAB.

    DELETE ITAB1 WHERE PERNR EQ ITAB-PERNR.

    Endloop.</b>

    With Rgds,

    S.Barani

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2007 at 04:43 AM

    Hi,

    Loop at itab1 where <condn>. ( if condn exists, it will come inside the inner

    loop).

    Loop at itab2.

    delete itab2 where <cond> = <itab1->.

    endloop.

    endloop.

    Regards,

    Vani.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2007 at 12:15 PM

    try this.

    loop at itab1.

    if (ur condition in itab1).

    delete itab2[] where (ur condition).

    endif.

    endloop.

    hope this gives some idea.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 04, 2007 at 12:18 PM

    Hi,

    Do like this.

    Loop at itab1 itno wa1.

    read tbale itab2 into wa2 with key <conditions>

    if sy-subrc eq 0 .

    delete itab1 from wa1.

    endif.

    endloop.

    Regards,

    Prashant

    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.