07-17-2008 9:49 AM
Hi,
I want to delete records from an custom table and I am writing a DELETE statement. Before the delete statement, i am calling a function module 'ENQUEUE_E_TABLEE' for locking the table.
When I execute the program/report, the entries are still existing in the custome table and it is not deleting.
Do i need to use commit work statement after the DElete statement.
If so why is it mandatory to use COMMIT for deleting entries.
For inserting records in the custom table , if i don't use the COMMIT statement, the records are still inserting in the table. Why is it so?
Thanks,
Kumar
07-17-2008 9:51 AM
Hi..,
No need to use commit statement...
Just write...
> parameters: p_f1 like <db>-f1
>
> start-of-selection.
> DELETE FROM <database table name> where f1 = p_f1.
Thanks,
Naveen.I
07-17-2008 9:53 AM
Kumar,
i would suggest you to get SAP help as much as possible cause some time we can misconcept but SAP never.
just press F1 on commit statement you will get your answer.
Amit.
07-17-2008 9:53 AM
Hi,
Locking the table (ENQUEUE) is not compulsory for deleting an entry.
It is absolutely necessary for Editing a table.
So no need of ENQUEUE statement. Just use DELETE dbnam WHERE condition..
This should work fine
//Kothand
07-17-2008 9:54 AM
Hi !
Database transactions ar only closed when a commit work follows any databse operation.
DELETE without a explicid commit may work because the sap-system causes the databse to do implicid commits i.e. when changing the screen, displaing a popup, a list ....
Regards
Rainer
07-17-2008 9:55 AM
hi ,
see this link..
http://help.sap.com/erp2005_ehp_03/helpdata/EN/41/7af4dda79e11d1950f0000e82de14a/frameset.htm
hope it will help..
07-17-2008 9:55 AM
Hi,
Do not lock the table before Deleting the entry. Try deleting the entry without using the FM 'ENQUEUE_E_TABLEE'. It should get deleted then.
Regards,
Nadim
07-17-2008 9:55 AM
For inserting records in the custom table , if i don't use the COMMIT statement, the records are still inserting in the table. Why is it so?
The system calls implicit COMMIT statements at points in processing anyway. The statement is available in ABAP so you can create your own explicit commit...rollback routines.