# BAPI_USER_CHANGE — Change User

> Changes the logon data, address, defaults, password or parameters of an existing user. Identity management and user synchronization interfaces use it instead of SU01 changes. Mark the fields with 'X' in the matching …X structure (LOGONDATAX, ADDRESSX, etc.) for every structure you change; it requires S_USER_GRP authorization and the RETURN table must be checked.

- Modules: BASIS
- Type: BAPI
- Function group: SU_USER
- Remote-enabled (RFC): Yes
- S/4HANA status: Used the same way in S/4HANA
- URL: https://nekuhub.com/en/functions/bapi-user-change/

## Importing parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| USERNAME | BAPIBNAME-BAPIBNAME | User name | Yes |
| LOGONDATA | BAPILOGOND | Logon data | - |
| LOGONDATAX | BAPILOGONX | Logon data change flags | - |
| DEFAULTS | BAPIDEFAUL | Default settings | - |
| DEFAULTSX | BAPIDEFAX | Default settings change flags | - |
| ADDRESS | BAPIADDR3 | Address data | - |
| ADDRESSX | BAPIADDR3X | Address change flags | - |
| COMPANY | BAPIUSCOMP | Company address | - |
| PASSWORD | BAPIPWD | New password | - |
| PASSWORDX | BAPIPWDX | Password change flag | - |
| PRODUCTIVE_PWD | BAPIFLAG-BAPIFLAG | Set password as productive password | - |
| GENERATE_PWD | BAPIFLAG-BAPIFLAG | Generate password | - |
| SNC | BAPISNCU | SNC data | - |
| UCLASS | BAPIUCLASS | License data | - |
| ALIAS | BAPIALIAS | User alias | - |

## Exporting parameters

| Parameter | Type | Description |
|---|---|---|
| GENERATED_PASSWORD | BAPIPWD | Generated password |

## Tables parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| PARAMETER | BAPIPARAM | User parameters | - |
| GROUPS | BAPIGROUPS | User groups | - |
| RETURN | BAPIRET2 | Return messages | Yes |

## Call template (ABAP)

```abap
CALL FUNCTION 'BAPI_USER_CHANGE'
  EXPORTING
    username = lv_username
  IMPORTING
    generated_password = lv_generated_password
  TABLES
    parameter = lt_parameter
    groups = lt_groups
    return = lt_return.
```

## Related tables

USR01, USR02, USR21

