Add Roles to Users - automated with BAPI in ABAP [english]

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 ส.ค. 2024
  • In this video I show you how to add roles to users automatically with a BAPI in ABAP. In a first step I use the BAPI: BAPI_USER_ACTGROUPS_ASSIGN which adds roles to SAP users.
    But the BAPI ignores already existing roles and deletes them. So that this does not happen I use in a second step the function module: SUSR_USER_AGR_ACTIVITYGR_GET to read existing roles in advance to transfer them.
    The example today is the basic functionality, the program itself can of course be extended by checking users and assigning them one or more roles if the authorization fits.
    #BAPI #SAP #Roles
    ▬▬ My Hardware ▬▬▬▬▬▬▬▬▬▬▬▬▬
    Microphone: amzn.to/3zj2UIz
    Headphone: amzn.to/3GUBRFg
    *The links are affiliate links. There are no additional costs.
    ▬▬ My Software (free) ▬▬▬▬▬▬▬▬▬▬▬
    Video Recorder: bit.ly/678fgh6
    Video Editor: bit.ly/38Rj9lb
    ▬▬ Further Links ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    Become my subscriber: bit.ly/CustAnd...
    All videos in English: bit.ly/CustAnd...

ความคิดเห็น • 15

  • @christophemuyshondt7769
    @christophemuyshondt7769 5 หลายเดือนก่อน

    Thank you, very handy indeed. Also useful when modifying the validity end date of the assigned roles

    • @CustAndCode
      @CustAndCode  4 หลายเดือนก่อน

      Thank you for your feedback and thanks for watching my videos! 🤗

  • @sk16034
    @sk16034 6 หลายเดือนก่อน

    Thanks for sharing your knowledge. Can you please explain how to add roles to multiple users using the same BAPI?

    • @CustAndCode
      @CustAndCode  6 หลายเดือนก่อน

      You are very welcome! To your question: Fetch your users and call the BAPI in a loop. 🤗

    • @sk16034
      @sk16034 6 หลายเดือนก่อน

      Thanks for your prompt response. Your videos are really helpful in real time.

    • @CustAndCode
      @CustAndCode  3 หลายเดือนก่อน

      Thanks a lot! 🤗😀

  • @karelhavliczech6455
    @karelhavliczech6455 ปีที่แล้ว +1

    Thank you, it is handy!

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว +1

      With pleasure! 😀🤗

  • @sibstories4710
    @sibstories4710 ปีที่แล้ว +1

    I’m considering this BAPI for automatic role assignment. However I tried running the BAPI alone first for testing via se37 and I always get return message that says ‘authorization profile does not exist or is inactive’. But when I tried adding the same role to the user directly in su01, it did not have the error. I wonder what kind of role does the BAPI only allow for it to be successful.

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      I have now tested this on my test system. Unfortunately, I cannot reproduce the error. It always works for me, whether with profile, enabled or disabled. 🤔

    • @sibstories4710
      @sibstories4710 ปีที่แล้ว

      @@CustAndCode we should only use the profile names we see in table usr10 and not the role names from agr_users for this bapi, correct?

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      @@sibstories4710 No, you have to pass the Role Name not the Profile! 🤗

    • @karelhavliczech6455
      @karelhavliczech6455 ปีที่แล้ว

      Hi, maybe the very first question is, are working in CUA environment? ...under Solman or stand alone system?

    • @sibstories4710
      @sibstories4710 ปีที่แล้ว

      @@CustAndCode apologies for the confusion. Was looking at a different bapi 😅 thank you