Skip to Content
author's profile photo Former Member
Former Member

Workflow Substitution - restrict list of subsitute users

Hi,

I am trying to restrict the list of users shown when a user maintains a personal substitute in transaction SBWP - Business workplace (Settings, Workflow Settings, Maintain Substitute) and also in the UWL on the portal. I have searched SAP notes and found a BAdi WF_SUBSTITUTE for the UWL so that I can output an error if an incorrect user is selected, but I can't change the actual list of users shown with this BAdi. For transaction SBWP in the SAP back end I have found a BAdi HRBAS00_SEARCH, but I am unable to restrict the list of users with this BAdi or output an error message if an incorrect user is selected. Has anyone successfully used this BAdi to restrict the substitute user list and if so could you please supply me with some sample code?

I have searched SAP notes and also this forum, and the question has been asked before but there seems to be no definitive answer as to how to restrict the user list. Any help with this question would be greatly appreciated.

Regards,

Cara.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Posted on Jan 05, 2010 at 01:27 PM

    It should work for you...Anyways check this note : Note 977069 - Substitute API: Providing the BAdI WF_SUBSTITUTE

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      I had already read SAP Note 977069 - Substitute API: Providing the BAdI WF_SUBSTITUTE, which is how I found the BAdi for the portal. I am using method IF_EX_WF_SUBSTITUTEMAINTAIN_SUBSTITUTE (please see code below), which allows me to show an error message if they have chosen an incorrect substitute, but it still shows all users in the list and I wish to restrict the list of substitute users shown. There is another method called IF_EX_WF_SUBSTITUTERESTRICT_PROFILES, but this just restricts the list of profiles (e.g. ALL, Disciplinary, Professional) not the list of users shown.

      method IF_EX_WF_SUBSTITUTE~MAINTAIN_SUBSTITUTE.

      DATA: ls_msg LIKE LINE OF msg.

      if sy-uname(2) = 'Z0'.

      if substitute+2(2) ne 'Z0'.

      • set the return code

      return_code = '4'.

      • set the error message

      ls_msg-msgid = 'Z1'.

      ls_msg-msgty = 'E'.

      ls_msg-msgno = 000.

      ls_msg-msgv1 = 'Substitute not valid.'.

      ls_msg-msgv2 = 'Select Online Expense users only'.

      APPEND ls_msg TO msg.

      endif.

      else.

      if substitute+2(2) = 'Z0'.

      • set the return code

      return_code = '4'.

      • set the error message

      ls_msg-msgid = 'Z1'.

      ls_msg-msgty = 'E'.

      ls_msg-msgno = 000.

      ls_msg-msgv1 = 'Substitute not valid.'.

      ls_msg-msgv2 = ' Select SAP back end users only'.

      APPEND ls_msg TO msg.

      endif.

      endif.

  • author's profile photo Former Member
    Former Member
    Posted on Jan 05, 2010 at 09:51 PM

    Hi,

    The bad news is that the BADI works only for UWL - not for Business Workplace.

    As far as I know, there is no standard solution for you problem. Not sure about the HRBAS00_SEARCH, but I doubt it would work.

    It might be that the only way is an enhancement to SAP standard code. Try to debug the user assignment part, and find out if there is some suitable place for implementing some kind of restriction.

    Regards,

    Karri

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 10, 2010 at 06:09 PM

    You can look these solutions

    1> Explore task classification for Substitution.

    2> See if there is any ENHANCEMNET-SPOT that can be utilized to plug in our code to raise error message. But it is only available > ECC6

    3> Create a Z report that will maintain the table HRUS_D2 where all Substitution users are maintained.This report will check whether the Substitution maintained is proper as per our requirement and if there is some discrepancies then delete that entry from the table HRUS_D2.This will also notify user on their external mails that this substitution is not allowed and set up new one.

    Run this report periodically every 2 min in background.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 11, 2010 at 10:33 AM

    Hi Jeffrey,

    Unfortunately I tried to debug the code to find a suitable place to restrict the list of users and I was unsuccessful. At the moment the user just receives an error message in the portal via BADI WF_SUBSTITUTE method MAINTAIN_SUBSTITUTE if they choose an incorrect user (see code above). In the back end in transaction SBWP I put an implicit enhancement in function module RH_SUBSTITUTION_MAINTAIN at the beginning and again I just output an error if they choose an incorrect user. Sorry I could not be more help in actually restricting the list of users shown.

    Regards,

    Cara.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.