User and Transaction Code Usage History Archive and Report
Short answer: A custom ALV report that writes user × transaction usage from the workload statistics to a permanent archive table every month and reports from that archive retrospectively. It answers in one list who used which transaction how often in which month, when the first and last use were, and which transactions are in a user's roles but never used, for audits and role clean-up.
- Estimated effort
- M · 8–12 working days
- System
- ECC and S/4HANA
- Tables
- 8
- Scope
- Global
- Built by
- NeKuDos Teknoloji
- Last updated
Why is the standard not enough?
ST03N shows usage by user and transaction, but detailed data is kept only for the period set in the system and is then deleted; a question about usage a year ago has no answer. SUIM lists the transactions a user is authorized for but does not compare them with usage. Finding transactions that are authorized but never used means joining two lists by hand.
Who uses it? Basis and authorization administrators, internal audit, 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 |
|---|---|---|---|
| USR02User Logon Data | User type, lock status, last logon | — | ECC + S/4 |
| USR21User Name to Address Key Assignment | User's address and person number | USR21-BNAME = USR02-BNAME | ECC + S/4 |
| ADRPPersons (Business Address Services) | User's full name | ADRP-PERSNUMBER = USR21-PERSNUMBER | ECC + S/4 |
| ADCPPerson/Address Assignment | User's department | ADCP-PERSNUMBER = USR21-PERSNUMBER | ECC + S/4 |
| TSTCSAP Transaction Codes | Transaction code and program | — | ECC + S/4 |
| TSTCTTransaction Code Texts | Transaction code text | TSTCT-TCODE = TSTC-TCODE | ECC + S/4 |
| AGR_USERSAssignment of Roles to Users | User's valid roles | AGR_USERS-UNAME = USR02-BNAME | ECC + S/4 |
| AGR_1251Authorization Data for Roles | Transactions granted in roles through S_TCODE | AGR_1251-AGR_NAME = AGR_USERS-AGR_NAME | ECC + S/4 |
Selection screen parameters
| Parameter | Description | Type | Reference field | Required | Example |
|---|---|---|---|---|---|
| S_BNAME | User | Range / multiple | USR02-BNAME | No | AYILMAZ |
| S_TCODE | Transaction code | Range / multiple | TSTC-TCODE | No | VA01 |
| S_MONTH | Month (YYYYMM) | Range / multiple | — | Yes | 202601 – 202610 |
| S_AGR | Role | Range / multiple | AGR_USERS-AGR_NAME | No | SD_SATIS_TEMSILCISI |
| P_UNUSED | Show transactions in roles that were not used | Checkbox | — | No | X |
| P_ARCH | Archive the previous month (background job) | Checkbox | — | No | — |
Output columns
| # | Column | Source |
|---|---|---|
| 1 | User | USR02-BNAME |
| 2 | Full name | ADRP-NAME_TEXT |
| 3 | Department | ADCP-DEPARTMENT |
| 4 | User type | USR02-USTYP |
| 5 | Transaction | TSTC-TCODE |
| 6 | Transaction text | TSTCT-TTEXT |
| 7 | Dialog steps | Calculated Total dialog steps in the selected months (from the archive) |
| 8 | First month used | Calculated Earliest month in the archive with steps > 0 |
| 9 | Last month used | Calculated Latest month in the archive with steps > 0 |
| 10 | In a role | Calculated Whether the transaction is granted through S_TCODE in a valid role of the user |
| 11 | Last logon | USR02-TRDAT |
Sample output
| User | Full name | Department | User type | Transaction | Transaction text | Dialog steps | First month used | Last month used | In a role | Last logon |
|---|---|---|---|---|---|---|---|---|---|---|
| AYILMAZ | Ayşe Yılmaz | Sales | A | VA01 | Create Sales Order | 4,120 | 01.2026 | 10.2026 | Yes | 17.11.2026 |
| AYILMAZ | Ayşe Yılmaz | Sales | A | VK11 | Create Condition | 0 | Yes, not used | 17.11.2026 | ||
| MDEMIR | Mehmet Demir | Accounting | A | FB50 | Enter G/L Account Document | 865 | 02.2026 | 10.2026 | Yes | 16.11.2026 |
| BATCH_FI | Arka plan kullanıcısı | IT | B | F110 | Automatic Payments | 52 | 01.2026 | 10.2026 | Yes |
How does the report work?
- A monthly background job reads the user × transaction totals of the previous month from the workload collector with SWNC_COLLECTOR_GET_AGGREGATES for all application servers (number of dialog steps, total response time, task type).
- The totals are written to a permanent archive table defined during installation, keyed by month, system, user and transaction. Running the same month again overwrites the records, so no duplicates arise; the retention period of the archive follows the company’s record retention policy.
- The report enriches the archive with user master data: user type, lock status and last logon (USR02), name and department (USR21 → ADRP/ADCP), transaction text (TSTC/TSTCT).
- Role comparison: the user’s valid roles (AGR_USERS) and the transactions granted in them through S_TCODE (AGR_1251, with ranges and wildcards resolved) are read. Transactions that are in the roles but were never used in the selected period, and transactions that were used although they are not in a role (for example called through another authorization), are flagged separately.
- Views: user × transaction × month matrix, number of users per transaction, share of unused transactions per role. The user drills down from a line to the monthly detail.
- It works the same in S/4HANA and ECC; the workload collector is read with the same function in both releases.
Performance notes
Call the collector for monthly totals only; do not read the daily detail. A secondary index on month and user is recommended for the archive table. In the role comparison, restrict AGR_1251 to object S_TCODE and resolve ranges once in memory.
Features
- ALV list (sort, filter, subtotals)
- User-specific layout variants
- Runs as a background job Archiving runs as a monthly job; the report can also run in the background.
- Double-click drill-down to the document From a user-transaction line the user drills down to the monthly detail.
- Export to Excel The list is exported to Excel in answer to an auditor request.
Authorization objects
- S_TOOLS_EXViewing user-level data in workload statistics
- S_USER_GRPDisplaying user master data by user group
- S_BTCH_JOBScheduling the monthly archiving job
Frequently asked questions
Does usage data count as personal data, and how should it be kept?
Usage per user is a record that can be linked to an employee. The archive is kept only for authorization and audit purposes, its retention period follows the company's record retention policy and access to the report is limited to Basis, authorization management and audit. If required, older months can be kept with an anonymous key instead of the user name.
How far back can the archive start?
On the first run, the archive takes the monthly totals still available in the workload collector; how far back that goes depends on the retention setting in the system. From then on every month is added and the data is no longer deleted.
Should a transaction that is in a role but unused be removed at once?
No. Rare activities such as year-end closing or yearly tasks can look unused over a short period. Run the report over at least 12 months and decide on removal together with the role owner.
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 …
User, Role and Transaction Authorization Audit Report with Role Assignment History
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 …
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.