BASIS Report Custom development ALV report

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

  • SUIM User Information System. Lists users by last logon date; license type, department and number of valid roles are not in the same list.
  • SU01 User Maintenance. Shows license type and logon data for one user at a time.

Tables used

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

TableRoleJoinSystem
USR02User Logon DataUser type, group, validity, lock and last logon date (driving table)—ECC + S/4
USR06Additional Data per User (License Type)License type assigned for license measurementUSR06-BNAME = USR02-BNAMEECC + S/4
AGR_USERSAssignment of Roles to UsersNumber of valid role assignmentsAGR_USERS-UNAME = USR02-BNAMEECC + S/4
USR21User Name to Address Key AssignmentPerson and address number of the userUSR21-BNAME = USR02-BNAMEECC + S/4
ADRPPersons (Business Address Services)Full nameADRP-PERSNUMBER = USR21-PERSNUMBERECC + S/4
ADCPPerson/Address AssignmentDepartmentADCP-PERSNUMBER = USR21-PERSNUMBER AND ADCP-ADDRNUMBER = USR21-ADDRNUMBERECC + S/4

Selection screen parameters

ParameterDescriptionTypeReference fieldRequiredExample
S_UNAMEUserRange / multipleUSR02-BNAMENo*
S_CLASSUser groupRange / multipleUSR02-CLASSNoPUR
S_USTYPUser typeRange / multipleUSR02-USTYPNoA
S_LICTYLicense typeRange / multipleUSR06-LIC_TYPENo—
P_DAYSInactivity threshold (days)Single value—Yes90
P_FINDOUsers with findings onlyCheckbox—NoX
P_LOCKDInclude locked usersCheckbox—No—

Output columns

#ColumnSource
1UserUSR02-BNAME
2Full nameADRP-NAME_TEXT
3DepartmentADCP-DEPARTMENT
4User typeUSR02-USTYP
5User groupUSR02-CLASS
6License typeUSR06-LIC_TYPE
7Valid toUSR02-GLTGB
8Lock statusUSR02-UFLAG
9Last logonUSR02-TRDAT
10Inactive daysCalculated Key date − USR02-TRDAT (no logon: − USR02-ERDAT)
11Valid rolesCalculated Number of AGR_USERS entries valid on the key date
12FindingCalculated Threshold exceeded, never logged on, validity ended, no license type or no role

Sample output

UserFull nameDepartmentUser typeUser groupLicense typeValid toLock statusLast logonInactive daysValid rolesFinding
SOZTURKSelin ÖztürkPurchasingAPURProfessional12/31/9999006/02/20261687Inactive for more than 90 days
EARSLANEmre ArslanWarehouseALOGLimited Professional09/30/2026009/28/2026504Validity ended, not locked
CKOCCem KoçFinanceAFIN12/31/99990413Never logged on, no license type
DSAHINDeniz ŞahinSalesASALProfessional12/31/9999011/14/202630No valid role
A view built with fictional sample data; not real system data.

How does the report work?

  1. 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).
  2. 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”.
  3. Role assignments valid on the key date are counted from AGR_USERS.
  4. Inactive days = key date − TRDAT. For users who never logged on (TRDAT empty), the days since the creation date are used.
  5. Findings: inactivity threshold exceeded; never logged on; validity ended but not locked; no license type assigned; active user without any valid role.
  6. 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

BASIS Program Custom Background program

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 …

USR02 · USR21 · ADR6 · AGR_USERS

BASIS Report Custom ALV report

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 …

USR02 · AGR_USERS · AGR_1251 · TSTC

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 License Type and Last Logon Report (Inactive Users)