Hi Ravi,
In that case you can use SAP_WAPI_SET_WORKITEM_STATUS for change status accordingly..
based on your requirement you have to implement.
go through this links..
Change the status of worklow ?
Function Module to change the workitem Status
Thanks & Regards,
Srinivas.