‎2007 Feb 23 1:52 PM
Hi ,
I need to delete all the records in the dtabase table and insert new data into it.
I use the below code , but the delete returns with sy-subrc 4 and doesnt delete the records in table ?
delete ZZVT2_BW.
commit work and wait.
insert ZZVT2_BW from table itab_zvt2 accepting duplicate keys.
commit work and wait.
Thanks,
‎2007 Feb 23 1:53 PM
‎2007 Feb 23 1:55 PM
Hi ,
u can use DELETE FROM dbtab.
in your case write
delete from ZZVT2_BW.
INSERT dbtab FROM TABLE itab.
Regards,
Sruthi.v
‎2007 Feb 23 1:56 PM
‎2007 Feb 23 2:01 PM
Deleting from a Database Table
<b>- DELETE FROM dbtab. or
DELETE FROM (dbtabname).</b>
- DELETE dbtab FROM wa. or
DELETE (dbtabname) FROM wa.
- DELETE dbtab FROM TABLE itab. or
DELETE (dbtabname) FROM TABLE itab.
- DELETE dbtab. or
DELETE *dbtab.
- DELETE dbtab VERSION vers. or
DELETE *dbtab VERSION vers.
use the bold text in u r program
‎2007 Feb 23 2:01 PM
Depending on the size of the table you might want to check this <a href="https://forums.sdn.sap.com/click.jspa?searchID=-1&messageID=2749963">thread</a>.
It basically describes how to use function module DD_DATABASE_UTILITY to delete big tables (i.e. deleting ALL records).
Guenther