User, Role and Transaction Authorization Audit Report with Role Assignment History
Short answer: A custom ALV report that shows in one audit-ready list who can run a transaction and through which role, which transactions a user is authorized for through which roles, and who added or removed role assignments and when. Composite roles are expanded to single roles, ranges and wildcards in S_TCODE values are resolved, and locked or expired users are shown separately.
- Estimated effort
- M · 8–12 working days
- System
- ECC and S/4HANA
- Tables
- 13
- Scope
- Global
- Built by
- NeKuDos Teknoloji
- Last updated
Why is the standard not enough?
The user information system (SUIM) answers these questions in separate reports: transaction to users, user to roles and change documents are separate screens and the results come in a technical format. The role-transaction-user matrix and the assignment history are not combined in one list; the file for the auditor is prepared by hand every time and cannot be compared between periods.
Who uses it? Internal and external auditors, authorization administrators, information security teams and process owners who own roles.
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-role assignment and validity dates | — | ECC + S/4 |
| AGR_1251Authorization Data for Roles | Role authorization values: transactions granted through S_TCODE | AGR_1251-AGR_NAME = AGR_USERS-AGR_NAME | ECC + S/4 |
| AGR_TCODESAssignment of Roles to Transaction Codes | Transactions in the role menu | AGR_TCODES-AGR_NAME = AGR_USERS-AGR_NAME | ECC + S/4 |
| AGR_AGRSRoles in Composite Roles | Single roles of a composite role | AGR_AGRS-AGR_NAME = AGR_USERS-AGR_NAME | ECC + S/4 |
| AGR_TEXTSRole Texts | Role description | AGR_TEXTS-AGR_NAME = AGR_USERS-AGR_NAME | ECC + S/4 |
| USR02User Logon Data | User lock, validity and user type | USR02-BNAME = AGR_USERS-UNAME | ECC + S/4 |
| USR21User Name to Address Key Assignment | User's person number | USR21-BNAME = AGR_USERS-UNAME | ECC + S/4 |
| ADRPPersons (Business Address Services) | User's full name | ADRP-PERSNUMBER = USR21-PERSNUMBER | ECC + S/4 |
| TSTCSAP Transaction Codes | Transaction codes (for resolving ranges and wildcards) | — | ECC + S/4 |
| TSTCTTransaction Code Texts | Transaction code text | TSTCT-TCODE = TSTC-TCODE | ECC + S/4 |
| CDHDRChange Document Header | Role assignment change document header (object class PFCG) | — | ECC + S/4 |
| CDPOSChange Document Items | Role assignment change detail: role added or removed | CDPOS-CHANGENR = CDHDR-CHANGENR | ECC + S/4 |
| USH04Change History for Authorizations | Profile assignment change history | USH04-BNAME = AGR_USERS-UNAME | ECC + S/4 |
BAPIs and functions used
- CHANGEDOCUMENT_READRead Change Documents. Reads role assignment change documents
Selection screen parameters
| Parameter | Description | Type | Reference field | Required | Example |
|---|---|---|---|---|---|
| S_TCODE | Transaction code | Range / multiple | TSTC-TCODE | No | FB60 |
| S_UNAME | User | Range / multiple | AGR_USERS-UNAME | No | MDEMIR |
| S_AGR | Role | Range / multiple | AGR_USERS-AGR_NAME | No | FI_* |
| S_UDATE | Change date (history view) | Range / multiple | CDHDR-UDATE | No | 01.01.2026 – 16.11.2026 |
| P_VIEW | View: transaction / user / role / assignment history | Radio button | — | Yes | İşlem kodu |
| P_LOCK | Also show locked and expired users | Checkbox | — | No | — |
Output columns
| # | Column | Source |
|---|---|---|
| 1 | User | AGR_USERS-UNAME |
| 2 | Full name | ADRP-NAME_TEXT |
| 3 | Role | AGR_USERS-AGR_NAME |
| 4 | Role description | AGR_TEXTS-TEXT |
| 5 | Composite role | Calculated Name of the composite role if the single role was assigned through it (AGR_AGRS) |
| 6 | Transaction | Calculated Transaction resolved from the S_TCODE value |
| 7 | Transaction text | TSTCT-TTEXT |
| 8 | Valid from | AGR_USERS-FROM_DAT |
| 9 | Valid to | AGR_USERS-TO_DAT |
| 10 | User status | Calculated Active, locked or expired (USR02-UFLAG, USR02-GLTGB) |
| 11 | Change | Calculated Role added or removed (CDPOS change indicator) |
| 12 | Changed by | CDHDR-USERNAME |
| 13 | Change date | CDHDR-UDATE |
Sample output
| User | Full name | Role | Role description | Composite role | Transaction | Transaction text | Valid from | Valid to | User status | Change | Changed by | Change date |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| MDEMIR | Mehmet Demir | FI_SATICI_FATURA | Vendor invoice entry | FI_MUHASEBE_KOMPOZIT | FB60 | Enter Incoming Invoices | 01.01.2026 | 31.12.9999 | Active | |||
| SKAYA | Selin Kaya | FI_SATICI_FATURA | Vendor invoice entry | FB60 | Enter Incoming Invoices | 15.03.2026 | 30.06.2026 | Active | Added | YETKI_ADMIN1 | 14.03.2026 | |
| SKAYA | Selin Kaya | FI_SATICI_FATURA | Vendor invoice entry | FB60 | Enter Incoming Invoices | 15.03.2026 | 30.06.2026 | Active | Removed | YETKI_ADMIN2 | 01.07.2026 | |
| EOZ | Emre Öz | FI_GOSTERIM | Accounting display | FB03 | Display Document | 01.02.2026 | 31.12.9999 | Locked |
How does the report work?
- Role-transaction mapping: the values of authorization object S_TCODE in single roles (AGR_1251) are read; ranges and wildcards are resolved against the transactions in TSTC. Transactions in the role menu (AGR_TCODES) are shown as well; a menu transaction that is not granted through S_TCODE is flagged.
- Composite roles are expanded to their single roles with AGR_AGRS; access a user gets through a composite role is shown with the composite and single role it comes from.
- User-role assignments are read from AGR_USERS with their validity dates. Assignments not valid on the report date, locked users (USR02-UFLAG) and users past their validity (USR02-GLTGB) are flagged separately; name and department come from USR21 → ADRP/ADCP.
- Assignment history: role assignment change documents (CDHDR/CDPOS, object class PFCG, table AGR_USERS) are read for the selected date range; each line shows the role added or removed, its validity, the user who made the change, date and time. USH04 is read as well for the profile assignment history.
- Views: (a) transaction → users, (b) user → roles → transactions, (c) role → users, (d) assignment history. Each view is exported to Excel in audit format with a heading, run date, selection criteria and the user who ran it.
- Note: S_TCODE shows the ability to start a transaction; object checks inside the transaction (e.g. company code, document type) also apply. The report states this as a note on every output; for detailed object checks it is used together with the critical authorization and segregation of duties reports.
Performance notes
Restrict AGR_1251 to object S_TCODE and resolve ranges once per role. Read change documents by object class and date range; read CDPOS only for the selected headers. In large systems run view (b) in the background.
Features
- ALV list (sort, filter, subtotals)
- User-specific layout variants
- Export to Excel Each view is exported in audit format with heading, selection criteria and run details.
- Double-click drill-down to the document From a line the user drills down to the role (PFCG display) and the user (SU01 display).
- Runs as a background job
Authorization objects
- S_USER_GRPDisplaying user master data by user group
- S_USER_AGRDisplaying roles
- S_USER_TCDDisplaying transactions in roles
Frequently asked questions
Does the report prove that a user can really perform the activity?
S_TCODE shows the ability to start the transaction. Object checks inside the transaction (company code, document type, activity) also apply. The report states this limit as a note on every output; for object-level audits it should be used together with the critical authorization and segregation of duties reports.
How far back does the role assignment history go?
Role assignment change documents remain in the system as long as they are not deleted or archived; the report reads them for the selected date range. If change documents have been archived, the history view goes back to the archiving date.
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 …
Expiring and Expired Role Assignments Report
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 …
Segregation of Duties (SoD) Conflict Report by User
A custom ALV report that lists users who can run conflicting activities together (for example changing vendor master data and running the payment …
User and Transaction Code Usage History Archive and Report
A custom ALV report that writes user × transaction usage from the workload statistics to a permanent archive table every month and reports from that …
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.