SAP BAPI_USER_CREATE1 Function Module for Create users









BAPI_USER_CREATE1 is a standard bapi user create1 SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Create users processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.


See here to view full function module documentation and code listing for bapi user create1 FM, simply by entering the name BAPI_USER_CREATE1 into the relevant SAP transaction such as SE37 or SE38.

Function Group: SU_USER
Program Name: SAPLSU_USER
Main Program: SAPLSU_USER
Appliation area: S
Release date: 10-Apr-2000
Mode(Normal, Remote etc): Remote-Enabled
Update:



Function BAPI_USER_CREATE1 pattern details

In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.
CALL FUNCTION 'BAPI_USER_CREATE1'"Create users
EXPORTING
USERNAME = "User Name
* ALIAS = "User Name Alias
* EX_ADDRESS = "do not use
* UCLASS = "License-Related User Classification
* FORCE_SYSTEM_ASSIGNMENT = "Always Perform System Assignment (Even if Called in the Central System)
* SELF_REGISTER = ' ' "Create for Self-Registration
* TECH_USER = "Technical User
* LOCK_LOCALLY = ' ' "Create User Locked
* NAME_IN = "User Name (Suggestion)
LOGONDATA = "Structure with Logon Data
PASSWORD = "Password
* DEFAULTS = "Structure with User Defaults
ADDRESS = "Address Data
* COMPANY = "Company for Company Address
* SNC = "Secure Network Communication data
* REF_USER = "Reference user for rights

TABLES
* PARAMETER = "Table with User Parameters
* ADDRFC = "
* ADDPRT = "
* ADDSSF = "
* ADDURI = "
* ADDPAG = "
* ADDCOMREM = "
* GROUPS = "Transfer Structure for a List of User Groups
* PARAMETER1 = "Replaces parameter (length 18 -> 40)
* EXTIDHEAD = "Header Data for External ID of a User
* EXTIDPART = "Part of a Long Field for the External ID of a User
* RETURN = "Return Structure
* ADDTEL = "
* ADDFAX = "
* ADDTTX = "
* ADDTLX = "
* ADDSMTP = "
* ADDRML = "
* ADDX400 = "
.



IMPORTING Parameters details for BAPI_USER_CREATE1

USERNAME - User Name

Data type: BAPIBNAME-BAPIBNAME
Optional: No
Call by Reference: No ( called with pass by value option)

ALIAS - User Name Alias

Data type: BAPIALIAS
Optional: Yes
Call by Reference: No ( called with pass by value option)

EX_ADDRESS - do not use

Data type: BAPIADDR3-PERS_NO
Optional: Yes
Call by Reference: No ( called with pass by value option)

UCLASS - License-Related User Classification

Data type: BAPIUCLASS
Optional: Yes
Call by Reference: No ( called with pass by value option)

FORCE_SYSTEM_ASSIGNMENT - Always Perform System Assignment (Even if Called in the Central System)

Data type: BAPIFLAG-BAPIFLAG
Optional: Yes
Call by Reference: No ( called with pass by value option)

SELF_REGISTER - Create for Self-Registration

Data type: BAPIFLAG-BAPIFLAG
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

TECH_USER - Technical User

Data type: BAPITECHUSER
Optional: Yes
Call by Reference: No ( called with pass by value option)

LOCK_LOCALLY - Create User Locked

Data type: BAPIUSLOCKX-BAPIUSLOCK
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

NAME_IN - User Name (Suggestion)

Data type: BAPIBNAME
Optional: Yes
Call by Reference: No ( called with pass by value option)

LOGONDATA - Structure with Logon Data

Data type: BAPILOGOND
Optional: No
Call by Reference: No ( called with pass by value option)

PASSWORD - Password

Data type: BAPIPWD
Optional: No
Call by Reference: No ( called with pass by value option)

DEFAULTS - Structure with User Defaults

Data type: BAPIDEFAUL
Optional: Yes
Call by Reference: No ( called with pass by value option)

ADDRESS - Address Data

Data type: BAPIADDR3
Optional: No
Call by Reference: No ( called with pass by value option)

