‎2005 Oct 15 8:43 AM
To delete data in one shot from database table...
delete dbtable not working..
IS it necessary to use where clause?
plz help me out
‎2005 Oct 15 9: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
‎2005 Oct 15 9:27 AM
Max thanks a lot for ur reply.
My requirement is just deletion of total data in one shot from database table thru abap program.
DELETE dbtable ...is for one row delete only?
suggest me query for this requirement...
i award u points also...
thank u
‎2005 Oct 15 9:29 AM
and moreover...i dont want to use any itabs...in this issue
‎2005 Oct 15 9:35 AM
Ok
you use this statatment without where conditions:
DELETE FROM <TABLE>.
Max
Message was edited by: max bianchi
‎2005 Oct 15 9: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
‎2005 Oct 15 10: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
‎2005 Oct 15 10: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..
‎2005 Oct 15 10:29 AM
sorry error msg : delete from dbtab shud be followed by where clause...
‎2005 Oct 15 10: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.
‎2005 Oct 15 2:49 PM
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
‎2005 Oct 15 11:47 AM
Can anybody suggest me with out using where clause to delete table data in one shot..?
Thanks
‎2005 Oct 15 12:02 PM
For non crossclients tables you can try with.
DELETE FROM <DBTABLE> CLIENT SPECIFIED WHERE MANDT = SY-MANDT.
Svetlin
‎2005 Oct 15 12:15 PM
you can use
delete from <dbtable> .
to delete all entries. it works fine. I just tried it out.
we are using 4.7
Regards
Raja
‎2005 Oct 15 3:40 PM
As others pointed out here, you can delete without using the where clause from 47 onwards. Why is that you don't want to use the where clause? It is as simple as
DELETE FROM dbtab WHERE <some key field> <> SPACE.
‎2005 Oct 15 4:53 PM
Hi raja,
check this...
http://help.sap.com/saphelp_erp2004/helpdata/en/1e/f5383fe58d5900e10000000a114084/frameset.htm
regards,
venu.