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

COMMIT statement

Former Member
0 Likes
2,793

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

7 REPLIES 7
Read only

naveen_inuganti2
Active Contributor
0 Likes
1,695

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

Read only

Former Member
0 Likes
1,695

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.

Read only

Former Member
0 Likes
1,695

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

Read only

Former Member
0 Likes
1,695

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

Read only

Former Member
Read only

Former Member
0 Likes
1,695

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

Read only

Former Member
0 Likes
1,695

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.