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: 

Rollback not working after usage of cl_http_client

ennowulff
Active Contributor

Hey there!

We have the following problem:

There is a standard function module that changes data on a database table.

Aftwerwards we use cl_http_client with methods create_by_url, send and get.

After using this class the ROLLBACK WORK does not work anymore.

We told the debugger to stop at COMMIT WORK but obviously a COMMIT WORK is not executed.

Before CL_HTPP_CLIENT ROLLBACK WORK works and the update was rolled back.

After class usage it doesn't.

Are there any hints/ documentation that usage of cl_http_client forces a commit?

Thanks for any hints

Enno

1 ACCEPTED SOLUTION

ennowulff
Active Contributor

thorsten.franz.operatics just gave this hint:

ICF automatically triggers implicit DB commit during HTTP(S)/SMTP. Cleanest way to be able to rollback is to do all DB updates in update function modules because they will only be triggered by COMMIT WORK, not by a mere DB commit.

https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abendb_commit.htm

Thanks Thorsten! didn't find the hints to the implicit commits...

5 REPLIES 5

BiberM
Active Participant
0 Kudos

Is there an implicit commit work at some point? I do have a similar case at the moment which I did not solve yet.

Call function... Destination is such an example. It issues an implicit commit. A method like cl_gui_cfw=>flush() does such a call deep inside.

Open a table viewer in a second window/tab and check after which function/statement the data change appears. Because normally without a commit a second process like table viewer must not "see" the change until a commit.

ennowulff
Active Contributor

thorsten.franz.operatics just gave this hint:

ICF automatically triggers implicit DB commit during HTTP(S)/SMTP. Cleanest way to be able to rollback is to do all DB updates in update function modules because they will only be triggered by COMMIT WORK, not by a mere DB commit.

https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abendb_commit.htm

ennowulff
Active Contributor

thorsten.franz.operatics just gave this hint:

ICF automatically triggers implicit DB commit during HTTP(S)/SMTP. Cleanest way to be able to rollback is to do all DB updates in update function modules because they will only be triggered by COMMIT WORK, not by a mere DB commit.

https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abendb_commit.htm

Thanks Thorsten! didn't find the hints to the implicit commits...

So, you are in the case of "ICF client program", and the commit would happen when you call the method RECEIVE:

ennowulff
Active Contributor
0 Kudos

Thanks for clarifying, sandra.rossi !