did you ever wonder, what's behind the button "Import from file" in PFCG's Menu tab?
Well, it obviously allows you to upload a menu from a file, but expects a special file format: SAP Note 389675 has the details. You won't find this format anywhere in PFCG or elsewhere in your system, so it has to be created by you…
This usually makes the "Import from file" button hard to use and thus unpreferable!
Let's say, you're trying to revise (and minimize) the authorization in a SAP client ex post, i.e. when the system has been in use for some while and nobody took care of proper roles. Moreover some (key-) users might already have created their own favorites, which – hopefully – reflect their tasks in the system.
Wouldn't it be nice to be able to import those user favorites to a role and build adequate authorizations this way? Still there will be much to analyze and adjust — but it might be a good starting point!
A user's favorites are stored in the table SMEN_BUFFC and SMEN_BUFFI (for the various kinds of link targets). So this is the place we'll get the menu data from.
The file format from the above mentioned SAP Note 389675 only supports a subset of all possible favorite types: folders, transaction codes, URLs, Knowledge Warehouse links and custom types (we won't deal with the last-mentioned one).
So in addition to reading and converting the favorites, we'll have to filter out all unsupported types of favorites.
Here's how to create the program that does the work:
- Create a new report in SE38 and paste this source code (don't forget to set a program authorization group).
- In the selection texts, tick "dictionary reference" for all parameters.
- Activate & execute the program.
The selection screen allows you to select:
- the user from whom to read the favorites and
- an optional file to save the data to.
Once started, the report prints the converted favorites on screen and optionally saves it to the specified file.
You might want to customize the report to download the favorites of several users at once — but be aware that you'll have to either save each user's favorites to its own file or deal with duplicate object IDs (and parent IDs and the sort order …)!
If you're interested in role menus, you might want to check the AGR_HIER* tables.
😀 Have fun!