cancel
Showing results for 
Search instead for 
Did you mean: 

Delete Table entries

Former Member
0 Kudos

Hi Friends,

Can any body tell me which is the better method to delete the table entries?..

in 4.6C version if i give

Here no itab)

Delete ztab.

It is giving error like into clause is missing

Thanks in Advance

Accepted Solutions (1)

Accepted Solutions (1)

former_member188685
Active Contributor
0 Kudos

Hi Jak,

DELETE ZTAB FROM WA.

or

DELETE  ZTAB  FROM TABLE itab.

Regards

vijay

Former Member
0 Kudos

Hi Vijay,

Here there is no itab.

First i want to delete entries.

then i want to insert data from itab..

Ex: delete ztab.

insert ztab from table itab.

If i give delete from ztab.

It is asking for where clause.

I am using version 4.6c

thaks in Advance

former_member188685
Active Contributor
0 Kudos

Hi,

use

DELETE ZTAB.

Regards

vijay

Former Member
0 Kudos

First use

delete from ztab where <field> is not null.

then use

insert ztab from table itab.

Former Member
0 Kudos

Hi

Yes I've just remembered that stamanent DELETE FROM without WHERE CLAUSE doesn't work in your release.

But you can use a little trick, for example if FIELD1 is the first key:

RANGES R_FIELD1 FOR ZTABLE-FIELD1.

DELETE FROM <ZTABLE> WHERE FIELD1 IN R_FIELD1.

and then

INSERT <ZTABLE> FROM TABLE ITAB.

Max

Former Member
0 Kudos

Yes Vijay,

Your right.That worked.

But i have strange scnario here.

I have table like ztab.

1.delete ztab. It works fine.

2.i copied ztab to ztab_cc in se11.and activated ztab_cc.

i know there will not be entries in ztab_cc.

3.then i given delete ztab_cc...but it is giving errorlike into clause is missing at slect or from addition at delete..etc..

Thanks in Advance

former_member188685
Active Contributor
0 Kudos

Hi,

this also should work , check it once again. show the code where it is giving that error.

is ZTAB_cc is dbtab , and how you are copying the data...

Regards

vijay

Former Member
0 Kudos

It worked.

Thanks

Answers (4)

Answers (4)

former_member188685
Active Contributor
0 Kudos

Hi,

check this..

DELETE 


Deleting from a Database Table 
- DELETE FROM  dbtab. or 
DELETE FROM (dbtabname). 
- DELETE  dbtab      FROM wa. or 
DELETE (dbtabname) FROM wa. 
- DELETE  dbtab      FROM TABLE itab. or 
DELETE (dbtabname) FROM TABLE itab. 
- DELETE  dbtab. or 
DELETE *dbtab. 
- DELETE  dbtab VERSION vers. or 
DELETE *dbtab VERSION vers.

Regards

vijay

Former Member
0 Kudos

Use

delete from ztab.

LucianoBentiveg
Active Contributor
0 Kudos

DELETE FROM ZTAB.

Former Member
0 Kudos

Jak,

Yikes... I wouldn't delete anything until you get some formal training.

LucianoBentiveg
Active Contributor
0 Kudos

Good joke.

Former Member
0 Kudos

Hi

Use DELETE FROM statament:

DELETE FROM <ZTABLE> -> All hits'll be deleted.

You can also indicate some conditions if you don't need to delete whole table.

DELETE FROM <ZTABLE> WHERE .....

Max