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 User Exit: User determination

Former Member
0 Likes
990

Hi There

I got stuck with the following problem:

I implemented a workitem user exit and managed to determine the actual agent of a workitem at the "after_execution" event from the workitem container.

How can I read the users that are assigned in the workflow definition (e.g. via orgunit, position, multiline container element) to a workitem (or more correctly step)? This should of course be done after or just before creation of the workitem.

Any idea is highly appreciated!

Cheers, Michael

Hi There

I got stuck with the following problem:

I implemented a workitem user exit and managed to determine the actual agent of a workitem at the "after_execution" event from the workitem container.

How can I read the users that are assigned in the workflow definition (e.g. via orgunit, position, multiline container element) to a workitem (or more correctly step)? This should of course be done after or just before creation of the workitem.

Any idea is highly appreciated!

Cheers, Michael

5 REPLIES 5
Read only

ramki_maley
Active Contributor
0 Likes
878

Hi Michael,

Welcome to the ABAP forum!!

If your intention is to get all the selected agents of the Workitem, you can use the SAP_WAPI_WORKITEM_RECIPIENTS function module if it is available in your release. This FM does not work for completed WIs. Since WI id is the required parameter, you should call it after WI creation.

Cheers,

Ramki Maley.

Please reward points if the answer is helpful.

For info on awarding points click on this link: https://www.sdn.sap.com/sdn/index.sdn?page=crp_help.htm

Read only

0 Likes
878

Hi Ramki

Thanks for the welcome, yes it was indeed my first post...don't know why I never posted workflow stuff here yet.

FM works well, but only if the workitem is stored after creation. When processing the state "after_creation" in the exit, there is already a workitem ID for the step/ task, but you can't read anything from the database - so the result of the FM is always empty. The next state in the exit is processed when the/one user executes the wi for the first time. At that time its too late to retrieve the assigned agents.

But thank you very much anyhow!

Cheers, Michael

Read only

0 Likes
878

Michael,

Sorry the FM does not work for you. Can you let me know the enhancement (SMOD) id for the exit you are using?

If you are interested, Method SWF_RUN_WIM_CRT_INTERNAL~GET_AGENTS_FOR_WORKITEM in class CL_SWF_RUN_WIM_LOCAL is where the agents are determined.

Cheers,

Ramki Maley.

Read only

0 Likes
878

Hi

No worries, the FM DOES help, even if not in exactly that context.

There is no entry in SMOD for this exit. You'll find it on a tab at every workflow step (called "program exit"). BUT: You'll need a WAS, means Basis System of 6.20 minimum!

Thanks for the method, but it seems to have no return parameter----how can I get the result???

Thanks again!

Michael

Read only

0 Likes
878

I am not sure if the method can be used in a custom program context.

Cheers,

Ramki Maley.