Thanks Sham,
I have used your logic to implement the IF_SWF_IFS_WORKITEM_EXIT interface in a class and used the program exit in the decision step.
The after execution method checks if the payroll area of the employee is locked. if that is true, it thows an error "payroll area locked" and stops execution of the same.
Thanks a lot.