04-03-2012 11:07 AM
Hi,
I am calling a BAPI inside a USER-EXIT, since I cannot use 'COMMIT WORK' or 'BAPI_TRANSACTION_COMMIT', what can i use to commit it to the db?
Kindly Reply.
Sneha
04-04-2012 10:56 AM
Can I use a COMMIT WORK or BAPI_TRANSACTION_COMMIT inside a Z.... FM which is being called inside a user exit?
04-03-2012 11:14 AM
When is the user exit getting triggered? If it is before the transaction does commit then you don't need to do a commit. You standard transaciton will do the commit for you.
if it is in update task, then create a z-fm Put your code in it with commit and call the FM in background task.
if it is after the save and not in update task then I guess you can do you commit in the exit
04-03-2012 11:15 AM
04-03-2012 11:33 AM
Thank you.
I'll create a z_,,, FM and select the update module in the form builder. guess that will help solve my problem.
04-03-2012 12:12 PM
You can try to build a FM RFC enabled, and in your user-exit CALL this FM IN BACKGROUND TASK [AS SEPARATE UNIT]. The FM will wait and be submitted during the COMMIT WORK, it will exc=execute in its own LUW and you will be allowed to program what you want in it.
Regards,
Raymond
04-04-2012 10:56 AM
Can I use a COMMIT WORK or BAPI_TRANSACTION_COMMIT inside a Z.... FM which is being called inside a user exit?
04-04-2012 11:04 AM
Yes if you called your FM in BACKGROUND TASK. No if you called it immediately or IN UPDATE TASK.
Regards,
Raymond