BASIS Report Custom development ALV report

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

  • SUIM User Information System. Lists role assignments; no end window, days left, PFUD need or email reminder.
  • PFCG Role Maintenance. Shows the users of a role and their validity dates one role at a time.

Tables used

The tables the report reads and their join fields. ECC and S/4HANA differences are marked separately.

TableRoleJoinSystem
AGR_USERSAssignment of Roles to UsersUser-to-role assignment, validity and change date (driving table)—ECC + S/4
AGR_TEXTSRole TextsRole descriptionAGR_TEXTS-AGR_NAME = AGR_USERS-AGR_NAME AND AGR_TEXTS-SPRAS = SY-LANGU AND AGR_TEXTS-LINE = 0ECC + S/4
AGR_DEFINERole DefinitionParent role of a derived roleAGR_DEFINE-AGR_NAME = AGR_USERS-AGR_NAMEECC + S/4
AGR_1016Name of the Activity Group ProfileGenerated profile of the roleAGR_1016-AGR_NAME = AGR_USERS-AGR_NAMEECC + S/4
UST04User Profile AssignmentsWhether the profile is still on the userUST04-BNAME = AGR_USERS-UNAME AND UST04-PROFILE = AGR_1016-PROFILEECC + S/4
USR02User Logon DataUser group, user validity and last logonUSR02-BNAME = AGR_USERS-UNAMEECC + S/4
USR21User Name to Address Key AssignmentPerson and address number of the userUSR21-BNAME = AGR_USERS-UNAMEECC + S/4
ADRPPersons (Business Address Services)Full name of the userADRP-PERSNUMBER = USR21-PERSNUMBERECC + S/4
ADR6E-Mail Addresses (Business Address Services)Email address of the user for the reminderADR6-ADDRNUMBER = USR21-ADDRNUMBER AND ADR6-PERSNUMBER = USR21-PERSNUMBERECC + S/4

Selection screen parameters

ParameterDescriptionTypeReference fieldRequiredExample
S_UNAMEUserRange / multipleAGR_USERS-UNAMENo—
S_AGRRoleRange / multipleAGR_USERS-AGR_NAMENoROL_*
S_CLASSUser groupRange / multipleUSR02-CLASSNoDANISMAN
P_DAYSNext number of daysSingle value—Yes30
P_EXPIRAlso show expired assignmentsCheckbox—NoX
P_PFUDFlag assignments whose profile is still on the userCheckbox—NoX
P_MAILSend reminder emails to usersCheckbox—No—

Output columns

#ColumnSource
1UserAGR_USERS-UNAME
2Full nameADRP-NAME_TEXT
3EmailADR6-SMTP_ADDR
4User groupUSR02-CLASS
5RoleAGR_USERS-AGR_NAME
6Role descriptionAGR_TEXTS-TEXT
7Parent roleAGR_DEFINE-PARENT_AGR
8Valid fromAGR_USERS-FROM_DAT
9Valid toAGR_USERS-TO_DAT
10Days leftCalculated AGR_USERS-TO_DAT − today
11StatusCalculated Expiring / Expired / Expired, user comparison needed (profile in UST04)
12User valid toUSR02-GLTGB
13Last logonUSR02-TRDAT
14Assignment changed onAGR_USERS-CHANGE_DAT

Sample output

UserFull nameEmailUser groupRoleRole descriptionParent roleValid fromValid toDays leftStatusUser valid toLast logonAssignment changed on
SDEMIRSelin Demir[email protected]SATISROL_SD_FIYAT_ONAY_ISTSales price approval (Istanbul)ROL_SD_FIYAT_ONAY09/01/202611/30/202613Expiring12/31/999911/16/202609/01/2026
KCELIKKemal Çelik[email protected]MUHASEBEROL_FI_DONEM_SONUPeriod-end closing10/01/202611/10/2026-7Expired, user comparison needed12/31/999911/14/202610/01/2026
TAKSOYTolga Aksoy[email protected]DANISMANROL_MM_ANAHTAR_KULLANICIMM key user08/15/202612/15/202628Expiring; user validity ends on the same day12/15/202611/17/202608/15/2026
BOZTURKBerk Öztürk[email protected]URETIMROL_PP_VARDIYA_AMIRI_T1Shift supervisor (Plant 1)ROL_PP_VARDIYA_AMIRI06/01/202611/20/20263Expiring; no logon for 60 days12/31/999909/18/202606/01/2026
A view built with fictional sample data; not real system data.

How does the report work?

  1. 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.
  2. Days left = TO_DAT − today; a negative value means the assignment has expired.
  3. 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.
  4. The role description is added from AGR_TEXTS and the parent role of a derived role from AGR_DEFINE.
  5. 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.
  6. 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

BASIS Package Custom

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, …

6 components · v1.0

Related reports

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.

Related report: Expiring and Expired Role Assignments Report