SAP HR_PERNR_USER_CREATE Function Module for









HR_PERNR_USER_CREATE is a standard hr pernr user create SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, 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 hr pernr user create FM, simply by entering the name HR_PERNR_USER_CREATE into the relevant SAP transaction such as SE37 or SE38.

Function Group: EHUS
Program Name: SAPLEHUS
Main Program: SAPLEHUS
Appliation area: H
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function HR_PERNR_USER_CREATE 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 'HR_PERNR_USER_CREATE'"
EXPORTING
PERSNR = "
* AGR_LOCAL = "
* UGROUP = 'ESSUSER' "
* COMPANY = "
* US_TZONE = "
* DEFAULTS = "
* COMMIT_FLG = 'X' "
* WITH_DIALOG = "
* UNAME = "
* PASSWORD = 'INIT' "
* SELDAT = SY-DATUM "
* PLVAR = "
* BIRTHDATE_AS_PW = "
* CALL_EXIT = "
* FORCE = "
* ACTGROUP = "

IMPORTING
NEW_USER = "

TABLES
* MESSAGETAB = "

EXCEPTIONS
PERNR_NOT_ACTIVE = 1 USER_NOT_CREATED = 2 ERROR_WITH_AUTH = 3 USER_NOT_RELATED = 4 USERGROUP_NOT_FOUND = 5 ACTION_ABORTED = 6 NO_AUTHORITY = 7
.




Customer Function user exits

Below is a list of CUSTOMER FUNCTION exit user exits that are available within this program and maybe relevant for this FM.
EXIT_SAPLEHUS_001 Enter Password/User ID for ESS User

IMPORTING Parameters details for HR_PERNR_USER_CREATE

PERSNR -

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

AGR_LOCAL -

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

UGROUP -

Data type: USGRP-USERGROUP
Default: 'ESSUSER'
Optional: Yes
Call by Reference: No ( called with pass by value option)

COMPANY -

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

US_TZONE -

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

DEFAULTS -

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

COMMIT_FLG -

Data type: FLAG
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

WITH_DIALOG -

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

UNAME -

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

PASSWORD -

Data type: BAPIPWD-BAPIPWD
Default: 'INIT'
Optional: Yes
Call by Reference: No ( called with pass by value option)

SELDAT -

Data type: DATS
Default: SY-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)

PLVAR -

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

BIRTHDATE_AS_PW -

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

CALL_EXIT -

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

FORCE -

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

ACTGROUP -

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

EXPORTING Parameters details for HR_PERNR_USER_CREATE

NEW_USER -

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

TABLES Parameters details for HR_PERNR_USER_CREATE

MESSAGETAB -

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

EXCEPTIONS details

PERNR_NOT_ACTIVE -

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

USER_NOT_CREATED -

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

ERROR_WITH_AUTH -

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

USER_NOT_RELATED -

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

USERGROUP_NOT_FOUND -

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

ACTION_ABORTED -

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

NO_AUTHORITY -

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

Copy and paste ABAP code example for HR_PERNR_USER_CREATE 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_persnr  TYPE P0000-PERNR, "   
lv_new_user  TYPE SY-UNAME, "   
lt_messagetab  TYPE STANDARD TABLE OF SPROT_U, "   
lv_pernr_not_active  TYPE SPROT_U, "   
lv_agr_local  TYPE FLAG, "   
lv_ugroup  TYPE USGRP-USERGROUP, "   'ESSUSER'
lv_company  TYPE USCOMPANY-COMPANY, "   
lv_us_tzone  TYPE TTZZ-TZONE, "   
lv_defaults  TYPE BAPIDEFAUL, "   
lv_commit_flg  TYPE FLAG, "   'X'
lv_with_dialog  TYPE FLAG, "   
lv_uname  TYPE SY-UNAME, "   
lv_user_not_created  TYPE SY, "   
lv_password  TYPE BAPIPWD-BAPIPWD, "   'INIT'
lv_error_with_auth  TYPE BAPIPWD, "   
lv_seldat  TYPE DATS, "   SY-DATUM
lv_user_not_related  TYPE DATS, "   
lv_plvar  TYPE OBJEC-PLVAR, "   
lv_usergroup_not_found  TYPE OBJEC, "   
lv_action_aborted  TYPE OBJEC, "   
lv_birthdate_as_pw  TYPE FLAG, "   
lv_call_exit  TYPE FLAG, "   
lv_no_authority  TYPE FLAG, "   
lv_force  TYPE FLAG, "   
lv_actgroup  TYPE AGR_DEFINE-AGR_NAME. "   

  CALL FUNCTION 'HR_PERNR_USER_CREATE'  "
    EXPORTING
         PERSNR = lv_persnr
         AGR_LOCAL = lv_agr_local
         UGROUP = lv_ugroup
         COMPANY = lv_company
         US_TZONE = lv_us_tzone
         DEFAULTS = lv_defaults
         COMMIT_FLG = lv_commit_flg
         WITH_DIALOG = lv_with_dialog
         UNAME = lv_uname
         PASSWORD = lv_password
         SELDAT = lv_seldat
         PLVAR = lv_plvar
         BIRTHDATE_AS_PW = lv_birthdate_as_pw
         CALL_EXIT = lv_call_exit
         FORCE = lv_force
         ACTGROUP = lv_actgroup
    IMPORTING
         NEW_USER = lv_new_user
    TABLES
         MESSAGETAB = lt_messagetab
    EXCEPTIONS
        PERNR_NOT_ACTIVE = 1
        USER_NOT_CREATED = 2
        ERROR_WITH_AUTH = 3
        USER_NOT_RELATED = 4
        USERGROUP_NOT_FOUND = 5
        ACTION_ABORTED = 6
        NO_AUTHORITY = 7
. " HR_PERNR_USER_CREATE




ABAP code using 7.40 inline data declarations to call FM HR_PERNR_USER_CREATE

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 PERNR FROM P0000 INTO @DATA(ld_persnr).
 
"SELECT single UNAME FROM SY INTO @DATA(ld_new_user).
 
 
 
 
"SELECT single USERGROUP FROM USGRP INTO @DATA(ld_ugroup).
DATA(ld_ugroup) = 'ESSUSER'.
 
"SELECT single COMPANY FROM USCOMPANY INTO @DATA(ld_company).
 
"SELECT single TZONE FROM TTZZ INTO @DATA(ld_us_tzone).
 
 
DATA(ld_commit_flg) = 'X'.
 
 
"SELECT single UNAME FROM SY INTO @DATA(ld_uname).
 
 
"SELECT single BAPIPWD FROM BAPIPWD INTO @DATA(ld_password).
DATA(ld_password) = 'INIT'.
 
 
DATA(ld_seldat) = SY-DATUM.
 
 
"SELECT single PLVAR FROM OBJEC INTO @DATA(ld_plvar).
 
 
 
 
 
 
 
"SELECT single AGR_NAME FROM AGR_DEFINE INTO @DATA(ld_actgroup).
 


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!