Expiring and Expired Role Assignments Report
Short answer: A custom ALV report that lists role assignments whose validity ends within the next N days or that have ended but are still on the user, with the user's email, the parent role, user validity and last logon. It also flags expired assignments whose profile is still in the user master because the user comparison (PFUD) has not run, and it can send reminder emails to users.
- Estimated effort
- S · 3–4 working days
- System
- ECC and S/4HANA
- Tables
- 9
- Scope
- Global
- Built by
- NeKuDos Teknoloji
- Last updated
Why is the standard not enough?
SU01 and PFCG show the validity dates of a role assignment one user or role at a time. Role assignments can be listed in SUIM, but there is no window such as "ending in the next 30 days", no days-left calculation and no reminder to the user's email. If the profile of an expired assignment is still on the user because PFUD has not run, the standard list does not show that either.
Who uses it? Authorization administrators, IT support teams handling temporary access requests, and managers tracking consultant and project users.
Closest standard alternatives
Tables used
The tables the report reads and their join fields. ECC and S/4HANA differences are marked separately.
| Table | Role | Join | System |
|---|---|---|---|
| AGR_USERSAssignment of Roles to Users | User-to-role assignment, validity and change date (driving table) | — | ECC + S/4 |
| AGR_TEXTSRole Texts | Role description | AGR_TEXTS-AGR_NAME = AGR_USERS-AGR_NAME AND AGR_TEXTS-SPRAS = SY-LANGU AND AGR_TEXTS-LINE = 0 | ECC + S/4 |
| AGR_DEFINERole Definition | Parent role of a derived role | AGR_DEFINE-AGR_NAME = AGR_USERS-AGR_NAME | ECC + S/4 |
| AGR_1016Name of the Activity Group Profile | Generated profile of the role | AGR_1016-AGR_NAME = AGR_USERS-AGR_NAME | ECC + S/4 |
| UST04User Profile Assignments | Whether the profile is still on the user | UST04-BNAME = AGR_USERS-UNAME AND UST04-PROFILE = AGR_1016-PROFILE | ECC + S/4 |
| USR02User Logon Data | User group, user validity and last logon | USR02-BNAME = AGR_USERS-UNAME | ECC + S/4 |
| USR21User Name to Address Key Assignment | Person and address number of the user | USR21-BNAME = AGR_USERS-UNAME | ECC + S/4 |
| ADRPPersons (Business Address Services) | Full name of the user | ADRP-PERSNUMBER = USR21-PERSNUMBER | ECC + S/4 |
| ADR6E-Mail Addresses (Business Address Services) | Email address of the user for the reminder | ADR6-ADDRNUMBER = USR21-ADDRNUMBER AND ADR6-PERSNUMBER = USR21-PERSNUMBER | ECC + S/4 |
Selection screen parameters
| Parameter | Description | Type | Reference field | Required | Example |
|---|---|---|---|---|---|
| S_UNAME | User | Range / multiple | AGR_USERS-UNAME | No | — |
| S_AGR | Role | Range / multiple | AGR_USERS-AGR_NAME | No | ROL_* |
| S_CLASS | User group | Range / multiple | USR02-CLASS | No | DANISMAN |
| P_DAYS | Next number of days | Single value | — | Yes | 30 |
| P_EXPIR | Also show expired assignments | Checkbox | — | No | X |
| P_PFUD | Flag assignments whose profile is still on the user | Checkbox | — | No | X |
| P_MAIL | Send reminder emails to users | Checkbox | — | No | — |
Output columns
| # | Column | Source |
|---|---|---|
| 1 | User | AGR_USERS-UNAME |
| 2 | Full name | ADRP-NAME_TEXT |
| 3 | ADR6-SMTP_ADDR | |
| 4 | User group | USR02-CLASS |
| 5 | Role | AGR_USERS-AGR_NAME |
| 6 | Role description | AGR_TEXTS-TEXT |
| 7 | Parent role | AGR_DEFINE-PARENT_AGR |
| 8 | Valid from | AGR_USERS-FROM_DAT |
| 9 | Valid to | AGR_USERS-TO_DAT |
| 10 | Days left | Calculated AGR_USERS-TO_DAT − today |
| 11 | Status | Calculated Expiring / Expired / Expired, user comparison needed (profile in UST04) |
| 12 | User valid to | USR02-GLTGB |
| 13 | Last logon | USR02-TRDAT |
| 14 | Assignment changed on | AGR_USERS-CHANGE_DAT |
Sample output
| User | Full name | User group | Role | Role description | Parent role | Valid from | Valid to | Days left | Status | User valid to | Last logon | Assignment changed on | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| SDEMIR | Selin Demir | [email protected] | SATIS | ROL_SD_FIYAT_ONAY_IST | Sales price approval (Istanbul) | ROL_SD_FIYAT_ONAY | 09/01/2026 | 11/30/2026 | 13 | Expiring | 12/31/9999 | 11/16/2026 | 09/01/2026 |
| KCELIK | Kemal Çelik | [email protected] | MUHASEBE | ROL_FI_DONEM_SONU | Period-end closing | 10/01/2026 | 11/10/2026 | -7 | Expired, user comparison needed | 12/31/9999 | 11/14/2026 | 10/01/2026 | |
| TAKSOY | Tolga Aksoy | [email protected] | DANISMAN | ROL_MM_ANAHTAR_KULLANICI | MM key user | 08/15/2026 | 12/15/2026 | 28 | Expiring; user validity ends on the same day | 12/15/2026 | 11/17/2026 | 08/15/2026 | |
| BOZTURK | Berk Öztürk | [email protected] | URETIM | ROL_PP_VARDIYA_AMIRI_T1 | Shift supervisor (Plant 1) | ROL_PP_VARDIYA_AMIRI | 06/01/2026 | 11/20/2026 | 3 | Expiring; no logon for 60 days | 12/31/9999 | 09/18/2026 | 06/01/2026 |
How does the report work?
- Assignments of the selected users and roles are read from AGR_USERS; those whose validity end (TO_DAT) is between today and today + N days and, depending on the selection, those already ended are taken. Unlimited assignments (31.12.9999) are left out.
- Days left = TO_DAT − today; a negative value means the assignment has expired.
- For expired assignments, the role’s profile is taken from AGR_1016; if it is still on the user in UST04, the flag “user comparison needed” is set.
- The role description is added from AGR_TEXTS and the parent role of a derived role from AGR_DEFINE.
- User group, user validity end and last logon are added from USR02; full name and email from USR21/ADRP/ADR6. If the user’s own validity ends before the role assignment, this is noted as well.
- The result is sorted by days left; if the email option is on, each user receives the list of their ending roles.
Performance notes
Narrow AGR_USERS by the TO_DAT range; the assignment table is usually small, so the report finishes in seconds. Read UST04 and address data only for the users found. Schedule a weekly background run for the reminders.
Features
- ALV list (sort, filter, subtotals)
- User-specific layout variants
- Double-click drill-down to the document Double-clicking the user opens SU01, double-clicking the role opens PFCG.
- Export to Excel
- Runs as a background job
- Send the result by email Each user receives their ending roles and directions for an extension request.
Authorization objects
- S_USER_GRPDisplay user data by user group (ACTVT 03)
- S_USER_AGRDisplay role assignments
Frequently asked questions
Does the report extend or remove assignments automatically?
No. The report only lists and reminds; an extension decision should go through approval. To remove expired profiles from users, the standard user comparison (report PFCG_TIME_DEPENDENCY) should be scheduled as a daily job.
How do single roles inside composite roles appear?
When a composite role is assigned, its single roles are also stored in AGR_USERS with the same dates. Depending on the selection, the report shows only the composite role or the single roles as well; by default it lists at composite level to avoid duplicates.
Is an email also sent to the role owner?
In the basic version the email goes to the user. If role owners are defined per role in a settings table, they can also receive a summary of their roles; this takes about one extra day.
Packages that include this solution
SAP Access and Payment Risk Audit Pack
A six-component pack that brings together the controls asked most often in the yearly IT and finance audit: users with critical authorizations, …
Related reports
Users with Critical Authorizations Report (SAP_ALL, Debug, Table Maintenance)
A custom ALV report that lists users holding authorizations that are critical on their own, such as the SAP_ALL and SAP_NEW profiles, debugging with …
User License Type and Last Logon Report (Inactive Users)
A custom ALV report that shows each user's license type, last logon date, number of valid roles and department in one list. Users who have not logged …
Let us build this report for your system
Briefly describe your system and expectations. We will clarify the scope and come back with an effort and price quote.