Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Drop Table

Former Member
0 Likes
4,325

Hi experts,

i have transparent table and i would like to use faster delete

i don't want to use

DELETE FROM table CLIENT SPECIFIED WHERE mandt = sy-mandt, it takes much time for mil. rows.

Does ABAP know something similar as DROP TABLE

Thanks

Martin

5 REPLIES 5
Read only

Former Member
0 Likes
1,823

erm. you are aware that drop table wont delete your records but the whole table?

remove your client specified addition, maybe this speeds him up a bit, since you are thinking of dropping the table, there are probabaly no records you wish to keep.

Read only

0 Likes
1,823

sorry, i thought TRUNCATE instead of DROP table of course

Read only

0 Likes
1,823

The FM 'DB_TRUNCATE_TABLE'.

There are a bunch of FM about DB management.

You can go to SE37 and search 'DB*' FM

There is also the DB_DROP_TABLE FM..

Edited by: Simone Milesi on Jul 17, 2009 10:09 AM

Read only

Former Member
0 Likes
1,823

Hello,

If allowed in your project or in program you can also you DROP TABLE using native SQL.

Sudo Syntax is:

EXEC SQL.

DROP TABLE <table_name>.

ENDEXEC.

Note: Native SQL's are avoided due to the performance overhead and are limited to support of specific database used at backend.

Thanks,

Augustin.

Read only

0 Likes
1,823

Hi

It is possible delete table using ABAP variable?

like this (but give a error)

DATA: tabName TYPE string.

tabName = 'tab01'.

EXEC SQL.

        DROP TABLE :tabName

ENDEXEC.

Thank you