BASIS BAPI RFC Used the same way in S/4HANA

BAPI_USER_LOCK Lock User

Locks a user with an administrator lock; the user cannot log on until the lock is removed. Interfaces that automatically lock the users of leaving employees from HR or identity management systems use it. It needs the lock activity in authorization object S_USER_GRP; check the result in the RETURN table.

Function group
SU_USER
Remote-enabled (RFC)
Yes
Type
BAPI

Importing parameters

ParameterTypeDescriptionRequired
USERNAMEBAPIBNAME-BAPIBNAMEUser nameYes

Tables parameters

ParameterTypeDescriptionRequired
RETURNBAPIRET2Return messagesYes

Call template (ABAP)

A skeleton generated from the interface. It lists mandatory importing parameters, exporting parameters and tables; declare the variables with suitable types in your own program.

CALL FUNCTION 'BAPI_USER_LOCK'
  EXPORTING
    username = lv_username
  TABLES
    return = lt_return.

Related tables

Can't find the report you need?

We also build anything that is not in the catalog. Describe it briefly and we will suggest the right solution.

Request a custom report