Flipkart.com

Monday, August 2, 2010

Delegation or Substitution functionality using UWL

Hi friends,

This is about how to achieve very powerful but rarely used functionality of delegation in portal.

Brief about the functionality.
UWL is the place where you can find your workitems or the items requiring your action. It is the place where you approve Leaves, times, transfers etc. You might require someone to fill-in for you in your absence (ex: you go on a 2 weeks Navaratri vacation :) ). So you want to pass on your workitems from your UWL to your substitute's UWL so that he/she can work on them in your absence.

How to achieve it?
Good news is that you require little work on your part, and SAP provides most of the functionality. In UWL, you see option "Manage Substitution Rules" as below.



In the next screen you can enter the user as a substitute and set up the rule to delegate.The moment you activate the rule, your substitute will start getting your workitems as well in his UWL.

Advanced options and configurations
This is the basic functionality and your client's usually want more.

Here are their next questions.

1. Can I control which workitems can be delegated? I only want to delegate Leaves, but not compensation change workitems. Substitution Profiles are available to select when you create a substitution rule.
Yes, this is possible. You need to define Substitution Profiles
Step 1. IMG -> SAP Netweaver -> Application Server -> Business Management -> SAP Business Workflow -> Basic Settings -> Substitution Profile -> Define Substitution Profile)
E.g. Z001 - Leave Requests
Step 2. Then create a new classification for tasks:
(IMG -> SAP Netweaver -> Application Server -> Business Management -> SAP Business Workflow -> Basic Settings -> Substitution Profile -> Maintain Task Class)
E.g. Z001 - Leave Requests
Step 3. Assign 'Classificaiton of tasks' to actual Dialog tasks
Open the dialog task in Tcode PFTC.
Goto Addiitonal data--> Agent Assignment --> Maintain
Here you will be able to select the 'Classification of tasks' for your dialog task.
Step 4. Then assign the substition profile to the classification
(IMG -> SAP Netweaver -> Application Server -> Business Management -> SAP Business Workflow -> Basic Settings -> Substitution Profile -> Assign Substitution Profile)

2. Can I limit the substitution profiles that are available for a user to select?
Yes, this is possible too. Use the BADI WF_SUBSTITUTE. Use method RESTRICT_PROFILES to delete substitution profiles from the internal table 'PROFILES' which are non relevant.

3. Can I validate business rules when a manager sets his substitute. (Ex: I want the substitute to be a manager as well)
Yes, this is possible too. Use the BADI WF_SUBSTITUTE. Use method maintain_substitute to validate the Substitute and Substituted user. You can show error messages or information messages based on the requirement.

4. Can we have a report on current substitutions?
Yes, Backend table HRUS_D2 stores all the current substitutions. Moment the rule is deleted/disabled, entry gets deleted from this table.

5. What is the difference between "Receive my tasks" and "Fill in for me" ?
If you choose "Recieve my tasks", the assignee will immediately start seeing your tasks. This is called as active substitution. here Assignee does not have any option to deny your tasks.
If you choose "Fill in for me", the asignee has a step to do in UWL to recive your tasks. He needs go to the 'Manage substitution rules' screen and 'Take over' your tasks. Only then your tasks will be visible for the assignee. This is called as Passive substitution. Here the advantage is that if you go on an unplanned vacation your assignee can take over tasks. Assignee has the option not to take over as well.



6. For the audit purpose I would need the history of delegation. Where can I get it from?
UWL delegation history is available in the portal server DB. The portal table is KMC_WF_SUBSTITUTE.
You need to use an SQL editor to query this table, which is located at the portal database.

Update: 18th Nov 2010: There is another possibility. I saw that HRUS_D2 table changes are logged. (Technical attributes of the table) So you can report on the table change log for this requirement.
See the below link to find out how to enable table logging
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/c7/69bcd2f36611d3a6510000e835363f/content.htm

Here is a sample output from change log for HRUS_D2


7. Some limitations of Substitution or Delegation application
  • More than one substitution profile (Group of Workflows) cannot be delegated to a single user.
  • Delegation functionality is NOT transitive (A to B to C not possible)
  • No option for the assignee to deny taking over incoming work list. For ‘Fill in for me’ asignee can decide not to ‘Take over’.
  • Substitutions will be active till they are deactivated. No end date can be mentioned beforehand.
  • Delegation is a feature of UWL. Hence this feature cannot be selectively given for MSS.
  • History of delegation cannot be shown at the portal. Only the current active substitution rules are shown. 
Another common scenario:
I have a requirement where our employee contact center will receive requests for delegation of selected items. (Ex: Only Leave approvals). Contact center employee should be able to execute these delegations


Probable solution: 
1. Create a program with selection screen conditions as follows
Delegation from:
Delegation to:
Delegation valid from:            to:
Delegation is valid for: [Substitution profile]

Within the program, add an entry to the HRUS_D2 table.

2. Assign a Tcode for the above program and assign it to the authorization profile of the contact center role.


Now the contact center employee can execute the delegation using the tcode. In addition you may build functionality to edit/delete HRUS_D2 entries.
Related topic


