‎2008 Apr 03 2:54 AM
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
‎2008 Apr 03 3:01 AM
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.
‎2008 Apr 03 3:03 AM
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.
‎2008 Apr 03 4:15 AM
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
‎2008 Apr 11 11:56 AM
Hi Kavitha,
There is an Standard Tx-Code SE16n available ta delete data directlt from table.
Regards,
Shivu.