Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Workitem Generation Issue

Former Member
0 Likes
2,292

Please guide us on how in workflow, work item number gets generated at run time.

In Production System , we are having an issue where work item number are not getting generated in a particular sequence. This is affecting our code logic which we have implemented based on work item number of future task.

example if current work item number of task is  593862 , Then Next step generated 593863 ( Previous +1) and further to this next task should generate 593864 but it generated 593866. May be 593864 got generated for difference work flow instance of different document.

There are 6-7 such cases reported in production where workflow has generated work item number not in sequence sometime added by 2  to previous work item or by 1.

Please help as to what can be done so that it always generate work item in sequence . 

8 REPLIES 8
Read only

mauro_blanc3
Active Participant
0 Likes
1,598

Please post the same question in they will be able to help you.

Read only

0 Likes
1,598

Hi.

The Workitem ID  is created from number Range Object SWW_WIID.

If you have more than one Application-servers the buffer of the Object could be a problem.

And there are a lot of Background-Workitems in the System. Maybe they are taking some numbers.

You can check the Workitems in your system using Transaction SWI1 .

Regards,

Peer

Read only

0 Likes
1,598

Dear Peer

Is there a way we can get system generate wi number in a sequence manner for particular workflow instance. Ex after 13, 14 should be generated for next step but 15 got generated because 14 was being occupied by some other workflow instance of different document running in live syatem.

Read only

Former Member
0 Likes
1,598

Hi Silky,

Nice to see you here. two points from my side.

1. There is no way you can ensure the workitems in sequence. Its only possible if you stop all other workflows ( including standard and custom , and some background processes ) which is near to impossible.

2. The logic which you have written in the code for sequence workitem ID is incorrect. If you need particular workitem id , there are a lot of FM/Classes/Methods to fetch the same. Please use that.

Thanks

Rakesh

Read only

0 Likes
1,598

Dear Rakesh

Yes there are many FM/Classes to get the WI ID but  we do not have the provision to use FM/Classes /Methods to get the WI of the task which has not being generated yet.  We have to pass the WI to web dynpro application thru URL parameter in NWBC environment  . Since wi id which is passed to WD app is of task which will be generated post sending mail we have made this assumption of WI sequence number.

There are randomly few cases which are not generating the WI ID in sequence but  for 90% cases this is generating in sequence manner.

We need to ensure the system to behave uniformly

Read only

0 Likes
1,598

Hi Silky,

I got your requirement now. You can use program exit/Workitem exit to send the mail rather than mail step. Put a program exit in the actual workitem and prepare your email with actual workitem id and other parameters and by this way , you will be getting always correct workitem ID.

Thanks

Rakesh

Read only

0 Likes
1,598

ok.. Then how will we pass the Dialog Task Workitem ID generated to Class Method used in Prg Exit.

Is there a Way to bind Task Workitem ID to Class Method Parameter at Program Exit Level?

Read only

0 Likes
1,598

Hey Silky,

Try this code

CALL METHOD cl_swf_evt_requester=>get_workitem

   IMPORTING

     ex_workitem   = tmp_object.

You will get the workitem in tmp_object-objkey.

Put this code in the program exit and with this workitem id , you can send the email or by concatenation , you can prepare the link.

Basically you need to first generate the workitem and then in parallel or after send the email. You cannot assume wokritem generation in sequence.

Thanks

Rakesh