on 10-06-2009 10:27 AM
Hi All,
I have a decision task in my workflow which is working fine .
Now my requirement is I want to check the user name and except one particular user , for all other I have to show message you are not Authorized to approve .
Is there any exit or some other way to do this ?
Thanks
Manik
Dear Manik,
As far as I have understood, you are getting user name as input to your workflow. Except one particular user you for others you want to show that they are not authorized to approve.
Create an method in your BO and pass the username as input to it. Write your logic to evaluate the user name and populate a mutilne container element (say actual_agents). Export this value from method. Make the task as background task.
Please tell me how you want to inform agents that they are not authoriozed to approve. Once thing you can do is add a method to your BO to display a popup to inform agents that they are not authorized to approve. Assign actual_agents in expression of this acitivity.
Kindly correct me if I have understood you wrongly.
KR,
S Bharath
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bharath,
Thanks for your reply .
Actully this problem cannot be solved by any method as far as I think .
The task would be sent to all the possible agents . Note that Agents are not the actual approver . There would be only one approver whose Id is known. Now at the time of opening the task i.e while opening the task from Business workplace , I want to check the user name (through any method , validation routine , user exit or any possible thing ) and if it is not the required approvers user ID , I want to show a message that you are not authorised .
The message can be the same as we use in programs or any other pop will also do , but this should keep the task in the users inbox , should not delete it from inbox.
Hope now the problem is clear .
Thanks
Manik
Edited by: Manik Dhakate on Oct 6, 2009 12:33 PM
The task would be sent to all the possible agents .
Which means your task will be marked as general and there wont be any agent assignmnet at the task level.
if you do it like this, then the workitem will be sent to all and there wont be any limitation to access the same.
so its always betterto do the agent assignment at task level.
Dear Swami,
Thanks for your reply. As per his requirement he has said that once one user clicks the workitem it should not disappear from the inbox of others. But as per general nature of workitems I fear this is not possible. Also you have asked to restrict the task by agent assignment.
Does this mean like creating two activity steps with actual agent as expression in 1 activity step and rest of other users as expression in another activity.
KR,
S Bharath
Dear Manik,
Create a method in your BO. Add a logic as below.
If sy-uname = 'Actual approver'.
your logic.
elseif sy-uname = 'Other user'.
write popup code
endif.
Include this method in Tab Methods of activity step under "Methods BEFORE Workitem Execution(Modal Call)". This will work. Try it and let me know if you face any issues.
KR,
S Bharath
Well friends lets make it some more clear :
Suppose the task is there in agents inbox . Now sometimes what happens is the agent forwards the workitem to some other person . Now I have to check depending upon some conditions whether this person is authorized to approve it .
Now if someone can suggest some way where I can can write some code which gets executed at the time of opening the decision task for authorization check depending upon conditions . And if these conditions fails , I want to display the message and this decision task would be kept as it is in his inbox.
The reson for keeping the task in inbox is there is deadline monitoring active which will delete the task automatically after 2 days and will forward it to correct person .
Thanks
Manik
suggest some way where I can can write some code which gets
executed at the time of opening the decision task for
authorization check depending upon conditions .
The simple solution is make use of Program exits tab of the decision task,
[For more information please check this|https://www.sdn.sap.com/irj/scn/wiki?path=/display/abap/programExitsIn+Workflow
]
You can create a Zmethod and write the logic for validation and after that please create a send mail task and you can write the error message in subject line and in mail body as well.
user id have to be detremined in the above method and it shud bestored in a variable and make sure that parameter is export parameter of that method.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.