Skip to content

SUSR_USER_READ

Internal (non-RFC) alternative to BAPI_USER_GET_DETAIL for reading user master data.

Purpose

Reads user master data from SU01 in a single in-process call. Covers the same ground as BAPI_USER_GET_DETAIL but is not RFC-enabled, making it suitable only for local ABAP calls within the same application server. Slightly faster than the BAPI because it skips the RFC overhead and some of the BAPI wrapper logic.

Signature (the parts you'll actually use)

Parameter Direction Type Notes
BNAME IMPORTING XUBNAME The user ID to read. Required.
ISLOCKED EXPORTING BAPIUSLOCK Lock status flags (LOCAL_LOCK, GLOB_LOCK, WRNG_LOGON)
LOGONDATA EXPORTING BAPILOGOND Validity dates, user type, time zone
ADDRESS EXPORTING BAPIADDR3 Name, email, phone, department
PROFILES TABLES BAPIPROF Assigned profiles
ACTIVITYGROUPS TABLES BAPIAGR Assigned roles
RETURN TABLES BAPIRET2 Messages — always check this

Example

DATA: lv_user    TYPE xubname VALUE 'LOCALUSER',
      ls_locked  TYPE bapiuslock,
      ls_logon   TYPE bapilogond,
      ls_address TYPE bapiaddr3,
      lt_return  TYPE STANDARD TABLE OF bapiret2.

CALL FUNCTION 'SUSR_USER_READ'
  EXPORTING
    bname     = lv_user
  IMPORTING
    islocked  = ls_locked
    logondata = ls_logon
    address   = ls_address
  TABLES
    return    = lt_return.

LOOP AT lt_return INTO DATA(ls_msg) WHERE type CA 'EAX'.
  WRITE: / ls_msg-message.
ENDLOOP.

IF ls_locked-local_lock = 'L'.
  WRITE: / lv_user, 'is locally locked'.
ENDIF.

Common pitfalls

Not RFC-enabled — local calls only

SUSR_USER_READ cannot be called remotely (no RFC flag in SE37). Attempting a remote call will fail at runtime. Use BAPI_USER_GET_DETAIL for any cross-system, middleware, or external integration scenario.

Behaviour may vary across releases

This function module is part of the internal user-management kernel and is not covered by SAP's compatibility guarantees for public BAPIs. Its interface and behaviour have changed between minor releases. Avoid it in long-lived or portable programs; prefer the BAPI unless the performance difference is measurable and significant.

  • No COMMIT needed — this is read-only.
  • ISLOCKED is directly available as an exporting parameter here, whereas in BAPI_USER_GET_DETAIL it is also an exporting parameter — one small advantage is that this module may return more granular internal lock flags not surfaced by the BAPI on older releases.
  • Less documented. SAP notes and community resources cover BAPI_USER_GET_DETAIL far more thoroughly. When something behaves unexpectedly, support channels are less likely to help with this FM.
  • Always check the RETURN table — never assume success.

See also

  • Transactions: SU01, SE37 (inspect the FM interface directly)
  • Structure: BAPIUSLOCK — fields LOCAL_LOCK, GLOB_LOCK, WRNG_LOGON

Comments