Hi Gaurav,
what do you mean with runs in background?
Do you send the message through a QRFC?
You could just send the message through SE37 or with a report or the WebUI and set a Breakpoint in your activity function module.
Or do you mean debugging into TM? Then you have to provide a debugging option like in /SAPTRX/TMS_CHANGE_EXEC_INF.
Best regards,
Steffen