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

delete all entries from table

Former Member
0 Likes
18,037

Hi Guys,

How to delete all entries from a table?

is a customer table, and i dont want to delete doing a loop.

because is a huge table.

any ideas?

PS: ..CUSTOMER TABLE...

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
8,517

Quick way is to use native SQL (ie EXEC SQL ENDEXEC) and the TRUNCATE commaned.

Alternatively use ABAP command DELETE:

DELETE from <tab> client-specified where mandt = '001'.

12 REPLIES 12
Read only

Former Member
0 Likes
8,517

hi,

Write a custom program and write the below code ..


delete <ztable>.

Regards,

Santosh

Read only

0 Likes
8,517

DELETE Does not work like that.

you need at least one from with a where condition.

I tried

DELETE FROM ztable

client especified

where mandt = sy-mandt.

but is not working.

Read only

Former Member
0 Likes
8,517

try using SE16N or use ,..

delete ZTABLE .

Read only

Former Member
0 Likes
8,517

You can use the statement DELETE

DELETE ZTABLE.

Read only

Former Member
8,517

From SE14.

give table name than edit select redio button delete data .

Read only

Former Member
0 Likes
8,518

Quick way is to use native SQL (ie EXEC SQL ENDEXEC) and the TRUNCATE commaned.

Alternatively use ABAP command DELETE:

DELETE from <tab> client-specified where mandt = '001'.

Read only

0 Likes
8,517

Does not work

I solved the problem, but the performance is not as good as i wanted.

SELECT *

INTO CORRESPONDING FIELDS OF ti_ztable

FROM ztable.

DELETE FROM ztable

WHERE key = ti_zce1pisa-key.

ENDSELECT.

Read only

0 Likes
8,517

Javier,

have you tried this?

From SE14.

give table name than edit select redio button delete data .

Read only

0 Likes
8,517

Of course that is an option,

but i need that in ABAP code. (call transaction for only a delete is 2 much)

tks anyway.

Read only

0 Likes
8,517

if you need a condition...you can use a dummy one...

DELETE FROM ztable

where 1 = 1.

Read only

0 Likes
8,517

DELETE FROM ztable where key ne space.

Read only

Former Member
0 Likes
8,517

hi,

Create a table maintainence generator and then goto SM30 and delete the entries from here ...

Regards,

Santosh