we have a scenario wherein the employee responsible of a certain 'Task' has this task displayed in 'My Tasks' in the Webclient UI. However this task is also appearing as 'My Task' under a different user (who is not employee responsible) on the same. Can someone please let me know as to why this task is appearing in the queue of two individuals when there's only one 'Employee responsible'? Whats the setting behind this?
You can go to the DO_INIT_CONTEXT method of implementation class for today's task view & the logic for getting employee responsible in GET_QUERY_RESULT. The logic is
lv_low = '1'. " 1 = my transactions
lr_query_service->add_selection_param( iv_attr_name = 'RESPONS_AREA' iv_sign = 'I' iv_option = 'EQ' iv_low = lv_low ).
You can enhance the view & re define the method to pass the BP for logged in person as the selection parameter for query service.
FM COM_BPUS_BUPADATA_FOR_USER_GET should help you in getting the desired BP from logged in user ID.
Please let em know if this doesn't work.
Indeed the tasks are going to all partner functions that are determined. So i guess one way is to remove the other partners in the determination procedure and only have the task owner as a partner function determined. I also noticed that we have status profile assinged to this task which has 'Open', 'Complete' and 'Rejected' statuses. Therefore when the task status is open, all these partners can view the task in 'My tasks'. When its completed, it goes away from all the lists (of all users). I believe there must be some status (possibly INPR?) wherein the open task only shows up to the 'Employee resonsible' and no one else. Do you have a view on this? thanks for your help.
When it comes to the tasks listed under 'My Tasks', this are searched on the basis of two criteria. First is the status of activity & it is set as 'open'. The second criteria is on basis of 'RESPONS_AREA' i.e, responsible area.
The responsible area is 1 which means, It displays all the documents in which the business partner you are assigned to as an user, is assigned in any partner function of category employee.
If for instance you are assigned to a opportunity not as empployee responsible but as interaction agent for instance, this opportunity will also be displayed to you. This is the reason why, task is listed in some one else's window as well.
You can always do a simple customizing to restrict the search to employee responsible only.
PLease let me know if you have more doubts regarding this.
We had the same issue regarding only displaying Tasks for which the logged in user is the Employee Responiblsle and I made the change as you suggested below by removing the query parameter for RESPONS_AREA and adding the query parameter for EMPLOYEE_RESP.
However, this does not seem to be working correctly.
Can you confirm whether there is anything else I need to change?
All I have done so far is define the GET_QUERY_RESULT method.
Haibin and Ravi, thanks both for your responses.
Haibin, yes we are doing something similar as we are using statuses of 'Completed' which i believe is an equivalent of 'fini'.
Ravi, thanks for confirming my findings in the system. What is the customization you would propose in this case?
The customization I am refering to is a bit technical. In view, CRMCMP_GS_WC/TodaysTasks within implementation class redefine method 'get_query_result'.
Instead of RESPOSE_AREA to the query class, pass field EMPLOYEE_RESP by providing the BP of logged in user in selection parameter of class.
This will search the Tasks only where logged in user is employee responsible.