‎2013 Aug 05 12:30 PM
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.
‎2013 Aug 05 2:35 PM
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
‎2013 Aug 05 1:41 PM
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!
‎2013 Aug 05 2:06 PM
‎2013 Aug 05 2:35 PM
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