# 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 value change, table maintenance, user and role maintenance or changing RFC destinations, showing which role or profile grants the access, the value and the validity end of the assignment. The rule list is kept in a settings table that can be maintained per customer; before an audit, one list shows who has what.

- Type: Report, Custom development, ALV report
- Module: BASIS
- Estimated effort: M (5–7 working days)
- Last updated: 2026-11-17
- URL: https://nekuhub.com/en/reports/users-with-critical-authorizations-report-sap-all-debug/


## Why is the standard not enough?

"Users by complex selection criteria" in SUIM (RSUSR002) searches one authorization object and value combination at a time; it does not evaluate dozens of critical rules in one run, and it does not show in the same row which role grants the access and when the assignment ends. SAP_ALL profile assignments and role-based authorizations are searched separately. The segregation of duties (SoD) report checks pairs of authorizations; this report scans authorizations that are critical on their own against a rule list.

### Closest standard alternatives

- SUIM: Finds users with one combination of authorization values; there is no multi-rule run with role source and assignment end in one list.
- PFCG: Shows the authorizations and users of a role one role at a time; it does not scan critical access across users.

## Tables used

| Table | Role | Access | Join | System |
|---|---|---|---|---|
| USR02 | User type, group, lock status, validity and last logon (driving table) | Read | - | ECC + S/4 |
| AGR_USERS | User-to-role assignment and validity dates | Read | AGR_USERS-UNAME = USR02-BNAME | ECC + S/4 |
| AGR_1251 | Authorization object, field and values in the role | Read | AGR_1251-AGR_NAME = AGR_USERS-AGR_NAME | ECC + S/4 |
| UST04 | Directly assigned profiles (SAP_ALL, SAP_NEW) | Read | UST04-BNAME = USR02-BNAME | ECC + S/4 |
| AGR_TEXTS | Role description | Read | AGR_TEXTS-AGR_NAME = AGR_USERS-AGR_NAME AND AGR_TEXTS-SPRAS = SY-LANGU AND AGR_TEXTS-LINE = 0 | ECC + S/4 |
| USR21 | Person number of the user | Read | USR21-BNAME = USR02-BNAME | ECC + S/4 |
| ADRP | Full name of the user | Read | ADRP-PERSNUMBER = USR21-PERSNUMBER | ECC + S/4 |

## Selection screen parameters

| Parameter | Description | Type | Reference field | Required |
|---|---|---|---|---|
| S_UNAME | User | Range / multiple | USR02-BNAME | No |
| S_USTYP | User type | Range / multiple | USR02-USTYP | No |
| S_CLASS | User group | Range / multiple | USR02-CLASS | No |
| S_AGR | Role | Range / multiple | AGR_USERS-AGR_NAME | No |
| S_OBJCT | Authorization object (narrows the rule list) | Range / multiple | AGR_1251-OBJECT | No |
| P_KEYDT | Key date | Single value | - | Yes |
| P_PROF | Check directly assigned critical profiles | Checkbox | - | No |
| P_LOCK | Also show locked users | Checkbox | - | No |

## Output columns

| Column | Source |
|---|---|
| User | USR02-BNAME |
| Full name | ADRP-NAME_TEXT |
| User type | USR02-USTYP |
| User group | USR02-CLASS |
| Last logon | USR02-TRDAT |
| Critical rule | Calculated: Description of the matching rule in the settings table |
| Role | AGR_USERS-AGR_NAME |
| Role description | AGR_TEXTS-TEXT |
| Profile | UST04-PROFILE |
| Authorization object | AGR_1251-OBJECT |
| Field | AGR_1251-FIELD |
| Value | AGR_1251-LOW |
| Assignment valid to | AGR_USERS-TO_DAT |
| Risk level | Calculated: Risk level of the rule; SAP_ALL and debug change are always Critical |

## How does the report work?

1. The rule list is read from the settings table: rule code, risk level, authorization object, field and value (e.g. S_TCODE-TCD = SU01, PFCG, SE38, SM59, SCC4; S_DEVELOP OBJTYPE = DEBUG and ACTVT = 02; S_TABU_DIS ACTVT = 02; S_USER_GRP ACTVT = 01/02; S_BTCH_ADM BTCADMIN = Y).
2. Authorization values that are not deleted (DELETED blank) are read from AGR_1251 and matched against the rules; '*' wildcards and LOW–HIGH ranges count as a match when they cover the rule value.
3. Matching roles are expanded to users through AGR_USERS assignments valid on the key date; single roles of composite roles are stored separately in AGR_USERS and are found directly. The role description is added from AGR_TEXTS.
4. Users with SAP_ALL, SAP_NEW or other critical profiles from the rule list assigned directly are read from UST04.
5. User type, group, lock status (UFLAG), validity and last logon are added from USR02, the full name from USR21/ADRP. Locked users are excluded depending on the selection.
6. The result is listed by user and rule in ALV; double-clicking the user opens SU01, double-clicking the role opens PFCG.

## Authorization objects

- S_USER_GRP: Display user data by user group (ACTVT 03)
- S_USER_AGR: Display roles and role authorizations
- S_USER_PRO: Display profiles

## Frequently asked questions

### Who defines the critical rule list?

During installation, a starter list of common critical authorizations is prepared with the information security and audit team. The list is kept in a settings table; adding a rule needs no program change.

### Does the report read user password data?

No. The report reads only metadata such as roles, profiles, user type, validity and last logon. Fields holding password hashes or security keys are never selected.

### How are emergency (firefighter) users separated?

Emergency users can be excluded from the selection by user group or name pattern, or listed alone with a separate variant. Approved exceptions are then tracked apart from the main findings.

---
Let us build this report for your system: https://nekuhub.com/en/request-a-quote/?report=basis-critical-authorizations-by-user
