‎2011 May 06 9:41 AM
Hi,
Is it possible to call a function module and insert / update records within that function module and later commit work / Rollback work in the calling program instead of within the function module?
This is because I want to implement parallel processing by calling RFC function. In this function I'm updating records to database.
Is it possible to check that all the records are processed in all the calls to the FM and then later commit / rollback finally in the calling program?
Regards,
Sriram
‎2011 May 06 10:21 AM
Hi.,
Yes U can do that., After function module u can commit or roll back.., make sure that the last statement in Function module is the insert or update or whatever it is related to database statement., and in your program after function module check sy-subrc and then commit or roll back..,
Hope this helps u.,
Thanks & Regards
Kiran
‎2011 May 06 10:21 AM
Hi.,
Yes U can do that., After function module u can commit or roll back.., make sure that the last statement in Function module is the insert or update or whatever it is related to database statement., and in your program after function module check sy-subrc and then commit or roll back..,
Hope this helps u.,
Thanks & Regards
Kiran
‎2011 May 06 10:33 AM
That's possible, but the question is what FM you are using.
You have to make sure, that the FM does not commit its work inside. If it is a SAP function module and if it executes commit, then there is nothing you can do, because you cannot change itu2019s code.
However, if you are using FM which doesn't execute commit or this is a customer function module, which you can change (with all restrictions related to that), then you can call the commit after checking the sy-subrc value.