User License Type and Last Logon Report (Inactive Users)
Short answer: 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 on for a long time, never logged on, are past their validity but not locked, or have no license type are flagged, which makes the clean-up before license measurement straightforward.
- Estimated effort
- S · 2–4 working days
- System
- ECC and S/4HANA
- Tables
- 6
- Scope
- Global
- Built by
- NeKuDos Teknoloji
- Last updated
Why is the standard not enough?
SUIM can list users by last logon date and SU01 shows the license type per user. No standard screen, however, combines license type, last logon, number of valid roles and department; to find users with a Professional license who have not logged on for months before license measurement, several lists are merged in Excel. The custom report does this in one run and writes the finding per line.
Who uses it? SAP authorization administrators, license managers, IT managers and internal audit.
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, group, validity, lock and last logon date (driving table) | — | ECC + S/4 |
| USR06Additional Data per User (License Type) | License type assigned for license measurement | USR06-BNAME = USR02-BNAME | ECC + S/4 |
| AGR_USERSAssignment of Roles to Users | Number of valid role assignments | AGR_USERS-UNAME = USR02-BNAME | ECC + S/4 |
| USR21User Name to Address Key Assignment | Person and address number of the user | USR21-BNAME = USR02-BNAME | ECC + S/4 |
| ADRPPersons (Business Address Services) | Full name | ADRP-PERSNUMBER = USR21-PERSNUMBER | ECC + S/4 |
| ADCPPerson/Address Assignment | Department | ADCP-PERSNUMBER = USR21-PERSNUMBER AND ADCP-ADDRNUMBER = USR21-ADDRNUMBER | ECC + S/4 |
Selection screen parameters
| Parameter | Description | Type | Reference field | Required | Example |
|---|---|---|---|---|---|
| S_UNAME | User | Range / multiple | USR02-BNAME | No | * |
| S_CLASS | User group | Range / multiple | USR02-CLASS | No | PUR |
| S_USTYP | User type | Range / multiple | USR02-USTYP | No | A |
| S_LICTY | License type | Range / multiple | USR06-LIC_TYPE | No | — |
| P_DAYS | Inactivity threshold (days) | Single value | — | Yes | 90 |
| P_FINDO | Users with findings only | Checkbox | — | No | X |
| P_LOCKD | Include locked users | 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 | User group | USR02-CLASS |
| 6 | License type | USR06-LIC_TYPE |
| 7 | Valid to | USR02-GLTGB |
| 8 | Lock status | USR02-UFLAG |
| 9 | Last logon | USR02-TRDAT |
| 10 | Inactive days | Calculated Key date − USR02-TRDAT (no logon: − USR02-ERDAT) |
| 11 | Valid roles | Calculated Number of AGR_USERS entries valid on the key date |
| 12 | Finding | Calculated Threshold exceeded, never logged on, validity ended, no license type or no role |
Sample output
| User | Full name | Department | User type | User group | License type | Valid to | Lock status | Last logon | Inactive days | Valid roles | Finding |
|---|---|---|---|---|---|---|---|---|---|---|---|
| SOZTURK | Selin Öztürk | Purchasing | A | PUR | Professional | 12/31/9999 | 0 | 06/02/2026 | 168 | 7 | Inactive for more than 90 days |
| EARSLAN | Emre Arslan | Warehouse | A | LOG | Limited Professional | 09/30/2026 | 0 | 09/28/2026 | 50 | 4 | Validity ended, not locked |
| CKOC | Cem Koç | Finance | A | FIN | 12/31/9999 | 0 | 41 | 3 | Never logged on, no license type | ||
| DSAHIN | Deniz Şahin | Sales | A | SAL | Professional | 12/31/9999 | 0 | 11/14/2026 | 3 | 0 | No valid role |
How does the report work?
- Users in the selection are read from USR02: user type (USTYP), user group (CLASS), validity (GLTGV, GLTGB), lock status (UFLAG), creation date (ERDAT) and last logon date (TRDAT).
- The license type (LIC_TYPE) is added from USR06 and shown with its USMM text; users without an entry are flagged as “no license type”.
- Role assignments valid on the key date are counted from AGR_USERS.
- Inactive days = key date − TRDAT. For users who never logged on (TRDAT empty), the days since the creation date are used.
- Findings: inactivity threshold exceeded; never logged on; validity ended but not locked; no license type assigned; active user without any valid role.
- Full name and department are added from ADRP and ADCP through USR21. The result is listed with subtotals per license type.
Performance notes
The tables are small, so the report also runs fast in dialog. On multi-client systems, run it in each client separately or schedule it as a monthly background job and receive the result by email.
Features
- ALV list (sort, filter, subtotals)
- User-specific layout variants
- Double-click drill-down to the document Double-clicking the user opens SU01 in display mode.
- Export to Excel
- Runs as a background job
- Send the result by email The monthly list of findings can be sent to the license manager.
Authorization objects
- S_USER_GRPDisplay authorization for user data by user group
- S_USER_AGRDisplay authorization for role assignments
Frequently asked questions
Does the report read password data?
No. From USR02 the report only reads administrative fields such as user type, group, validity, lock and last logon date; no field related to passwords or password hashes is selected.
Can I lock inactive users from the report?
The report only lists. Approved users can be locked in bulk with SU10, or the separate automatic lock program can run on a schedule.
Why do users without a license type matter?
In license measurement, dialog users without an assigned type are usually counted in the highest category. Assigning the right type before measurement avoids unexpected license differences.
Related reports
Automatic Lock of Inactive Users Program
A custom background program that first warns dialog users who have not logged on for a given period by email, locks them with an administrator lock …
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 …
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.