SAP Function Modules

BAPI_USER_CHANGE SAP Function module - Change User







BAPI_USER_CHANGE is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name BAPI_USER_CHANGE into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: SU_USER
Released Date: 10.04.2000
Processing type: Remote-Enabled
remote enabled module settings


Pattern for FM BAPI_USER_CHANGE - BAPI USER CHANGE





CALL FUNCTION 'BAPI_USER_CHANGE' "Change User
  EXPORTING
    username =                  " bapibname-bapibname  User Name
*   logondata =                 " bapilogond    Logon Data
*   logondatax =                " bapilogonx    Select Change-Relevant Fields
*   defaults =                  " bapidefaul    User Defaults
*   defaultsx =                 " bapidefax     Select Change-Relevant Fields
*   address =                   " bapiaddr3     Address Data
*   addressx =                  " bapiaddr3x    Select Change-Relevant Fields
*   parameterx =                " bapiparamx    Select Change-Relevant Fields
*   company =                   " bapiuscomp    Company for Address
*   companyx =                  " bapiuscomx    Select Change-Relevant Fields
*   snc =                       " bapisncu      Secure Network Communication data
*   sncx =                      " bapisncux     Change Secure Network Communication Data
*   back_distribution = SPACE   " bapiflag      Redistribution into the Central System (Central User Administration)
*   password =                  " bapipwd       Password
*   passwordx =                 " bapipwdx      Select Change-Relevant Fields
*   addcomx =                   " bapiadcomx    Change Structure for Communication Data
*   ref_user =                  " bapirefus     User name
*   ref_userx =                 " bapirefusx    Reference user change flag
*   alias =                     " bapialias     User Name Alias
*   aliasx =                    " bapialiasx    User alias change flag
*   groupsx =                   " bapigroupx    User group change flag
*   uclass =                    " bapiuclass    License-Related User Classification
*   uclassx =                   " bapiuclassx   Change Indicators for License-Related User Classification
*   extidsx =                   " bapiusextidx  Change Indicators for External IDs
*   productive_pwd = SPACE      " bapiflag-bapiflag  Single-Character Indicator
  TABLES
*   parameter =                 " bapiparam     Table with User Parameters
    return =                    " bapiret2      Return Structure
*   addtel =                    " bapiadtel
*   addfax =                    " bapiadfax
*   addttx =                    " bapiadttx
*   addtlx =                    " bapiadtlx
*   addsmtp =                   " bapiadsmtp
*   addrml =                    " bapiadrml
*   addx400 =                   " bapiadx400
*   addrfc =                    " bapiadrfc
*   addprt =                    " bapiadprt
*   addssf =                    " bapiadssf
*   adduri =                    " bapiaduri
*   addpag =                    " bapiadpag
*   addcomrem =                 " bapicomrem
*   groups =                    " bapigroups    Transfer Structure for a List of User Groups
*   parameter1 =                " bapiparam1    Replaces parameter (length 18 -> 40)
*   uclasssys =                 " bapiuclasssys  System-Specific License-Related User Classification
*   extidhead =                 " bapiusextidhead  Header Data for External ID of a User
*   extidpart =                 " bapiusextidpart  Part of a Long Field for the External ID of a User
    .  "  BAPI_USER_CHANGE

ABAP code example for Function Module BAPI_USER_CHANGE





The ABAP code below is a full code listing to execute function module BAPI_USER_CHANGE including all data declarations. The code uses the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the original method of declaring data variables up front. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8).

