Sub topic 11
Assigning business roles to business users
This chapter assumes you know the earlier chapters' vocabulary. A business role combines catalogs, authorization data and optional restrictions. A business user is a user with a person identity who logs on to the launchpad. You should also know what PFCG is and what an authorization object is.
Roles do nothing until they are assigned. This chapter covers where assignment happens, what the system does after you assign a role, and which mistakes cause the most support tickets.
What assignment actually does
Assigning a business role to a business user links the two. Everything else follows from that link:
- The role's catalogs decide which apps and tiles the user can see in the launchpad.
- The role's authorization data decides what the user may do inside those apps.
- The role's spaces and pages decide how the apps are arranged.
- The role's restrictions decide which organizational values the user's access is limited to.
The user does not receive any of this at the moment you save the assignment. In the on-premise world, the user's authorizations are loaded into the user buffer at logon. Launchpad content is read from caches. Both facts matter in the troubleshooting section below.
Where you assign roles
The tool depends on the deployment model. The concept is the same in both.
| Deployment | Assign from the user side | Assign from the role side | Mass assignment |
|---|---|---|---|
| SAP S/4HANA Cloud | Maintain Business Users app, Business Roles section | Maintain Business Roles app, Business Users tab | Add several users in the role app |
| SAP S/4HANA on premise | Transaction SU01, tab Roles | Transaction PFCG, tab User | Transaction SU10 |
In the cloud, you work with the business user and the business role as two separate objects. You can open either one and add the link. In on premise, a "business role" is a PFCG role that contains launchpad content. You assign it exactly as you assign any other PFCG role.
Assigning in the cloud apps
- Open Maintain Business Users and select the user.
- Go to the business roles section and add the role.
- Save.
To give one role to many people, open Maintain Business Roles, go to the Business Users tab and add the users there. This is quicker for onboarding a whole team.
Assigning on premise
In SU01, open the user in change mode, go to the Roles tab, add the role name and set a validity period. Save.
In PFCG, open the role, go to the User tab and enter the user names. Then choose User Comparison. This step is the one people forget.
For large groups, use SU10. It assigns or removes roles for many users at once and can take its user list from a selection.
Validity dates
Each assignment has a "valid from" and a "valid to" date. The defaults are today and 31.12.9999. Use dates when access is temporary:
- Cover for a colleague on leave.
- A project role that ends with the project.
- A trial period for a new team member.
An assignment that has expired does not give access, even though the entry still appears in the list. When a user "has the role but sees nothing", check the dates first.
User comparison and the profile
On premise, a PFCG role generates an authorization profile. That profile must be copied into the user master record. This copy is the user comparison.
- If you assign from SU01, the system takes care of the comparison.
- If you assign from the PFCG User tab, you must run User Comparison yourself, or the user does not get the authorizations.
- A scheduled report, PFUD, performs the comparison for all users. It also handles roles whose validity changed. Run it as a periodic background job so that expired and starting assignments take effect without manual work.
A user whose role shows green in the User tab has a matching profile. A yellow or red status means the comparison is missing or the profile is not generated.
Direct, composite and derived roles
Not every assignment is a simple one-to-one link.
- A composite role bundles several single roles. If you assign the composite role, the user gets all included roles. You cannot give a user just one of them through the composite assignment.
- A derived role inherits the menu and launchpad content from a parent role. Only the organizational values differ. Derived roles are one way to give two regions the same apps with different company codes.
- Assignment through organizational management, for example by position, is possible on premise. The user then receives the role indirectly. Such an assignment does not show up on the SU01 Roles tab in the same way, which confuses people during a review.
Limiting a user by organizational values
A role carries its restriction values. They are not stored per user. If two users need the same apps for different company codes, you need two roles, or one parent with two derived roles. Assigning the same role to both gives both the same limits.
This is a design rule to remember: assign by job function, restrict by role variant. Do not try to express user-specific limits by editing the shared role.
In the cloud, restrictions are maintained for the business role in the Maintain Business Roles app, under its restriction types. Users assigned to that role then inherit them. When a restriction is "unrestricted" or empty, the user has full access to that dimension, which is often a wider access than intended. Check restricted fields before you assign the role to a large group.
Reading assignments with code
You can check what a user holds. The table AGR_USERS stores one row per role assignment, including the validity dates. This report lists a user's active direct assignments.
REPORT zlist_user_roles.
PARAMETERS p_user TYPE xubname OBLIGATORY.
START-OF-SELECTION.
SELECT agr_name, from_dat, to_dat
FROM agr_users
WHERE uname = @p_user
AND from_dat <= @sy-datum
AND to_dat >= @sy-datum
AND exclude = @abap_false
ORDER BY agr_name
INTO TABLE @DATA(lt_roles).
IF lt_roles IS INITIAL.
WRITE: / 'No active role assignments for', p_user.
RETURN.
ENDIF.
LOOP AT lt_roles INTO DATA(ls_role).
WRITE: / ls_role-agr_name, ls_role-from_dat, ls_role-to_dat.
ENDLOOP.The report only shows direct assignments. It does not follow composite roles or assignments through organizational management. For a full picture, use the SU01 information views or the user information system, transaction SUIM.
When assignment does not take effect
After an assignment, the user may still not see the new tiles or may get a "no authorization" message. Work through this list in order:
- Dates. Is the assignment valid today?
- Comparison. On premise, has user comparison run? Check the status in the PFCG User tab.
- New logon. The user buffer is loaded at logon. Ask the user to log off completely and log on again.
- Launchpad caches. Launchpad content is cached on the client and on the server. After you change catalogs or assignments, a stale cache can hide tiles. Administrators clear it with the report /UI2/INVALIDATEGLOBALCACHES or /UI2/INVALIDATECLIENTCACHES. The user can also clear the browser cache.
- Profile generated. In PFCG, open the Authorizations tab. A red traffic light means the profile is not generated, so the user holds no authorization from it.
- Authorization failure. If the tile appears but the app fails, the problem is in the authorization data, not the assignment. Use SU53 right after the failure, or the system trace in ST01, as covered in the troubleshooting chapter.
Good practices
- Assign roles by job function, such as "Accounts Payable Accountant", not by person.
- Use end dates for temporary access, and check them in your regular access review.
- Avoid copying all roles from a colleague. That copies mistakes and accumulated access.
- Record why a role was assigned. The change documents show who changed what and when, but not the business reason.
- Test with a user that holds only the new role. An administrator with broad authorizations hides gaps.
Exercise
You assigned a business role to an on-premise user from the User tab in PFCG, saved, and the user logged on again. The user still sees no new tiles and the authorization checks fail. Name two likely causes and how to confirm each.
Show answer
First, user comparison was not run, so the generated profile is not in the user master record. Confirm this in the PFCG User tab, where the status is not green, and fix it by choosing User Comparison or running PFUD. Second, the assignment's validity dates do not include today, for example a "valid from" date in the future. Confirm this in SU01 on the Roles tab or in AGR_USERS. A stale launchpad cache or an ungenerated profile (red traffic light on the Authorizations tab) are also possible.
Exercise
Two users need the same apps, but one may work only in company code 1000 and the other only in company code 2000. How do you set this up?
Show answer
Create two role variants, either two copies or one parent role with two derived roles, each with its own company code restriction. Assign one variant to each user. Restrictions belong to the role, so assigning a single shared role cannot give the users different limits.