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

Implicit COMMIT WORK in Remotely Called Function

Former Member
0 Likes
4,241

Hello Master,

I have a question.

My program is in SSS system and when calling the RFC "ZRFC_TEST" with DESTINATION "DEST_DDD". One implicit COMMIT is performed in my local system (SSS System) and saved the data. Why does this happen?

In SSS local system have a validation SY-SUBRC after the RFC call, this validation to control the COMMIT or ROLLBACK.

thank for you help.

1 ACCEPTED SOLUTION
Read only

Maciej_DomagaBa
Contributor
0 Likes
1,842

The behaviour you observe is normal - an implicit database commit is performed when an RFC call takes place.

To be able to understand this you should first get familiar with the concept of "SAP LUW" (Logical Unit of Work) and distinguish between terms "SAP LUW" and "database LUW"

(see: http://help.sap.com/saphelp_erp60/helpdata/en/fc/eb3b64358411d1829f0000e829fbfe/frameset.htm).

What you observe is a "database LUW". A single SAP LUW may consist of many database LUWs, some of them triggered implicitly like the one you have found out.

To avoid writing your data changes to the database immediately when an implicit database commit occurs

you can put your ABAP statements performing data changes into separate function modules marked as update function modules, and then call these modules with "call function ... in update task". Finally call "commit work" or "rollback work".

ABAP staements "commit work" or "rollback work" finish the SAP LUW. Data changes included in

update function modules are actually executed when an SAP LUW is finished, not at the time when

you make a call to the update function module - so any implicit database commit which might occur before your "commit work" staement, will not write the data to the database.

regards

3 REPLIES 3
Read only

Former Member
0 Likes
1,842

Hi Juan,

By implicit you mean the commit is in ZRFC_TEST?

Yes generally, any database creation or changes have to be committed using the COMMIT statement. If the creation/changes were unsuccessful/incorrect, ROLL BACK is also used to undo the creation or changes.

Hence there is a COMMIT statement in ZRFC_TEST to commit the changes in the database of the destination server.

This validation is in Local system after RFC Call to commit or roll back changes to the database with respect to the local server.

This RFC can be called from any system but it commits the changes to the database in the CALLED system (destination system) itself

Let us know if you have any doubts but hope this helps!

Read only

SharathYaralkattimath
Contributor
0 Likes
1,842

Hi,

Please refer to this thread....

http://scn.sap.com/thread/3185942

Thanks,

Sharath

Read only

Maciej_DomagaBa
Contributor
0 Likes
1,843

The behaviour you observe is normal - an implicit database commit is performed when an RFC call takes place.

To be able to understand this you should first get familiar with the concept of "SAP LUW" (Logical Unit of Work) and distinguish between terms "SAP LUW" and "database LUW"

(see: http://help.sap.com/saphelp_erp60/helpdata/en/fc/eb3b64358411d1829f0000e829fbfe/frameset.htm).

What you observe is a "database LUW". A single SAP LUW may consist of many database LUWs, some of them triggered implicitly like the one you have found out.

To avoid writing your data changes to the database immediately when an implicit database commit occurs

you can put your ABAP statements performing data changes into separate function modules marked as update function modules, and then call these modules with "call function ... in update task". Finally call "commit work" or "rollback work".

ABAP staements "commit work" or "rollback work" finish the SAP LUW. Data changes included in

update function modules are actually executed when an SAP LUW is finished, not at the time when

you make a call to the update function module - so any implicit database commit which might occur before your "commit work" staement, will not write the data to the database.

regards