Sub topic 3
PFCG roles and how profiles are generated
What this chapter assumes
You know what a business user is and what an authorization object is: a named set of fields, such as company code and activity, that an ABAP check tests. You have used the SAP Fiori launchpad. This chapter covers the role maintenance transaction PFCG and the step that turns a role into something the system can enforce.
The working model
A PFCG role is a container. It holds menu entries (what a user can start), authorization data (which values of which objects the user holds), and a list of assigned users. The role itself is not what the system checks at runtime. The system checks an authorization profile, which PFCG generates from the role's authorization data.
The runtime chain looks like this:
Working in PFCG
Open transaction PFCG, enter a role name, and choose a change action. Two tabs matter for this chapter.
- Menu lists the transactions, apps and services the role can start. In SAP Fiori terms this is where catalog content is referenced.
- Authorizations holds the authorization data. PFCG proposes objects and values from the SU24 defaults of the menu entries. You then maintain the open fields.
On the Authorizations tab, PFCG shows a tree of authorization objects with traffic lights.
| Status | Meaning |
|---|---|
| Red | An organizational level or required field has no value yet. The profile cannot be generated. |
| Yellow | Fields were proposed but not yet confirmed. |
| Green | All fields have values. |
Fill the organizational levels first, such as company code or sales organization. PFCG copies them into every object that uses them, so you enter each value once.
How the profile is generated
When you choose Generate, PFCG writes the maintained authorizations into a profile. The profile name is derived from the role name and a counter. A role with many objects can produce several profiles, because one profile holds a limited number of authorizations. You rarely work with profiles directly.
A profile is only effective for a user after the user is assigned to the role and the user comparison has run. The comparison copies the role's profile into the user master record. Until then the user does not hold the authorizations, even when the role is generated and active.
Because the generated profile is a snapshot, later changes to a role have no effect until you generate it again. This also applies when an SU24 default changes. PFCG does not rewrite authorization data that already exists. You compare the role with the new defaults by choosing the adjustment of authorization data.
Common errors
- Role is changed but users see no difference. The profile was not regenerated, or the user comparison did not run. Check the role's Authorizations tab for a status that reads "changed" and generate again.
- Role cannot be generated. An organizational level is still red. Maintain it, then generate.
- A user has more access than expected. Authorizations from several roles add together. A user holds the union of all assigned roles, so a value in one role cannot be removed by a different role.
- Wildcard values. An asterisk in an activity or organizational field grants every value. Use it only when you intend that.
Exercises
Exercise
You added company code 1010 to a role's organizational level and saved it. The user, who is already assigned, still gets "No authorization for company code 1010". Name the two steps you must confirm.
Show answer
Generate the role's profile so it contains the new value, then run the user comparison so the regenerated profile is copied into the user master record. Both must be done before the user holds the authorization.
Exercise
A user is assigned two roles. Role A grants activity 03 (display) on an object and role B grants activities 01, 02 and 03 on the same object. Which activities does the user hold?
Show answer
Activities 01, 02 and 03. Authorizations from all assigned roles are combined, so the more generous one applies and role A cannot restrict role B.