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 key fields in a table

Former Member
0 Likes
862

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
792

hi,

refrash tablename.

6 REPLIES 6
Read only

Former Member
0 Likes
793

hi,

refrash tablename.

Read only

anversha_s
Active Contributor
0 Likes
792

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>

Read only

Former Member
0 Likes
792

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

Read only

0 Likes
792

Hi thank you all,

good work:)

this rewarding system does not work sometimes...

Read only

Former Member
0 Likes
792

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 .

Read only

roberto_tagliento
Active Contributor
0 Likes
792

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.