The class CL_SYSTEM_TRANSACTION_STATE contains methods that return the status of the current SAP LUW.