cancel
Showing results for 
Search instead for 
Did you mean: 

Workflow template changed-Reset all the older workitems

Former Member
0 Kudos

I have changed the workflow template and even after moving it into production all the pending older workitems are still executing the older workflow template

I have around thousands of workitems(Descion task and its relavant workflow) which are triggering older workflow instance.

My duty is to complete all the items and restart Workflow for all these items at a time

Manually completing and restarting via SWUE for each workitem is taking a lot of time.

Could please suggest a way out

One more issue:On manually completing the item the next steps are being executed

But i need to logically delete at that particular step of the workflow and retrigger them.

Thanks in advance

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You can do this by developing a report for this purpose.

Following is an idea for the same.

1. Based on your workflow number and old version make a search on SWWIHEAD with status=Inprocess and wfd_id = <your workflow id> and wfd_version = < old version number of your workflow> and wi_type = F. This will give you a list of all main workflow instances IDs which are inprocess for old version of your workflow.

2. For each ID found above, make another call to SWWIHEAD where parent_wi = <found ID above> and wi_type=W and status = started/inprocess/seleceted.

3. For each workitem ID found above, read container SAP_WAPI_READ_CONTAINER to find object key which will be useful to raise event later using SAP_WAPI_CREATE_EVENT.

4. Delete the workitem ID using SAP_WAPI_WORKITEM_DELETE. Additionally you can also change the status of your main workflow to Completed just to make it not appear in any other reports needed for business for inprocess workflow details.

5. Raise the correct event using the values found in 3, you can use SAP_WAPI_CREATE_EVENT.

Check with SAP_WAPI* FMs and table SWWIHEAD. Just using these you can do a lot !!

Regards

Krishna Mohan

Former Member
0 Kudos

Hi Krishna

Thanks a lot for your kind co-coperation,u asked me to delete the workitems using the below FM :SAP_WAPI_WORKITEM_DELETE but i was told never to dlete any workitems in the production

does this cause any kind of issue?

Former Member
0 Kudos

Hi,

Hmm..thats right, in general deletion of anything in Production should be avoided as much as possible. However for your case to remove the workitem from user inbox ( if it is there, it will go with old workflow version which you do not want) only possibilities are either to execute/complete or delete. But if you execute/complete the workitem is will proceed to next step which will again follow old workflow version. So to make sure workitem of old workflow are not existing in user inbox, you can actually delete the workitem.

Good Luck !!

Regards

Krishna Mohan

Former Member
0 Kudos

Solved

Answers (2)

Answers (2)

Former Member
0 Kudos

Ideally it should work in old Wflow version only In order to make it work in newer version I think you have to create a program that will change the table SWWWIHEAD It is not advisable to change data of standard table in production and if man changes include deletion of step then you are to bother a lot. I will ask you to find out a workaround and try to complete functionality of those instance without using Workflow or triggering new Workflow.

This is very dodgy situation and requires a lot of understanding and cosulting with client.I feel you can slo revert back to the older version from PFTC Tcode.

GOTO->Workflow Builder->Choose Version

Thanks

Arghadip

former_member190818
Active Contributor
0 Kudos

Hi kittu,

if u want to delete the workitem go to trn code SWWL. U can select the workitems for particular user and delete them.