简体   繁体   中英

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.

quite often you can use the Legacy Systems Migration Workbench (transaction 'lsmw'). The workbench works like a sort of macro recorder. In it you can record the steps in a transaction and replay that record any number of times, replacing the values you used in your recorded transaction with new ones, for instance read from a text file. There are a few limitations though:

  • handling table controls is quite tricky
  • the steps for all iterations have to be the same. You can't just omit some part of your recording because you only need it for some of the records.

A lot more complex would be creating your own batch input (that is the technology used to replay recorded transactions) using some ABAP coding you need to create yourself. There you would be more flexible, for instance adding different numbers of privileges to different roles. That batch input would then be executed by using the "call transaction using " statement (see here ).

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM