Application Development 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: 

Deleting data fron standard tables

Former Member
0 Kudos

hi folks,

what are the different ways to delete data from satnadard tables.thanx in advance.

santosh.

6 REPLIES 6

Former Member
0 Kudos

If you are authorised to use SE16N tcode..

follow these steps.

go to se16n.

enter table name.

enter &SAP_EDIT in command line press enter.

you'll get message 'SAP editing function activated'

press F8.

here you can delete records by selecting rows.

OR.

write small program to delete records..

these statements you can use in your program...

you can find these stmts in SAP help

Deleting from a Database Table

- DELETE FROM dbtab. or

DELETE FROM (dbtabname).

- 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.

Former Member
0 Kudos

hi

u can use

DELETE <dbname>

DELETE <dbname> client specified

DELETE FROM <dbname> WHERE <condition>

DELETE FROM <wa>

Former Member
0 Kudos

Hi,

Check this example -

DELETE FROM employees WHERE employee_id = 23.

This should work..

Thanks,

GC.

*Reward points if it helps..

Former Member
0 Kudos

Hi,

you can use DELETE statement:

DELETE FROM your_table WHERE your_condition.

or

DELETE your_table FROM your_workarea.

or

DELETE your_table FROM TABLE your_internal_table.

Just write DELETE in SE80 and hit "F1" for a detailed description.

Regards

Mark-André

Former Member
0 Kudos

Hi,

Firstly, you should not delete any record from standard SAP tables using direct database statements. There are proper methods for every activity to be performed on data in standard SAP system.

This is table for Batch Stocks. This is not a direct transaction table in SAP. Data is added or modified in this table through various transactions mainly of MM, PP & SD. Hence BAPI or BDC cannot fulfill the requirement.

If your requirement is to withdraw batch stocks, then cancel the material documents that have posted the stock. If your material period is already closed and you are not able to cancel the material documents, then withdraw your stocks by posting it to scrap with permission from management. If it is uploaded stock, withdraw it using 562 movement.

Never ever try to delete records from standard tables directly. It will lead to inconsistencies and lot of confusions in the system.

Just to let you know:

entries in BKPF and BSEG means entries in an unknown number of dependent tables - secondary index tables, general ledger tables, just to name a few.

You can do a mass reversal on the documents posted by a certain user. Afterwards everything is fine.

Except from this: Ever heard of the ENRON scandal? Maybe you feel like 'See you next time in Jail'.

use statement :

delete bkpf where usnam = p_name.

same applies to bseg...

Also, I don't think deleting entries from these 2 tables is advisable or even legal...

Reward points if found helpful…..

Cheers,

Chandra Sekhar.

Former Member
0 Kudos

hi,

the following thread is answering u r question

regards,

pavan