Based on your description the problem is in your class method including the status change logic. I assume that you have tested the method in SE24 and it works? The next step is to make sure that the method gets the correct document ID from the workflow (=there is a binding from the workflow to the task, and then possibly from task to the method). Eventually if you cannot find the reason for the problem, you need to debug the method during the workflow execution. For this you need use the background job debugging trick (infinite loop in code with transaction code SM50), since the normal breakpoints will not work.
>After observation, I found one more thing that in table PTREQ_HEADER, when the request status is changed in workflow after 1st approval, a new record for that leave request id is created with new version number 2. Hence, the older version 1 has status SENT now, but the newer version 2 has status approved. And the workflow log reflects the leave request version as 2 and status as APPROVED.
This is correct. If I remember correctly, if your status change method would work correctly, then you would find a new version (3) with status SENT again.
Regards,
Karri