DATA:
it_parameter  TYPE STANDARD TABLE OF BAPIPARAM,"TABLES PARAM
wa_parameter  LIKE LINE OF it_parameter ,
it_return  TYPE STANDARD TABLE OF BAPIRET2,"TABLES PARAM
wa_return  LIKE LINE OF it_return ,
it_addtel  TYPE STANDARD TABLE OF BAPIADTEL,"TABLES PARAM
wa_addtel  LIKE LINE OF it_addtel ,
it_addfax  TYPE STANDARD TABLE OF BAPIADFAX,"TABLES PARAM
wa_addfax  LIKE LINE OF it_addfax ,
it_addttx  TYPE STANDARD TABLE OF BAPIADTTX,"TABLES PARAM
wa_addttx  LIKE LINE OF it_addttx ,
it_addtlx  TYPE STANDARD TABLE OF BAPIADTLX,"TABLES PARAM
wa_addtlx  LIKE LINE OF it_addtlx ,
it_addsmtp  TYPE STANDARD TABLE OF BAPIADSMTP,"TABLES PARAM
wa_addsmtp  LIKE LINE OF it_addsmtp ,
it_addrml  TYPE STANDARD TABLE OF BAPIADRML,"TABLES PARAM
wa_addrml  LIKE LINE OF it_addrml ,
it_addx400  TYPE STANDARD TABLE OF BAPIADX400,"TABLES PARAM
wa_addx400  LIKE LINE OF it_addx400 ,
it_addrfc  TYPE STANDARD TABLE OF BAPIADRFC,"TABLES PARAM
wa_addrfc  LIKE LINE OF it_addrfc ,
it_addprt  TYPE STANDARD TABLE OF BAPIADPRT,"TABLES PARAM
wa_addprt  LIKE LINE OF it_addprt ,
it_addssf  TYPE STANDARD TABLE OF BAPIADSSF,"TABLES PARAM
wa_addssf  LIKE LINE OF it_addssf ,
it_adduri  TYPE STANDARD TABLE OF BAPIADURI,"TABLES PARAM
wa_adduri  LIKE LINE OF it_adduri ,
it_addpag  TYPE STANDARD TABLE OF BAPIADPAG,"TABLES PARAM
wa_addpag  LIKE LINE OF it_addpag ,
it_addcomrem  TYPE STANDARD TABLE OF BAPICOMREM,"TABLES PARAM
wa_addcomrem  LIKE LINE OF it_addcomrem ,
it_groups  TYPE STANDARD TABLE OF BAPIGROUPS,"TABLES PARAM
wa_groups  LIKE LINE OF it_groups ,
it_parameter1  TYPE STANDARD TABLE OF BAPIPARAM1,"TABLES PARAM
wa_parameter1  LIKE LINE OF it_parameter1 ,
it_uclasssys  TYPE STANDARD TABLE OF BAPIUCLASSSYS,"TABLES PARAM
wa_uclasssys  LIKE LINE OF it_uclasssys ,
it_extidhead  TYPE STANDARD TABLE OF BAPIUSEXTIDHEAD,"TABLES PARAM
wa_extidhead  LIKE LINE OF it_extidhead ,
it_extidpart  TYPE STANDARD TABLE OF BAPIUSEXTIDPART,"TABLES PARAM
wa_extidpart  LIKE LINE OF it_extidpart .


DATA(ld_username) = some text here
DATA(ld_logondata) = 'Check type of data required'.
DATA(ld_logondatax) = 'Check type of data required'.
DATA(ld_defaults) = 'Check type of data required'.
DATA(ld_defaultsx) = 'Check type of data required'.
DATA(ld_address) = 'Check type of data required'.
DATA(ld_addressx) = 'Check type of data required'.
DATA(ld_parameterx) = 'Check type of data required'.
DATA(ld_company) = 'Check type of data required'.
DATA(ld_companyx) = 'Check type of data required'.
DATA(ld_snc) = 'Check type of data required'.
DATA(ld_sncx) = 'Check type of data required'.
DATA(ld_back_distribution) = 'Check type of data required'.
DATA(ld_password) = 'Check type of data required'.
DATA(ld_passwordx) = 'Check type of data required'.
DATA(ld_addcomx) = 'Check type of data required'.
DATA(ld_ref_user) = 'Check type of data required'.
DATA(ld_ref_userx) = 'Check type of data required'.
DATA(ld_alias) = 'Check type of data required'.
DATA(ld_aliasx) = 'Check type of data required'.
DATA(ld_groupsx) = 'Check type of data required'.
DATA(ld_uclass) = 'Check type of data required'.
DATA(ld_uclassx) = 'Check type of data required'.
DATA(ld_extidsx) = 'Check type of data required'.

DATA(ld_productive_pwd) = some text here

"populate fields of struture and append to itab
append wa_parameter to it_parameter.

"populate fields of struture and append to itab
append wa_return to it_return.

"populate fields of struture and append to itab
append wa_addtel to it_addtel.

"populate fields of struture and append to itab
append wa_addfax to it_addfax.

"populate fields of struture and append to itab
append wa_addttx to it_addttx.

