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

Delete clause clarification

To delete data in one shot from database table...

delete dbtable not working..

IS it necessary to use where clause?

plz help me out

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

7 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 15, 2005 at 08:05 AM

    Hi

    You can't use the command DELETE alone, becouse you have to indicate which record you want to delete, so:

    A)

    SELECT * FROM <TABLE> WHERE...

    DELETE <TABLE>.

    ENDSELECT.

    B) DELETE FROM <TABLE> WHERE ......

    C) DATA WA LIKE <TABLE>.

    .......

    DELETE <TABLE> FROM WA

    D) DATA ITAB LIKE STANDARD TABLE OF <TABLE>.

    ..........

    DELETE <TABLE> FROM TABLE ITAB.

    Max

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 15, 2005 at 08:57 AM

    Hi Raja,

    "delete dbtable" will work if you have defined

    "Tables dbtable" and this will delete only record that matches the workarea dbtable.

    To delete in one shot -

    DELETE FROM DBTABLE.

    But if its a client soecific table it will delete data in current client only . If you want to delete data in all clients use "client specified".

    Cheers

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 15, 2005 at 09:03 AM

    Hi,

    If you want to delete all table entries without ABAP coding, go to tr.code SE11 -> Utilities -> Database utility (Transaction SE14).

    Svetlin

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 15, 2005 at 09:28 AM

    Hi Max & Sanjay,

    DELETE from dbtab not working...

    Syantax error: delete from itab shud be followed by where clause...

    Help me out.

    I have to do this programatically..

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 15, 2005 at 09:40 AM

    GOT it from documentation.

    check the following

    <b>Note:</b>

    To delete all the lines in a table, you must specify a WHERE condition that is true for all lines. You can achieve this with

    ... WHERE f IN itab

    If the internal table itab is empty, such a condition would select all lines.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi

      I'm using 4.7, in this release you can use thie statament without where condition...I'm sorry, you can try to do:

      DELETE FROM TABLE CLIENT SPECIFIED

      WHERE MANDT = SY-MANDT.

      I try to use this statament in 4.6C and no error has occured.

      Max

  • author's profile photo Former Member
    Former Member
    Posted on Oct 15, 2005 at 10:47 AM

    Can anybody suggest me with out using where clause to delete table data in one shot..?

    Thanks

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 15, 2005 at 03:53 PM
    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.