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

Data deletion from database table

Former Member
0 Likes
501

Hi all,

I need to create a program to delete old data's from database tables through a program. the criteria is the input for the program is to be any table name and date . is this requirementt possible.is there any function module cattering to this.

thanks,

Edited by: kavitha k on Apr 3, 2008 3:56 AM

4 REPLIES 4
Read only

Former Member
0 Likes
475

Hi, It is not recommended to delete/ update database tables directly. Should you need to delete document/ transaction you might want to explore on Archive adminstration.

Read only

Former Member
0 Likes
475

Hi kavitha,

What Eswar told is Right....make sure bofore going to delete the table data....

Please go thru the below link..

http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb3aef358411d1829f0000e829fbfe/content.htm

in program you can do this also

data itab type standard table of dbtab.

select * from dbtab into table itab.

delete dbtab from table itab.

if you are intended to refresh database table

In case you want to delete the database table for refreshing it for a reason (one time) you can do it from transaction SE14.

or

se11> change>utilities> database object> databsae utitlity...

Select option "Activate and Adjust Database Table" and option "Delete data".

Regards,

Sreenivasa Sarma K.

Read only

Former Member
0 Likes
475

Hi,

Yes this is possible.

PARAMETERS : p_name(40).

START-OF SELECTION.

DELETE FROM (p_name) where condition.....

<REMOVED BY MODERATOR>

Edited by: Alvaro Tejada Galindo on Apr 11, 2008 4:50 PM

Read only

Former Member
0 Likes
475

Hi Kavitha,

There is an Standard Tx-Code SE16n available ta delete data directlt from table.

Regards,

Shivu.