"populate fields of struture and append to itab
append wa_addtlx to it_addtlx.

"populate fields of struture and append to itab
append wa_addsmtp to it_addsmtp.

"populate fields of struture and append to itab
append wa_addrml to it_addrml.

"populate fields of struture and append to itab
append wa_addx400 to it_addx400.

"populate fields of struture and append to itab
append wa_addrfc to it_addrfc.

"populate fields of struture and append to itab
append wa_addprt to it_addprt.

"populate fields of struture and append to itab
append wa_addssf to it_addssf.

"populate fields of struture and append to itab
append wa_adduri to it_adduri.

"populate fields of struture and append to itab
append wa_addpag to it_addpag.

"populate fields of struture and append to itab
append wa_addcomrem to it_addcomrem.

"populate fields of struture and append to itab
append wa_groups to it_groups.

"populate fields of struture and append to itab
append wa_parameter1 to it_parameter1.

"populate fields of struture and append to itab
append wa_uclasssys to it_uclasssys.

"populate fields of struture and append to itab
append wa_extidhead to it_extidhead.

"populate fields of struture and append to itab
append wa_extidpart to it_extidpart. . CALL FUNCTION 'BAPI_USER_CHANGE' EXPORTING username = ld_username * logondata = ld_logondata * logondatax = ld_logondatax * defaults = ld_defaults * defaultsx = ld_defaultsx * address = ld_address * addressx = ld_addressx * parameterx = ld_parameterx * company = ld_company * companyx = ld_companyx * snc = ld_snc * sncx = ld_sncx * back_distribution = ld_back_distribution * password = ld_password * passwordx = ld_passwordx * addcomx = ld_addcomx * ref_user = ld_ref_user * ref_userx = ld_ref_userx * alias = ld_alias * aliasx = ld_aliasx * groupsx = ld_groupsx * uclass = ld_uclass * uclassx = ld_uclassx * extidsx = ld_extidsx * productive_pwd = ld_productive_pwd TABLES * parameter = it_parameter return = it_return * addtel = it_addtel * addfax = it_addfax * addttx = it_addttx * addtlx = it_addtlx * addsmtp = it_addsmtp * addrml = it_addrml * addx400 = it_addx400 * addrfc = it_addrfc * addprt = it_addprt * addssf = it_addssf * adduri = it_adduri * addpag = it_addpag * addcomrem = it_addcomrem * groups = it_groups * parameter1 = it_parameter1 * uclasssys = it_uclasssys * extidhead = it_extidhead * extidpart = it_extidpart . " BAPI_USER_CHANGE
IF SY-SUBRC EQ 0. "All OK ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_username  TYPE BAPIBNAME-BAPIBNAME ,
it_parameter  TYPE STANDARD TABLE OF BAPIPARAM ,
wa_parameter  LIKE LINE OF it_parameter,
ld_logondata  TYPE BAPILOGOND ,
it_return  TYPE STANDARD TABLE OF BAPIRET2 ,
wa_return  LIKE LINE OF it_return,
ld_logondatax  TYPE BAPILOGONX ,
it_addtel  TYPE STANDARD TABLE OF BAPIADTEL ,
wa_addtel  LIKE LINE OF it_addtel,
ld_defaults  TYPE BAPIDEFAUL ,
it_addfax  TYPE STANDARD TABLE OF BAPIADFAX ,
wa_addfax  LIKE LINE OF it_addfax,
ld_defaultsx  TYPE BAPIDEFAX ,
it_addttx  TYPE STANDARD TABLE OF BAPIADTTX ,
wa_addttx  LIKE LINE OF it_addttx,
ld_address  TYPE BAPIADDR3 ,
it_addtlx  TYPE STANDARD TABLE OF BAPIADTLX ,
wa_addtlx  LIKE LINE OF it_addtlx,
ld_addressx  TYPE BAPIADDR3X ,
it_addsmtp  TYPE STANDARD TABLE OF BAPIADSMTP ,
wa_addsmtp  LIKE LINE OF it_addsmtp,
ld_parameterx  TYPE BAPIPARAMX ,
it_addrml  TYPE STANDARD TABLE OF BAPIADRML ,
wa_addrml  LIKE LINE OF it_addrml,
ld_company  TYPE BAPIUSCOMP ,
it_addx400  TYPE STANDARD TABLE OF BAPIADX400 ,
wa_addx400  LIKE LINE OF it_addx400,
ld_companyx  TYPE BAPIUSCOMX ,
it_addrfc  TYPE STANDARD TABLE OF BAPIADRFC ,
wa_addrfc  LIKE LINE OF it_addrfc,
it_addprt  TYPE STANDARD TABLE OF BAPIADPRT ,
wa_addprt  LIKE LINE OF it_addprt,
ld_snc  TYPE BAPISNCU ,
it_addssf  TYPE STANDARD TABLE OF BAPIADSSF ,
wa_addssf  LIKE LINE OF it_addssf,
ld_sncx  TYPE BAPISNCUX ,
it_adduri  TYPE STANDARD TABLE OF BAPIADURI ,
wa_adduri  LIKE LINE OF it_adduri,
ld_back_distribution  TYPE BAPIFLAG ,
it_addpag  TYPE STANDARD TABLE OF BAPIADPAG ,
wa_addpag  LIKE LINE OF it_addpag,
ld_password  TYPE BAPIPWD ,
it_addcomrem  TYPE STANDARD TABLE OF BAPICOMREM ,
wa_addcomrem  LIKE LINE OF it_addcomrem,
ld_passwordx  TYPE BAPIPWDX ,
it_groups  TYPE STANDARD TABLE OF BAPIGROUPS ,
wa_groups  LIKE LINE OF it_groups,
ld_addcomx  TYPE BAPIADCOMX ,
it_parameter1  TYPE STANDARD TABLE OF BAPIPARAM1 ,
wa_parameter1  LIKE LINE OF it_parameter1,
ld_ref_user  TYPE BAPIREFUS ,
it_uclasssys  TYPE STANDARD TABLE OF BAPIUCLASSSYS ,
wa_uclasssys  LIKE LINE OF it_uclasssys,
ld_ref_userx  TYPE BAPIREFUSX ,
it_extidhead  TYPE STANDARD TABLE OF BAPIUSEXTIDHEAD ,
wa_extidhead  LIKE LINE OF it_extidhead,
ld_alias  TYPE BAPIALIAS ,
it_extidpart  TYPE STANDARD TABLE OF BAPIUSEXTIDPART ,
wa_extidpart  LIKE LINE OF it_extidpart,
ld_aliasx  TYPE BAPIALIASX ,
ld_groupsx  TYPE BAPIGROUPX ,
ld_uclass  TYPE BAPIUCLASS ,
ld_uclassx  TYPE BAPIUCLASSX ,
ld_extidsx  TYPE BAPIUSEXTIDX ,
ld_productive_pwd  TYPE BAPIFLAG-BAPIFLAG .