COMPANY - Company for Company Address

Data type: BAPIUSCOMP
Optional: Yes
Call by Reference: No ( called with pass by value option)

SNC - Secure Network Communication data

Data type: BAPISNCU
Optional: Yes
Call by Reference: No ( called with pass by value option)

REF_USER - Reference user for rights

Data type: BAPIREFUS
Optional: Yes
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for BAPI_USER_CREATE1

PARAMETER - Table with User Parameters

Data type: BAPIPARAM
Optional: Yes
Call by Reference: No ( called with pass by value option)

ADDRFC -

Data type: BAPIADRFC
Optional: Yes
Call by Reference: No ( called with pass by value option)

ADDPRT -

Data type: BAPIADPRT
Optional: Yes
Call by Reference: No ( called with pass by value option)

ADDSSF -

Data type: BAPIADSSF
Optional: Yes
Call by Reference: No ( called with pass by value option)

ADDURI -

Data type: BAPIADURI
Optional: Yes
Call by Reference: No ( called with pass by value option)

ADDPAG -

Data type: BAPIADPAG
Optional: Yes
Call by Reference: No ( called with pass by value option)

ADDCOMREM -

Data type: BAPICOMREM
Optional: Yes
Call by Reference: No ( called with pass by value option)

GROUPS - Transfer Structure for a List of User Groups

Data type: BAPIGROUPS
Optional: Yes
Call by Reference: Yes

PARAMETER1 - Replaces parameter (length 18 -> 40)

Data type: BAPIPARAM1
Optional: Yes
Call by Reference: Yes

EXTIDHEAD - Header Data for External ID of a User

Data type: BAPIUSEXTIDHEAD
Optional: Yes
Call by Reference: Yes

EXTIDPART - Part of a Long Field for the External ID of a User

Data type: BAPIUSEXTIDPART
Optional: Yes
Call by Reference: Yes

RETURN - Return Structure

Data type: BAPIRET2
Optional: Yes
Call by Reference: Yes

ADDTEL -

Data type: BAPIADTEL
Optional: Yes
Call by Reference: No ( called with pass by value option)

ADDFAX -

Data type: BAPIADFAX
Optional: Yes
Call by Reference: No ( called with pass by value option)

ADDTTX -

Data type: BAPIADTTX
Optional: Yes
Call by Reference: No ( called with pass by value option)

ADDTLX -

Data type: BAPIADTLX
Optional: Yes
Call by Reference: No ( called with pass by value option)

ADDSMTP -

Data type: BAPIADSMTP
Optional: Yes
Call by Reference: No ( called with pass by value option)

ADDRML -

Data type: BAPIADRML
Optional: Yes
Call by Reference: No ( called with pass by value option)

ADDX400 -

Data type: BAPIADX400
Optional: Yes
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for BAPI_USER_CREATE1 Function Module

The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than 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 newer method of declaring data variables on the fly. 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), which i why i have stuck to the origianl for this example.

