BASIS Report Custom development ALV report

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

  • ST03N Workload and Performance Statistics. Shows usage by user and transaction; the detail is kept for a limited time and is not compared with roles.
  • SUIM User Information System. Lists the transactions users are authorized for; does not show actual usage.

Tables used

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

TableRoleJoinSystem
USR02User Logon DataUser type, lock status, last logon—ECC + S/4
USR21User Name to Address Key AssignmentUser's address and person numberUSR21-BNAME = USR02-BNAMEECC + S/4
ADRPPersons (Business Address Services)User's full nameADRP-PERSNUMBER = USR21-PERSNUMBERECC + S/4
ADCPPerson/Address AssignmentUser's departmentADCP-PERSNUMBER = USR21-PERSNUMBERECC + S/4
TSTCSAP Transaction CodesTransaction code and program—ECC + S/4
TSTCTTransaction Code TextsTransaction code textTSTCT-TCODE = TSTC-TCODEECC + S/4
AGR_USERSAssignment of Roles to UsersUser's valid rolesAGR_USERS-UNAME = USR02-BNAMEECC + S/4
AGR_1251Authorization Data for RolesTransactions granted in roles through S_TCODEAGR_1251-AGR_NAME = AGR_USERS-AGR_NAMEECC + S/4

Selection screen parameters

ParameterDescriptionTypeReference fieldRequiredExample
S_BNAMEUserRange / multipleUSR02-BNAMENoAYILMAZ
S_TCODETransaction codeRange / multipleTSTC-TCODENoVA01
S_MONTHMonth (YYYYMM)Range / multiple—Yes202601 – 202610
S_AGRRoleRange / multipleAGR_USERS-AGR_NAMENoSD_SATIS_TEMSILCISI
P_UNUSEDShow transactions in roles that were not usedCheckbox—NoX
P_ARCHArchive the previous month (background job)Checkbox—No—

Output columns

#ColumnSource
1UserUSR02-BNAME
2Full nameADRP-NAME_TEXT
3DepartmentADCP-DEPARTMENT
4User typeUSR02-USTYP
5TransactionTSTC-TCODE
6Transaction textTSTCT-TTEXT
7Dialog stepsCalculated Total dialog steps in the selected months (from the archive)
8First month usedCalculated Earliest month in the archive with steps > 0
9Last month usedCalculated Latest month in the archive with steps > 0
10In a roleCalculated Whether the transaction is granted through S_TCODE in a valid role of the user
11Last logonUSR02-TRDAT

Sample output

UserFull nameDepartmentUser typeTransactionTransaction textDialog stepsFirst month usedLast month usedIn a roleLast logon
AYILMAZAyşe YılmazSalesAVA01Create Sales Order4,12001.202610.2026Yes17.11.2026
AYILMAZAyşe YılmazSalesAVK11Create Condition0Yes, not used17.11.2026
MDEMIRMehmet DemirAccountingAFB50Enter G/L Account Document86502.202610.2026Yes16.11.2026
BATCH_FIArka plan kullanıcısıITBF110Automatic Payments5201.202610.2026Yes
A view built with fictional sample data; not real system data.

How does the report work?

  1. 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).
  2. 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.
  3. 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).
  4. 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.
  5. 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.
  6. 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

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: User and Transaction Code Usage History Archive and Report