BAPI_USER_GET_DETAIL — BAPI_USER_GET_DETAIL Read User Master Data
BAPI_USER_GET_DETAIL is a read-only BAPI that returns the full user master record for a given username, equivalent to opening the user in SU01 in display mode. It returns logon data, address, roles, profiles, parameters and lock status as separate export structures and tables, and never changes anything in the system.
This page covers what BAPI_USER_GET_DETAIL returns, which parameters carry which piece of the user master record, and why interfaces that skip checking the RETURN table end up treating a nonexistent or locked user as if it had no roles at all. It also covers the client-dependency trap that causes GRC and IDM integrations to silently read the wrong data.
Reviewed by an ERPClimb SAP consultant on 16 Sept 2026· 1,002 words
What it does
The BAPI acts on the user master record maintained through SU01 (technically stored across USR02, USR21, and the role and profile assignment tables). Given a username it returns everything a display in SU01 would show: logon data such as user type and validity dates, address data, default printer and time zone settings, assigned roles and profiles, user parameters, and lock status. It performs no write operations and requires no authorization to change anything, only to display. It is the standard mechanism identity management systems, GRC access review tools, and custom reporting programs use to pull a snapshot of a user's authorization footprint without opening a dialog session.
Important parameters
- USERNAME - import parameter, the SU01 user ID to read; case handling follows the client's user ID convention
- ADDRESS - export structure with name, address and communication data
- LOGONDATA - export structure with user type, validity dates, user group and reference user
- DEFAULTS - export structure with default settings such as start menu, logon language, decimal notation and printer
- GROUPS - export table listing the user group(s) the user belongs to for authorization checks
- PROFILES - export table of authorization profiles assigned directly to the user
- ACTIVITYGROUPS - export table of roles (activity groups) assigned to the user, with validity dates per assignment
- PARAMETER - export table of user parameter ID and value pairs (SU01 parameters tab)
- ISLOCKED - export structure indicating whether the user is locked and by which mechanism (administrator lock, failed logon lock)
- RETURN - export table of messages describing whether the read succeeded, partially succeeded, or failed
Commit behaviour
There is nothing to commit. The BAPI performs a read and returns data drawn from the current, already-committed state of the user master. Calling it inside a BAPI_TRANSACTION_COMMIT wrapper has no effect and is not required. The only behaviour worth watching is not commit-related but read-consistency related: if another session is mid-change to the same user (role assignment in progress, password reset in flight), the read reflects whatever is committed at the instant of the call, which can differ from what a screen open in the same moment shows if that screen has unsaved changes.
Return handling
RETURN here is a table, not a single structure, which trips up developers used to single-message BAPIs. A username that does not exist produces an error-type row in RETURN and every export structure and table comes back empty rather than the call raising an exception. An interface that checks only whether the call executed without a system error, and never inspects RETURN for TYPE equal to E or A, will treat a nonexistent user as a real user with zero roles and zero profiles. In access review automation this is dangerous: a typo'd username or a user deleted between extraction and review reads as fully deprovisioned rather than as a lookup failure. The correct pattern is to loop RETURN, treat any E or A row as a failed lookup, and only trust ACTIVITYGROUPS, PROFILES and PARAMETER as meaningful when RETURN carries no error. A single S or blank RETURN table is not proof of success on its own; absence of an error row is what matters, not presence of a success row.
ECC vs S/4HANA
The BAPI remains valid and in active use on S/4HANA, on-premise and private cloud editions. SU01 itself is unchanged as the underlying transaction, and identity management middleware, GRC access control connectors, and custom compliance reports continue to rely on this BAPI for on-premise systems. For cloud identity scenarios newer identity provisioning services and OData-based user APIs are used instead, but within a classic ABAP stack this BAPI has not been formally deprecated or replaced by an equivalent released API.
Common pitfalls
- Called via RFC against the wrong client: the BAPI reads client-dependent role and profile assignments, so a call routed to the wrong logical system or client returns a technically valid but organizationally wrong picture of the user's access
- ACTIVITYGROUPS includes expired or not-yet-valid role assignments unless the caller filters on the validity dates returned alongside each row, leading access reviews to overcount active roles
- Composite roles are not expanded; the table shows what is directly assigned, not the single roles a composite pulls in, so downstream authorization coverage checks that assume a flat role list undercount actual access
- Called in a tight loop across thousands of users for mass reporting instead of using a mass read report or table-based extract, causing RFC overhead and long-running jobs that time out in scheduling tools
- Reference user (LOGONDATA) is ignored by the caller, so a service or dialog user whose real authorizations come from a reference user shows as having none in a naive read
Whose problem this is
Interface failures that stem from unchecked RETURN or client routing sit with the developer who wrote the calling program. Disputes about whether a role or profile shown (or missing) is correct sit with the security team, who need the raw ACTIVITYGROUPS/PROFILES table contents alongside the equivalent SU01 screen for the same user and client to compare, rather than a summary report.
Related SAP objects
Reviewed pages this object connects to in the ERPClimb knowledge graph.
Source: ERPClimb — https://erpclimb.com/sap-bapis/bapi-user-get-detailERPClimb is an independent platform and is not affiliated with SAP SE. Reference pages are written and reviewed by SAP consultants for learning and troubleshooting.