Skip to content

SUSR_USER_READ

Internal (non-RFC) FM for reading user master data in a single in-process call.

Purpose

Reads user master data from SU01. Covers logon data, defaults, address, reference user, alias, and license class. Not RFC-enabled — local calls within the same application server only. Use BAPI_USER_GET_DETAIL for any remote or cross-system scenario.

Signature

Importing

Parameter Type Default Notes
USER_NAME USR02-BNAME — User ID to read. Required.
WITH_TEXT CHAR01 SPACE Pass 'X' to populate text fields in the result structures.
READ_UCLASS CHAR01 SPACE Pass 'X' to populate UCLASS and UCLASSSYS.

Exporting

Parameter Type Notes
USER_LOGONDATA USLOGOND Logon data: user type, validity dates, time zone, last logon.
USER_DEFAULTS USDEFAULTS User defaults: language, date/time/decimal formats, printer.
USER_ADDRESS USADDRESS Internal address keys: PERSNUMBER, ADDRNUMBER, HANDLE. Use these to fetch actual address data via address services.
REF_USER BAPIREFUS Reference user assigned to this account.
ALIAS BAPIALIAS User alias.
UCLASS BAPIUCLASS License class (only populated when READ_UCLASS = 'X').

Tables

Parameter Type Notes
USER_PARAMETERS USTYP_T_PARAMETERS User SU3 parameters (SET/GET parameter IDs and values). Optional.
UCLASSSYS BAPIUCLASSSYS System-specific license class data. Optional.

Exceptions

Exception When raised
USER_NAME_NOT_EXISTS The user ID does not exist in the system.
INTERNAL_ERROR Unexpected internal error during the read.

Example

DATA: ls_logon    TYPE uslogond,
      ls_defaults TYPE usdefaults,
      ls_address  TYPE usaddress,
      lt_params   TYPE ustyp_t_parameters.

CALL FUNCTION 'SUSR_USER_READ'
  EXPORTING
    user_name      = 'JOHNDOE'
    with_text      = 'X'
  IMPORTING
    user_logondata = ls_logon
    user_defaults  = ls_defaults
    user_address   = ls_address
  TABLES
    user_parameters = lt_params
  EXCEPTIONS
    user_name_not_exists = 1
    internal_error       = 2
    OTHERS               = 3.

IF sy-subrc <> 0.
  MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno.
  RETURN.
ENDIF.

WRITE: / 'User type:',   ls_logon-ustyp.
WRITE: / 'Valid from:',  ls_logon-gltgv.
WRITE: / 'Valid to:',    ls_logon-gltgb.
WRITE: / 'Last logon:',  ls_logon-ltime.
WRITE: / 'Time zone:',   ls_logon-tzone.
WRITE: / 'Language:',    ls_defaults-langu.

LOOP AT lt_params INTO DATA(ls_param).
  WRITE: / ls_param-parid, ls_param-parva.
ENDLOOP.

Common pitfalls

Not RFC-enabled — local calls only

SUSR_USER_READ has no RFC flag. Attempting a remote call will fail at runtime. Use BAPI_USER_GET_DETAIL for cross-system or external integration scenarios.

Interface can change between releases

This FM is part of the internal user-management kernel and is not covered by SAP's compatibility guarantees for public BAPIs. Prefer the BAPI in long-lived or portable programs.

  • No RETURN table — errors come back as exceptions, not as a message table. Always handle both exceptions.
  • READ_UCLASS must be explicitly set to 'X' to get license class data; it is not populated by default.
  • WITH_TEXT populates descriptive text fields in the result structures; leave it as SPACE if you only need key fields and want the fastest possible call.

See also

Comments