Application Development 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: 

Delete all records from a Z table.

Former Member
0 Kudos

I want to delete all existing records of a ZTABLE every time one program is executed and new records will be inserted.

I used DELETE <TABLENAME>. But it is not working.

10 REPLIES 10

former_member404244
Active Contributor
0 Kudos

Hi,

Try like this

DELETE FROM ztable CLIENT SPECIFIED WHERE mandt EQ sy-mandt.

Reward if helpful.

Regards,

Nagaraj

Former Member
0 Kudos

Hi

Press F1 on the DELETE statement and take the correct command syntax and use like

DELETE table <name> from ITAB.

Regards

Anji

Former Member
0 Kudos

Hi,

Delete Z-TABLE from TABLE itab.

==================================================

PARAMETERS p_carrid TYPE sflight-carrid.

TYPES: BEGIN OF sflight_key,

mandt TYPE sflight-mandt,

carrid TYPE sflight-carrid,

connid TYPE sflight-connid,

fldate TYPE sflight-fldate,

END OF sflight_key.

DATA sflight_key_tab TYPE TABLE OF sflight_key.

SELECT carrid connid fldate

FROM sflight

INTO CORRESPONDING FIELDS OF TABLE sflight_key_tab

WHERE carrid = p_carrid AND

fldate = sy-datum AND

seatsocc = 0.

DELETE sflight FROM TABLE sflight_key_tab.

regards,

Omkar.

Former Member
0 Kudos

Try this:

DELETE i_vbak_vbep WHERE auart = v_auart.

Reward points

Former Member
0 Kudos

hi,

first extract all the data from data base table in to internal table itab.

then use this statement

DELETE dbtab FROM TABLE itab

regards

siva

Former Member
0 Kudos

use clear ztable.

regards

Former Member
0 Kudos

Hi,

Try

Delete From <TABLENAME>.

Regards,

Savitha

Former Member
0 Kudos

Hi

Delete Z-TABLE from TABLE itab.

==================================================

PARAMETERS p_carrid TYPE sflight-carrid.

TYPES: BEGIN OF sflight_key,

mandt TYPE sflight-mandt,

carrid TYPE sflight-carrid,

connid TYPE sflight-connid,

fldate TYPE sflight-fldate,

END OF sflight_key.

DATA sflight_key_tab TYPE TABLE OF sflight_key.

SELECT carrid connid fldate

FROM sflight

INTO CORRESPONDING FIELDS OF TABLE sflight_key_tab

WHERE carrid = p_carrid AND

fldate = sy-datum AND

seatsocc = 0.

DELETE sflight FROM TABLE sflight_key_tab.

Regards

Pavan

Former Member
0 Kudos

Hi,

before insert the new data, check the ZTABLE, select all data. if record is found then delete all the old records & refresh the same, after that u can insert ur new records.

Or u can do one more thing. create one new field in ztable say mark for deletion.

before new data insertion, select all existing record & update the new field as X. and after new records insertion update the new field as blank.

if it is helpfull pls reward pts.

Regards

Srimanta

Former Member
0 Kudos

Hi

Use DELETE FROM <TABLENAME>.

Thanks

Vasudha