Application Development 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: 

Forward Workitem

Former Member
0 Kudos

Hi Gurus,

I want to make a check so that if a user reaches a workitem to his inbox, checks if the user has

permissions to run it and if he do not have the permissions to be forwarded to all users.

I am using the class IF_SWF_IFS_WORKITEM_EXIT.

With this class I managed to forward the workitem when you press cancel (sy-ucomm = 'CANC').

But in this case it does not work properly.

I tried to put the code when the event is executed (im_event_name) is' BEF_EXEC 'and' STATE_CHG 'but when launching the error

workitem remains in the Ready status, and although it seems that all users have received the workitem, they can not execute it.

I have also tried with the event 'AFT_EXEC' but if you try to change the state the workflow becomes wrong.

You know how I can do to stop the execution of the workitem and send to everyone?

Thanks in advance.

3 REPLIES 3

Peter_Lintner
Participant
0 Kudos

Hi!

Why don't checking the problem before delivering the workitem to the user.

Create a rule to check if the user i authorized to execute the workitem or forward the workitem to an other user!

Hope this answer helps!

Kind regards

Peter

0 Kudos

Thanks Peter, but I have already created a rule for that.

But I ask that if you make a workitem forwarding, check this in the user the one that has become the forward.

Former Member
0 Kudos

Use this;

CALL FUNCTION 'SAP_WAPI_SET_WORKITEM_STATUS'

EXPORTING

workitem_id = ls_wihead-wi_id

status = 'READY'

USER = SY-UNAME

LANGUAGE = SY-LANGU

DO_COMMIT = 'X'

By the following method was not working well.

CALL METHOD lv_wi_handle->set_status

EXPORTING

im_new_status = swfco_wi_status_ready.