‎2007 Sep 12 6:05 AM
hi , my rquirement is , i want to delect some record from database table MCHB
‎2007 Sep 12 6:26 AM
use delete statement with proper conditions
DELETE FROM <ZTABLE> -> All hits'll be deleted.
You can also indicate some conditions if you don't need to delete whole table.
DELETE FROM <ZTABLE> WHERE .....
‎2007 Sep 12 6:30 AM
‎2007 Sep 13 2:38 PM
‎2007 Sep 13 3:21 PM
Ypou should use a BAPI or batch input for this, not direct table deletes. What transaction normally deletes records from this table?
Rob
‎2007 Sep 14 7:37 AM
Hello,
After deleting do use the statement COMMIT Work and WAIT.Otherwise the deleted entries will not be reflected in the table..
Thank's
Rakesh
‎2007 Sep 16 6:33 AM
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.
Regards,
Hema
‎2007 Sep 18 3:09 PM
To chime in on the advises of using a BAPI instead of directly deleting standard table entries:
When someone else currently works with a table entry and you try delete that data, you will be in trouble and generate inconsistencies that prolly can't be repaired. That's the advantage of a BAPI, because it will take care of the locking mechanism which avoids 2 users accessing and manipulating the same data. (every standard table has corresponding standard BAPI's to maintain the data)
Say "No!" to direct table manipulations!
kr,
Walter
‎2007 Sep 19 2:39 PM
If ever a direct table update is necessary, (and yes, there are cases, when no BAPI is available) at least foresee the table locking. In SE11, lookup the lock object for the corresponding table. Each lock object has 2 FM's: one for locking and one for unlocking --> call them in your code. This will avoid the locking issues.
‎2007 Sep 19 8:54 PM
Lalith,
MCHB is a standard SAP table for Batch Stocks. It is always a bad idea to delete directly from SAP tables. Use an appropriate SAP transaction to delete data from this table.
‎2007 Sep 19 9:17 PM
Lalith,
Its not advisable to delete the date directly from the data base table.... rather you can over write some data for the important field.
Like if you take LFA1 table if you make LIFNR field data to 'do not use' then in the table all those records are kind of deleted...
so I can suggest you this way..... you can do it with the mass maintanance