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

query

Hi,

i have created a custom table called ynemp data in it will be only be a single record.

In reports i have retrieved the data from that table into itab.

Now, after retrieval, if success

i want to delete the record from the custom table ie ynemp.

so, let me know the delete query for this.

Regards,

kb

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Posted on Sep 25, 2007 at 07:11 AM
    select * from ynemp
             into table it_ynemp.
    if sy-subrc = 0.
      delete ynemp from table it_ynemp.
    endif.
     
    " if it is a single record based on key fields delete it.
    select single * from ynemp
                    where field1 = ''  " value
                      and field2 = ''. " value
    if sy-subrc = 0.
      delete ynemp.
    endif.
    

    Regards

    Gopi

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 25, 2007 at 07:17 AM

    Hi,

    do like this

    select * from ynemp

    into table it_ynemp.

    if sy-subrc = 0.

    delete ynemp from table it_ynemp.

    endif.

    Regards,

    nagaraj

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 25, 2007 at 07:25 AM

    DATA: itab TYPE TABLE OF ynemp,

    wa TYPE ynemp,

    itab2 TYPE TABLE OF ynemp.

    SELECT * FROM ynemp INTO table itab.

    If u wan2 delete a particular record.

    LOOP AT itab INTO wa WHERE <ur condition>.

    APPEND wa TO itab2.

    ENDLOOP.

    DELETE ynemp FROM table itab2.

    • Reward pts if useful!

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 14, 2009 at 10:25 PM

    thanks

    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.