2006 Nov 10 10:05 AM
Hi,
I use a very simple program to delete an entire table. Like the following:
REPORT z_erase_vcom1.
TABLES /bic/pvcom1.
DELETE FROM /bic/pvcom1.
the data is erased, but the table still contains the key fields. how can i completely erase the table including all fields?
afterwards i want to fill the table with fresh data from another system. so i want this table to be clean.
thanks,
stefan
2006 Nov 10 10:09 AM
2006 Nov 10 10:09 AM
2006 Nov 10 10:11 AM
Hi,
chk this.
SELECT * FROM /bic/pvcom1
INTO CORRESPONDING FIELDS OF TABLE it_tab.
DELETE /bic/pvcom1 FROM TABLE it_tab
CALL FUNCTION 'DB_COMMIT'.
regards
Anver
<i><b>if hlpe pls mark points</b></i>
2006 Nov 10 10:13 AM
Hi,
DELETE statement will delete records in internal table.
CLEAR statement will clear work area. (i.e data stored in header)
REFRESH will clear all records including header record in table. And table will be empty.
For your requirement REFRESH is appropriate.
*MARK all helpful answers
2006 Nov 10 10:16 AM
Hi thank you all,
good work:)
this rewarding system does not work sometimes...
2006 Nov 10 10:17 AM
hai ,
do this way.
data : i_/bic/pvcom1 like /bic/pvcom1 occurs 0 .
select * from /bic/pvcom1 into i_/bic/pvcom1 .
delete /bic/pvcom1 from table i_/bic/pvcom1 .
2006 Nov 10 10:20 AM
DELETE FROM /bic/pvcom1 WHERE condition.
Find the condition that is true for all lines.
For example, a numeric field that is always positive the condition is:
DELETE FROM /bic/pvcom1 WHERE field GT -1.