There is another way of achieving the Substitution. That is by using the substitution relationship with the position. Some questions in my mind
a. Will the position substitution update HRUS_D2 as well?
b. Will it act like UWL substitution?
c. Will the authorizations be inherited with position-relationship substitution?
d. Can UWL substitution and Relationship substitution conflict?

Let me know if you have the answers

Below SAP Press Book on ESS/MSS has been very helpful for me.
See in FLIPKART: Configuring and Customizing Employee and Manager Self-Services in SAP ERP HCM
See in AMAZON: Configuring and Customizing Employee and Manager Self-Services in SAP ERP HCM

    30 comments:

    1. Hi Krishna,

      thanks for the clarification. Do you know what to do if there's an inconsistency between the HRUS_D2 and KMC_WF_SUBSTITUTE tables? We're dealing with users that cannot assign substitutes anymore and it looks like the inconsistency between the tables is the source of that problem.

      Cheers
      Marcel

      ReplyDelete
    2. Hi Marcel,

      I too noticed that after soemtime of implementing the substitution the problems started coming. Only option is to backup the KMC table and delete the entries of the effected user.

      Thanks
      Krishna

      ReplyDelete
    3. Hi Krishna,

      This is very educative, however the challenge I have is inability to report on historical substitute. However from your write up you say it's possible from the back end. Please can you help me with the report to run to generate all substitutes maintained in the past.

      cheers

      ReplyDelete
    4. Hi,

      That was a mistake. I have corrected the blog.
      You can get substitution history only from KMC_WF_SUBSTITUTE table. This table is at the Portal database. There is no standard way of accessing this table. An SQL editor connected to the portal database sever can query this table and provide you the history.

      Thanks
      Krishna

      ReplyDelete
    5. Hi,
      How does security play a roll in this? We correctly setup a substitute for approval of working times. The person sees the task in the UWL, but when executed, the employee does not show in the list of people that need a timesheet approved. Only people from the substitutes org unit appear.
      Thanks,
      Joe

      ReplyDelete
    6. Hi,

      Good question.
      SAP's solution is just an UWL Substitution. That means that, substitute will get the work items in his UWL, and there ends the functionality.

      Substitute will NOT inherit any authorizations.

      So when the substitute clicks on working time work item, SAP code fetches his direct reporters' working time, nothing else.

      I need to achieve this functionality as well. I will update the blog when I do that. Keep me posted if you achieve before that.

      Thanks
      Krishna

      ReplyDelete
    7. Links to position or other OM are stored in table HRP1001 with an A210 relationship to the delegator. The link to the profile is stored in HRPADD2 which has the key HRP1001-HRIADATANR

      ReplyDelete
    8. Hi Krishna,

      We have a situation where a manager (Joe)left the company. He did not turn off or remove his substitute (Susie). Joe's user ID was deleted from SAP. Susie was promoted to Joe's managerial position. Now Susie wants to create a substitute, but she cannot. Joe's ID is not showing in table HRUS_D2 because his user ID is deleted. Do you know a way to turn off's or delete Joe's substitute?

      You help would be very much appreciated.

      Janice

      ReplyDelete
    9. Hi Janice, I do not think I completely understand the problem.

      When Joe left the company, Susie was his substitute. So HRUS_D2 had this entry.

      When Joe's id got deleted from SAP, are you saying that entry in HRUS_D2 got deleted as well..?

      When Joe does not have his ID in SAP, no items will come to his work list, hence there is no use trying to set-up a substitute for Joe.

      Let me know what are you trying to achieve. (Business justification)

      ReplyDelete
    10. Hi Krishna,

      We solved the problem. The manager who left the company had set up a substitute (Susie). Susie was promoted to the manager's postion. Because she was listed as a substitute by the previous manager, she could not create her own substitute.

      We solved the problem by using the below statements in table KMC_WF_SUBSTITUTE and inserting the user ID that we wanted to delete:

      GO
      SELECT * from SAPPE1DB.KMC_WF_SUBSTITUTE where SUBSTITUTE = 'INSERT USER ID HERE';
      GO
      SELECT COUNT(*) AS BeforeTruncateCount
      FROM SAPPE1DB.KMC_WF_SUBSTITUTE Where SUBSTITUTE = 'INSERT USER ID HERE';
      GO
      DELETE from SAPPE1DB.KMC_WF_SUBSTITUTE where SUBSTITUTE = 'INSERT USER ID HERE';
      GO
      SELECT COUNT(*) AS AfterTruncateCount
      FROM SAPPE1DB.KMC_WF_SUBSTITUTE Where SUBSTITUTE = 'INSERT USER ID HERE';
      GO

      Your blog was most helpful. Thank you so much.

      Best regards,

      Janice

      ReplyDelete
    11. hi kk,
      from what I understand, if a manager create 'fills in for me' substitution rule, can the substitute abuse it by doing 'take over' anytime he want and once he is done he just do the 'end take over'?

      Is there any way to prohibit this abuse from happening?

      Thanks
      Zack

      ReplyDelete
    12. hey Zack,
      Yes, that is a possibility. But if the substitute takes action, workflow log will show his name. That should be good enough isn't it?

      -KK

      ReplyDelete
    13. Have you solved the issues of assigning structural authorizations for a substitute to approve working time?

      ReplyDelete
    14. Hi KK,
      Can we have Delegation done in UWL workitems?
      User A has a PR limit which he can approve. Now he is on leave, he wants it to be delegated to User B who doesnt have PR limit as that of User A. Can he Delegate or does Substitution have any configuration which could do this? Could it be achieved thru PFCG?
      Thanks,

      ReplyDelete
    15. Hi, the delegation/substitution happening at UWL (currently supported by SAP) will not give any additional authorizations. So if A delegates/ substitutes B, B will merely get a link to access the workitem. All other authorization checks/validations will continue against B's credentials, when he executes the UWL work item. You may try with the BADi through to realize any requirements.

      ReplyDelete
      Replies
      1. Hi KK

        This is Mallikarjun.

        In my client, users re doing the substitution by SBWP. After that they will sent an image of substitution screen and we have to assign A's roles to B as manually with SU01. Can this automated?

        I mean after user substitution can we write a code that automatically adds the A's roles to B's account with the Substitution Validity from, To period as Startt date & End date of roles

        Delete
    16. In Pftc classification in assigned to the Particular task , and tranfer is executed in devlopment client but ... Substitution profile is also assinged to Classification ....Portal side , i tried to lauch manage substitution application but there is no create button.

      SAP system ...Three client- Customizing Client(cc) , Devlopment Client(dc), Testing Client(Tc).
      Client Copy has been done from cc to dc.
      PFTC - For particular task - clasification has been assigned.
      But i have not moved the request from DC to TC.(Request Created During Classification Trasfer).



      Please suggest me ...this is because of UWL authorization missing for users?

      ReplyDelete
    17. I am trying to understand the relationship between HRUS_D2 and the Portal table KMC_WF_SUBSTITUTE. If a user creates a "fills in for me" type of rule, an entry gets put in the HRUS_D2 table but does not have the profile or active flag populated. Now when the substitute logs on and executes the "Take over" function, nothing changes in the HRUS_D2 table but the Portal now knows that the substitute should start seeing the delegate's tasks and the "Take over" button changes to "End take over". I assume that the active status of the rule is being kept track of in KMC_WF_SUBSTITUTE, correct? And that table drives whether or not the substitute can see the tasks?

      Also, we utilize ad-hoc tasks in the UWL. Is substitution for ad-hoc tasks tracked only in KMC_WF_SUBSTITUTE?

      ReplyDelete
    18. I got this website from my pal who told me about this web site and now this time I am visiting this web
      site and reading very informative articles or reviews here.


      my blog - 24 hour cash advance

      ReplyDelete
    19. This is hοw bаrtеrіng originally
      starteԁ but a modern barter ехchаnge business like
      ITEX operаtеs by making it possiblе for indivіduals to carry?


      Αlso viѕit my web-ѕite; Internet Search Engine Marketing

      ReplyDelete
    20. Attractive element of content. I simply stumbled upon
      your web site and in accession capital to assert that I get
      actually enjoyed account your weblog posts. Anyway I'll be subscribing for your augment or even I achievement you access constantly fast.

      my site: Sac Guess Pas Cher

      ReplyDelete
    21. Hi there, I read your blogs daily. Your writing style is awesome, keep doing
      what you're doing!

      My webpage ... helpful resources

      ReplyDelete
    22. It's the best time to make some plans for the longer term and it's time
      to be happy. I have learn this put up and if I could I desire to counsel you few attention-grabbing issues or suggestions.
      Perhaps you could write next articles referring to this article.
      I want to read even more things approximately it!

      my web-site - Michael Kors Canada ()

      ReplyDelete
    23. My programmer is trying to convince me to move to .

      net from PHP. I have always disliked the idea because
      of the costs. But he's tryiong none the less. I've been
      using Movable-type on a number of websites for about a year
      and am anxious about switching to another platform.
      I have heard good things about blogengine.net. Is there a way I
      can transfer all my wordpress posts into it? Any kind of help would be really appreciated!


      Also visit my web blog ... Cheap Jerseys []

      ReplyDelete
    24. When I originally left a comment I seem to have clicked on the -Notify me when new comments
      are added- checkbox and now every time a comment is added I recieve 4 emails with the
      same comment. Is there an easy method you are able to remove
      me from that service? Cheers!

      Also visit my web page; Oakley Sunglasses

      ReplyDelete
    25. Hi, i think that i saw you visited my website thus i came to “return
      the favor”.I am trying to find things to enhance my site!
      I suppose its ok to use a few of your ideas!!


      My web site; Sac Louis Vuitton

      ReplyDelete
    26. It's hard to come by educated people in this particular topic, however, you seem like you know what you're talking about!

      Thanks

      Here is my page :: Louis Vuitton Handbags

      ReplyDelete
    27. If we using Position Based Substitution A210, how the work item will appear in the inbox. We have created relationship between two positions. Work Item doesn't come in the inbox. Do we need to run any report/transaction for that?

      ReplyDelete
    28. we got such a nice information. . appreciable.. SAP Audit

      ReplyDelete