Search code examples
abapsap-basis

Is there any way to create roles and profiles in mass in SAP?


I need to create a lot of SAP roles and profiles with a little difference between them.

Is there any way to do this using ABAP, or any the tamplate for the file to be uploaded using the PFCG transaction?

I'm pretty new in SAP, so if you have any document about that, please send me.

Thanks in advance.


Solution

  • If you can manage to restrict the differences to organizational hierarchy fields, you can use the built-in function to derive roles. This way, you can create a master role and a number of derived roles that only differ in specific values. You should be able to use the LSMW mentioned by Dirk Trilsbeek to create the derived roles, if necessary.

    If this is not possible, you could try to create the role once, download it and check the contents of the file - it's basically a line-based fixed-width format with the first field of each line describing the line type, IIRC - just compare the contents of each line to the structures named. If you are familiar with any programming environment that is able to handle text output, it's not too hard to generate files containing the new roles with any toolkit you're comfortable with. I've successfully used XText / XPand for this, but it doesn't really matter. You can then upload the roles from the generated text files.