cancel
Showing results for 
Search instead for 
Did you mean: 

Restrict Workitem Execution through SBWP as its configured in SWFVISU

sakshi_sawhney
Participant
0 Kudos

Hi ,

The requirement has been modified , now i want that task configured in SWFVISU. A workitem will be seen in SAP ID inbox (SBWP) and Portal.

1. If the user clicks on the workitem in portal then its directed to webdynpro application. - Expected and its working

2. If user clicks on the workitem in SBWP then its required - that we give either an error or information message stating that it should be executed in UWL and the work item should not be completed from SBWP. It should only be allowed to complete via Portal.

I was suggested a solution to above question in my earlier post :

Provide the url in mail step of workflow to lau... | SCN

In above link was suggested to take reference of


You could take a look to leave request workflow template WS12300111 and its step "Approval process". This one uses the method I was talking about. If you don't select the "background processing" option for the task, then the task will "stop" in the users inbox. If you add the error message thing to the method, then it cannot be executed/completed from business workplace by just clicking the work item.

The task method was CL_PT_REQ_WF_ATTRIBS->DUMMY.

After having a look at the above mentioned workflow in my current system it was observed it had an raise exception statement which was not handled also agent assignment was not activated.


In currently developed custom workflow if we dont handle exception then worklfow goes to error. If we handle that exception by activation the exception outcome in the task then the workitem gets executed after showing the information message in SBWP.

So the approach provided doesnt seem to work , would be grateful if someone could guide on the same.

Accepted Solutions (0)

Answers (4)

Answers (4)

sakshi_sawhney
Participant
0 Kudos

Hi ,

The issue is resolved for now but a workaround was done for the same. Though there should be a better way.

Its by placing the work item within the loop. The method of the work item manipulates the flag (container variable).

The value of the variable decides whether the work item is being executed from SBWP or Portal.

So if work item is executed from SBWP , then a information message appears , the looping condition is checked and a new work item appears.

SandySingh
Active Contributor
0 Kudos

Hello

Is this issue resolved?

Regards

Sandy

Former Member
0 Kudos

I am bit surprised to hear that this doesn't work. I have used similar approach (raising exception) successfully quite many times, and the idea is always that the exception has not been activated (=it is not green in the outcome tab). Did you try the exception Sandy mentioned? 

Did you check this document for reference (not the part about writing a text into WF log but the exceptions in general):

When the WF goes into the error, what is the error message? Can you take a screenshot of the log?

By the way, is your method instance method or static?

Regards,

Karri

SandySingh
Active Contributor
0 Kudos

Hello,


So you have implemented the exception CX_BO_ACTION_CANCELLED in your approval method. This exception will be triggered when the user tries to execute the workitem from Transaction SBWP (Condition check for Tcode SBWP)

This should work with no issues. If you are getting an error with activation of Outcome, you can also try the "Condition Check" tab for User decision task in SWDD. Here you can set up some conditions for workitem execution. You can set a variable in the approval method and check its values to complete the execution of workitem.

Regards

sandy