2015 Dec 22 9:58 AM
Hello Guru's,
Is there a way to detect at run-time whether a method is running in Update Task or not?
Concrete I have an abstract method which sets in an own DB-Table a status flag. This can happen in a lot of places (why it is abstract) but also for example during BADI of create inbound delivery which then runs in Update Task (rightfully I think).
I would like to see inside my abstract method whether I can do the commit or not but there seems no syst-field (or I missed it)
Thanks and a supercalifragelisticexpialidoucious 2016
Dirk
2015 Dec 22 10:05 AM
You can use the method CL_SYSTEM_TRANSACTION_STATE=>GET_IN_UPDATE_TASK( ).
BR,
Suhas
2015 Dec 22 10:05 AM
You can use the method CL_SYSTEM_TRANSACTION_STATE=>GET_IN_UPDATE_TASK( ).
BR,
Suhas
2015 Dec 22 10:06 AM
Hi Tyriad,
The below Function module can be used to check if the program is being called in update task or not.
CALL FUNCTION 'TH_IN_UPDATE_TASK'
IMPORTING
in_update_task = lf_update_task.
Thanks,
Karthikeyan
2015 Dec 22 10:08 AM
Hi,
>>the COMMIT WORK commit all database changes and executes all functions modules called in update task that's why we need not to call COMMIT WORK in user exits and BADI's.
>> To debug update FM we need to switch on Update Debugger in debugging mode, if your FM is running in Update task your debugging flow will reach it
thanks!!
2015 Dec 22 10:20 AM
2015 Dec 22 10:26 AM
2015 Dec 22 12:33 PM
Thanks for the quick and accurate reply your name is fore ever in the code
IF cl_system_transaction_state=>get_in_update_task( ) = 0.
JollyHelpFrom Suhas Saha: http://scn.sap.com/message/16428484#16428484
COMMIT WORK AND WAIT. " WeighBridge comes here in UpdateTask(CreateInbound)
ENDIF.
I have to say that what was suggested in http://scn.sap.com/thread/1294685 (using nativ SQL-commit and accepted) seems to me a lot more dangerous.
2015 Dec 22 12:48 PM