ld_username = some text here

"populate fields of struture and append to itab
append wa_parameter to it_parameter.
ld_logondata = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_return to it_return.
ld_logondatax = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_addtel to it_addtel.
ld_defaults = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_addfax to it_addfax.
ld_defaultsx = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_addttx to it_addttx.
ld_address = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_addtlx to it_addtlx.
ld_addressx = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_addsmtp to it_addsmtp.
ld_parameterx = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_addrml to it_addrml.
ld_company = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_addx400 to it_addx400.
ld_companyx = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_addrfc to it_addrfc.

"populate fields of struture and append to itab
append wa_addprt to it_addprt.
ld_snc = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_addssf to it_addssf.
ld_sncx = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_adduri to it_adduri.
ld_back_distribution = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_addpag to it_addpag.
ld_password = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_addcomrem to it_addcomrem.
ld_passwordx = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_groups to it_groups.
ld_addcomx = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_parameter1 to it_parameter1.
ld_ref_user = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_uclasssys to it_uclasssys.
ld_ref_userx = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_extidhead to it_extidhead.
ld_alias = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_extidpart to it_extidpart.
ld_aliasx = 'Check type of data required'.
ld_groupsx = 'Check type of data required'.
ld_uclass = 'Check type of data required'.
ld_uclassx = 'Check type of data required'.
ld_extidsx = 'Check type of data required'.

ld_productive_pwd = some text here

SAP Documentation for FM BAPI_USER_CHANGE


You can use this method to change the attributes of a user. The existing attributes are overwritten by the attributes transferred to ...See here for full SAP fm documentation

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name BAPI_USER_CHANGE or its description.