‎2007 Dec 28 8:54 AM
Hi,
Can anyone tell me how we can delete a table at the database level using an ABAP report ?
‎2007 Dec 28 8:56 AM
HI,
Yes you can do that by using Native SQL.
IF the DB is oracle then u can use Drop Ztab.
Regards
Naveen Gupta
PS: Reward Points if helpfull.
‎2007 Dec 28 8:59 AM
‎2007 Dec 28 10:27 AM
Hi try like this:
In a report program give a statement like:
Drop table <tablename>.
And execute this report program. Thats all, ur table gets deleted along with its structure in the DB level.
with regards,
Hema Sundara.
‎2007 Dec 28 12:50 PM
Thanks guys, I created the report. I have reproduced it below...
REPORT zdeletetable.
EXEC SQL.
DROP TABLE ZTESTTABLE
ENDEXEC.
IF sy-subrc = 0.
WRITE:/ 'Table ztesttable deleted from the database !'.
ENDIF.
‎2007 Dec 31 3:58 AM
Hi ,
You can only delete a transparent table in the ABAP Dictionary when it is no longer used in other objects .
Proceed as follows to delete a table:
Enter the name of the table in the initial screen of the ABAP Dictionary.
Select object type Tables.
Choose DD object ® Delete.
A dialog box appears asking you to confirm the deletion request again.
Confirm the deletion request.
If it is no longer used in other objects and there is no longer a corresponding database table, the table is now deleted.
The corresponding table definition must be deleted on the database before deleting the table. You will be informed in a dialog box if the table was already created on the database. You must confirm that you want to delete the database table in this dialog box. If you do not do so, the deletion will be canceled.