DATA:
lv_username  TYPE BAPIBNAME-BAPIBNAME, "   
lt_parameter  TYPE STANDARD TABLE OF BAPIPARAM, "   
lv_alias  TYPE BAPIALIAS, "   
lt_addrfc  TYPE STANDARD TABLE OF BAPIADRFC, "   
lt_addprt  TYPE STANDARD TABLE OF BAPIADPRT, "   
lv_ex_address  TYPE BAPIADDR3-PERS_NO, "   
lt_addssf  TYPE STANDARD TABLE OF BAPIADSSF, "   
lv_uclass  TYPE BAPIUCLASS, "   
lt_adduri  TYPE STANDARD TABLE OF BAPIADURI, "   
lv_force_system_assignment  TYPE BAPIFLAG-BAPIFLAG, "   
lt_addpag  TYPE STANDARD TABLE OF BAPIADPAG, "   
lv_self_register  TYPE BAPIFLAG-BAPIFLAG, "   SPACE
lt_addcomrem  TYPE STANDARD TABLE OF BAPICOMREM, "   
lv_tech_user  TYPE BAPITECHUSER, "   
lt_groups  TYPE STANDARD TABLE OF BAPIGROUPS, "   
lv_lock_locally  TYPE BAPIUSLOCKX-BAPIUSLOCK, "   SPACE
lt_parameter1  TYPE STANDARD TABLE OF BAPIPARAM1, "   
lt_extidhead  TYPE STANDARD TABLE OF BAPIUSEXTIDHEAD, "   
lt_extidpart  TYPE STANDARD TABLE OF BAPIUSEXTIDPART, "   
lt_return  TYPE STANDARD TABLE OF BAPIRET2, "   
lv_name_in  TYPE BAPIBNAME, "   
lt_addtel  TYPE STANDARD TABLE OF BAPIADTEL, "   
lv_logondata  TYPE BAPILOGOND, "   
lt_addfax  TYPE STANDARD TABLE OF BAPIADFAX, "   
lv_password  TYPE BAPIPWD, "   
lt_addttx  TYPE STANDARD TABLE OF BAPIADTTX, "   
lv_defaults  TYPE BAPIDEFAUL, "   
lt_addtlx  TYPE STANDARD TABLE OF BAPIADTLX, "   
lv_address  TYPE BAPIADDR3, "   
lt_addsmtp  TYPE STANDARD TABLE OF BAPIADSMTP, "   
lv_company  TYPE BAPIUSCOMP, "   
lv_snc  TYPE BAPISNCU, "   
lt_addrml  TYPE STANDARD TABLE OF BAPIADRML, "   
lt_addx400  TYPE STANDARD TABLE OF BAPIADX400, "   
lv_ref_user  TYPE BAPIREFUS. "   

  CALL FUNCTION 'BAPI_USER_CREATE1'  "Create users
    EXPORTING
         USERNAME = lv_username
         ALIAS = lv_alias
         EX_ADDRESS = lv_ex_address
         UCLASS = lv_uclass
         FORCE_SYSTEM_ASSIGNMENT = lv_force_system_assignment
         SELF_REGISTER = lv_self_register
         TECH_USER = lv_tech_user
         LOCK_LOCALLY = lv_lock_locally
         NAME_IN = lv_name_in
         LOGONDATA = lv_logondata
         PASSWORD = lv_password
         DEFAULTS = lv_defaults
         ADDRESS = lv_address
         COMPANY = lv_company
         SNC = lv_snc
         REF_USER = lv_ref_user
    TABLES
         PARAMETER = lt_parameter
         ADDRFC = lt_addrfc
         ADDPRT = lt_addprt
         ADDSSF = lt_addssf
         ADDURI = lt_adduri
         ADDPAG = lt_addpag
         ADDCOMREM = lt_addcomrem
         GROUPS = lt_groups
         PARAMETER1 = lt_parameter1
         EXTIDHEAD = lt_extidhead
         EXTIDPART = lt_extidpart
         RETURN = lt_return
         ADDTEL = lt_addtel
         ADDFAX = lt_addfax
         ADDTTX = lt_addttx
         ADDTLX = lt_addtlx
         ADDSMTP = lt_addsmtp
         ADDRML = lt_addrml
         ADDX400 = lt_addx400
. " BAPI_USER_CREATE1




ABAP code using 7.40 inline data declarations to call FM BAPI_USER_CREATE1

The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.

"SELECT single BAPIBNAME FROM BAPIBNAME INTO @DATA(ld_username).
 
 
 
 
 
"SELECT single PERS_NO FROM BAPIADDR3 INTO @DATA(ld_ex_address).
 
 
 
 
"SELECT single BAPIFLAG FROM BAPIFLAG INTO @DATA(ld_force_system_assignment).
 
 
"SELECT single BAPIFLAG FROM BAPIFLAG INTO @DATA(ld_self_register).
DATA(ld_self_register) = ' '.
 
 
 
 
"SELECT single BAPIUSLOCK FROM BAPIUSLOCKX INTO @DATA(ld_lock_locally).
DATA(ld_lock_locally) = ' '.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!