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

syntax to delete total records from database table

Former Member
0 Likes
6,632

Hi all.

Can you pls let me know how to delete all the records from database table.Thanks in advance.

Thanks & Regards,

sami.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,342

hi,

Delete <database-tab>.

in program.

Thanks

Sharath

Hi all.

Can you pls let me know how to delete all the records from database table.Thanks in advance.

Thanks & Regards,

sami.

14 REPLIES 14
Read only

Former Member
0 Likes
3,343

hi,

Delete <database-tab>.

in program.

Thanks

Sharath

Read only

Former Member
0 Likes
3,342

Hi SAMI ,

You try this code -


DELETE   FROM   dbtab_name.

Regards

Pinaki

Edited by: Pinaki Mukherjee on Feb 16, 2009 7:12 AM

Read only

Former Member
0 Likes
3,342

Hi Sami,

Use DELETE command. Keep ur cursor on DELETE, press F1 and you will get the syntax for DELETE.

Thanks,

Ibrahim

Read only

Former Member
0 Likes
3,342

DELETE FROM dbtab

Read only

gaursri
Active Contributor
0 Likes
3,342

Hi Sami,

You can use

DELETE  FROM sflight.

or you can specify the where condition.

Hope your query is resolved.

Have a best day ahead.

Read only

Former Member
0 Likes
3,342

(this can be along way to do.)

u can fetch all the recoreds into an internal table. loop at itab.

DELETE itab FROM 1.

endloop.

modify database table from itab.

Edited by: Kalyan Chakravarthi on Feb 16, 2009 7:13 AM

Read only

Former Member
0 Likes
3,342

Hello,

DELETE { {FROM tgt [WHERE sql_cond]}

| {tgt FROM source} }.

check this....

Read only

Former Member
0 Likes
3,342

Hi,

To delete data from the data base.

Simply wirte




Delete dbtab.    " delete is the key word    dbtab pass the database table name
 

Thanks

Arun

Read only

dev_parbutteea
Active Contributor
0 Likes
3,342

Hi,

Go to transaction SE14, select delete data radio button and click on Activate and Adjust database.

Regards.

Read only

Former Member
0 Likes
3,342

Hi Sami,

I think you should not remove the habit of reading the SAP help provided just because you get answers in SDN...for finding formulas you can always refer help, because it might give you a perfect syntax based on the requirement as in SDN you will ask for some requirement and if its not clear you may end up getting an incorrect syntax...

just write the keyword delete in the ABAP editor and then press F1, you can get all the information..

Regards,

Siddarth

Read only

Sm1tje
Active Contributor
0 Likes
3,342

Sami,

before even considering of deleting any records from a database table, you might wanna think about the following. If there any other tables, referencing the table you are trying to delete the records from, this will have a major impact on the integrity of your database.

As a rule of thumb: Never ever delete any records from database by using the DELETE statement, unless you are absolutely sure this has no further impact. In most cases, this will only be when you are doing this on a custom table (a non-standard SAP table).

So in case of standard table, try to find the standard delivered function modules for this.

Just a word of advice.

Read only

Former Member
0 Likes
3,342

Hi.

Just write the following

DELETE FROM (NAME OF THE TABLE).

DELETE FROM MARA. (Where mara is the name of the d/b table)

You can even add the where condition based on your requirent for example you won to delete specific records

DELETE FROM MARA WHERE MATNR = -


.

Regards

Sumeet malhotra

Read only

Former Member
0 Likes
3,342

Use FM SUBST_DELETE_TABLE_CONTENT