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

hi all -- gurus- abap

hi

i have 5 records in itab_del internal table after the endloop.

now i have to delete the ztable records that is matching with itab_del table and for that i have written following code after endloop.

ITAB_DEL = ITAB_DEL3.

append ITAB_DEL.

clear ITAB_DEL.

endloop.

DELETE Ztable FROM table ITAB_DEL.

but ztable records are not deleting although 5 records are matching.

is my syntax wrong ? what is the issue ???

pl help.

thanx in advance

rocky

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Mar 24, 2008 at 09:26 AM

    hi,

    Use this Statement

    DELETE Ztable FROM table ITAB_DEL.

    Commit Work.

    Thanks

    Yogesh

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 24, 2008 at 09:27 AM

    in your code u r clearing the contents of the internal table.So the internal table is empty.So remove that line clear_itab_del.

    and try it will work.

    There are no issues with syntax.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 24, 2008 at 09:31 AM

    Hi rocky,

    ITAB_DEL = ITAB_DEL3.
    append ITAB_DEL.
    clear ITAB_DEL.
    endloop.
    
    DELETE Ztable FROM table ITAB_DEL.

    You are trying to deleting the records after clearing the ITAB_DEL work area. So modify your coding as below.

    ITAB_DEL = ITAB_DEL3.
    append ITAB_DEL.
    clear ITAB_DEL.
    endloop.
    
    loop at itab_del.
    DELETE Ztable FROM table ITAB_DEL.
    endloop.

    I hope it may help you. If you still facing the problem feel free to contact me . And dont forget reward points.

    Regards,

    Sreenivasa Sarma K.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 24, 2008 at 09:38 AM

    Hi,

    LOOP AT itab_del.

    select fields for ztabe where xxx = itab_del .....

    IF sy-subrc eq 0.

    DELETE FROM ZTABLE WHERE xxxx = itab_del-xxx.

    endif.

    ENDLOOP.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 24, 2008 at 09:41 AM

    Please check if the client field(MANDT) is the first field in the

    internal table.(If ZTABLE also has MANDT field)

    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.