SAP BAPI_PERSDATANL_GETDETAIL Function Module for Read Personal Data
BAPI_PERSDATANL_GETDETAIL is a standard bapi persdatanl getdetail SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Read Personal Data 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 persdatanl getdetail FM, simply by entering the name BAPI_PERSDATANL_GETDETAIL into the relevant SAP transaction such as SE37 or SE38.
Function Group: PERS_NL
Program Name: SAPLPERS_NL
Main Program:
Appliation area: P
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:
Function BAPI_PERSDATANL_GETDETAIL 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_PERSDATANL_GETDETAIL'"Read Personal Data.
EXPORTING
EMPLOYEENUMBER = "Personnel Number
SUBTYPE = "Subtype
OBJECTID = "Object Identification
LOCKINDICATOR = "Lock Indicator for HR Master Record
VALIDITYBEGIN = "Valid From Date
VALIDITYEND = "Valid To Date
RECORDNUMBER = "Number of Infotype Record
IMPORTING
RETURN = "Structure for Return Parameter
ACADEMICGRADE = "Title
SECONDACADGRADE = "Second Title
ARISTROCRATICTITLE = "Other Title
SURNAMEPREFIX = "Name Prefix
SECONDNAMEPREFIX = "Second Name Prefix
INITIALS = "Employee's Initials
GENDER = "Gender Key
DATEOFBIRTH = "Date of Birth
BIRTHPLACE = "Birthplace
STATEOFBIRTH = "Federal State
FORMOFADDRESS = "Form of Address Key
COUNTRYOFBIRTH = "Country of Birth
MARITALSTATUS = "Marital Status Key
MARITALSTATUSSINCE = "Valid From Date of Current Marital Status
NUMBEROFCHILDREN = "Number of Children
RELIGION = "Religious Denomination Key
LANGUAGE = "Language Key
LANGUAGE_ISO = "Language According to ISO 639
NATIONALITY = "Nationality
SECONDNATIONALITY = "Second Nationality
THIRDNATIONALITY = "Third Nationality
FIRSTNAME = "First Name (by which one is generally known)
IDNUMBER = "Personnel ID Number
NAMEOFFORMOFADDRESS = "Name of Form of Address
NAMEOFGENDER = "Name of Gender
NAMEOFSTATEOFBIRTH = "Name of Federal State of Birth
NAMEOFCOUNTRYOFBIRTH = "Name of Country of Birth
NAMEOFMARITALSTATUS = "Name of Marital Status
NAMEOFRELIGION = "Name of Religion
NAMEOFLANGUAGE = "Name of Language
NAMEOFNATIONALITY = "Name of Nationality
NAMEOFSECONDNATIONALITY = "Name of Second Nationality
LASTNAME = "Last Name
NAMEOFTHIRDNATIONALITY = "Name of Third Nationality
NAMEATBIRTH = "Name at Birth
SECONDNAME = "Second Name
MIDDLENAME = "Middle Name
FULLNAME = "Full Name Employee
KNOWNAS = "Known As
IMPORTING Parameters details for BAPI_PERSDATANL_GETDETAIL
EMPLOYEENUMBER - Personnel Number
Data type: BAPIP0002-PERNROptional: No
Call by Reference: No ( called with pass by value option)
SUBTYPE - Subtype
Data type: BAPIP0002-SUBTYOptional: No
Call by Reference: No ( called with pass by value option)
OBJECTID - Object Identification
Data type: BAPIP0002-OBJPSOptional: No
Call by Reference: No ( called with pass by value option)
LOCKINDICATOR - Lock Indicator for HR Master Record
Data type: BAPIP0002-SPRPSOptional: No
Call by Reference: No ( called with pass by value option)
VALIDITYBEGIN - Valid From Date
Data type: BAPIP0002-BEGDAOptional: No
Call by Reference: No ( called with pass by value option)
VALIDITYEND - Valid To Date
Data type: BAPIP0002-ENDDAOptional: No
Call by Reference: No ( called with pass by value option)
RECORDNUMBER - Number of Infotype Record
Data type: BAPIP0002-SEQNROptional: No
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for BAPI_PERSDATANL_GETDETAIL
RETURN - Structure for Return Parameter
Data type: BAPIRETURN1Optional: No
Call by Reference: No ( called with pass by value option)
ACADEMICGRADE - Title
Data type: BAPIP0002-TITELOptional: No
Call by Reference: No ( called with pass by value option)
SECONDACADGRADE - Second Title
Data type: BAPIP0002-TITL2Optional: No
Call by Reference: No ( called with pass by value option)
ARISTROCRATICTITLE - Other Title
Data type: BAPIP0002-NAMZUOptional: No
Call by Reference: No ( called with pass by value option)
SURNAMEPREFIX - Name Prefix
Data type: BAPIP0002-VORSWOptional: No
Call by Reference: No ( called with pass by value option)
SECONDNAMEPREFIX - Second Name Prefix
Data type: BAPIP0002-VORS2Optional: No
Call by Reference: No ( called with pass by value option)
INITIALS - Employee's Initials
Data type: BAPIP0002-INITSOptional: No
Call by Reference: No ( called with pass by value option)
GENDER - Gender Key
Data type: BAPIP0002-GESCHOptional: No
Call by Reference: No ( called with pass by value option)
DATEOFBIRTH - Date of Birth
Data type: BAPIP0002-GBDATOptional: No
Call by Reference: No ( called with pass by value option)
BIRTHPLACE - Birthplace
Data type: BAPIP0002-GBORTOptional: No
Call by Reference: No ( called with pass by value option)
STATEOFBIRTH - Federal State
Data type: BAPIP0002-GBDEPOptional: No
Call by Reference: No ( called with pass by value option)
FORMOFADDRESS - Form of Address Key
Data type: BAPIP0002-ANREDOptional: No
Call by Reference: No ( called with pass by value option)
COUNTRYOFBIRTH - Country of Birth
Data type: BAPIP0002-GBLNDOptional: No
Call by Reference: No ( called with pass by value option)
MARITALSTATUS - Marital Status Key
Data type: BAPIP0002-FAMSTOptional: No
Call by Reference: No ( called with pass by value option)
MARITALSTATUSSINCE - Valid From Date of Current Marital Status
Data type: BAPIP0002-FAMDTOptional: No
Call by Reference: No ( called with pass by value option)
NUMBEROFCHILDREN - Number of Children
Data type: BAPIP0002-ANZKDOptional: No
Call by Reference: No ( called with pass by value option)
RELIGION - Religious Denomination Key
Data type: BAPIP0002-KONFEOptional: No
Call by Reference: No ( called with pass by value option)
LANGUAGE - Language Key
Data type: BAPIP0002-SPRSLOptional: No
Call by Reference: No ( called with pass by value option)
LANGUAGE_ISO - Language According to ISO 639
Data type: BAPIP0002-SPRSL_ISOOptional: No
Call by Reference: No ( called with pass by value option)
NATIONALITY - Nationality
Data type: BAPIP0002-NATIOOptional: No
Call by Reference: No ( called with pass by value option)
SECONDNATIONALITY - Second Nationality
Data type: BAPIP0002-NATI2Optional: No
Call by Reference: No ( called with pass by value option)
THIRDNATIONALITY - Third Nationality
Data type: BAPIP0002-NATI3Optional: No
Call by Reference: No ( called with pass by value option)
FIRSTNAME - First Name (by which one is generally known)
Data type: BAPIP0002-VORNAOptional: No
Call by Reference: No ( called with pass by value option)
IDNUMBER - Personnel ID Number
Data type: BAPIP0002-PERIDOptional: No
Call by Reference: No ( called with pass by value option)
NAMEOFFORMOFADDRESS - Name of Form of Address
Data type: BAPIP0002-NAMEOFANREDOptional: No
Call by Reference: No ( called with pass by value option)
NAMEOFGENDER - Name of Gender
Data type: BAPIP0002-NAMEOFGESCHOptional: No
Call by Reference: No ( called with pass by value option)
NAMEOFSTATEOFBIRTH - Name of Federal State of Birth
Data type: BAPIP0002-NAMEOFGBDEPOptional: No
Call by Reference: No ( called with pass by value option)
NAMEOFCOUNTRYOFBIRTH - Name of Country of Birth
Data type: BAPIP0002-NAMEOFGBLNDOptional: No
Call by Reference: No ( called with pass by value option)
NAMEOFMARITALSTATUS - Name of Marital Status
Data type: BAPIP0002-NAMEOFFAMSTOptional: No
Call by Reference: No ( called with pass by value option)
NAMEOFRELIGION - Name of Religion
Data type: BAPIP0002-NAMEOFKONFEOptional: No
Call by Reference: No ( called with pass by value option)
NAMEOFLANGUAGE - Name of Language
Data type: BAPIP0002-NAMEOFSPRSLOptional: No
Call by Reference: No ( called with pass by value option)
NAMEOFNATIONALITY - Name of Nationality
Data type: BAPIP0002-NAMEOFNATIOOptional: No
Call by Reference: No ( called with pass by value option)
NAMEOFSECONDNATIONALITY - Name of Second Nationality
Data type: BAPIP0002-NAMEOFNATI2Optional: No
Call by Reference: No ( called with pass by value option)
LASTNAME - Last Name
Data type: BAPIP0002-NACHNOptional: No
Call by Reference: No ( called with pass by value option)
NAMEOFTHIRDNATIONALITY - Name of Third Nationality
Data type: BAPIP0002-NAMEOFNATI3Optional: No
Call by Reference: No ( called with pass by value option)
NAMEATBIRTH - Name at Birth
Data type: BAPIP0002-NAME2Optional: No
Call by Reference: No ( called with pass by value option)
SECONDNAME - Second Name
Data type: BAPIP0002-NACH2Optional: No
Call by Reference: No ( called with pass by value option)
MIDDLENAME - Middle Name
Data type: BAPIP0002-MIDNMOptional: No
Call by Reference: No ( called with pass by value option)
FULLNAME - Full Name Employee
Data type: BAPIP0002-CNAMEOptional: No
Call by Reference: No ( called with pass by value option)
KNOWNAS - Known As
Data type: BAPIP0002-RUFNMOptional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for BAPI_PERSDATANL_GETDETAIL 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_return | TYPE BAPIRETURN1, " | |||
lv_employeenumber | TYPE BAPIP0002-PERNR, " | |||
lv_academicgrade | TYPE BAPIP0002-TITEL, " | |||
lv_secondacadgrade | TYPE BAPIP0002-TITL2, " | |||
lv_aristrocratictitle | TYPE BAPIP0002-NAMZU, " | |||
lv_surnameprefix | TYPE BAPIP0002-VORSW, " | |||
lv_secondnameprefix | TYPE BAPIP0002-VORS2, " | |||
lv_initials | TYPE BAPIP0002-INITS, " | |||
lv_gender | TYPE BAPIP0002-GESCH, " | |||
lv_dateofbirth | TYPE BAPIP0002-GBDAT, " | |||
lv_birthplace | TYPE BAPIP0002-GBORT, " | |||
lv_stateofbirth | TYPE BAPIP0002-GBDEP, " | |||
lv_subtype | TYPE BAPIP0002-SUBTY, " | |||
lv_formofaddress | TYPE BAPIP0002-ANRED, " | |||
lv_countryofbirth | TYPE BAPIP0002-GBLND, " | |||
lv_maritalstatus | TYPE BAPIP0002-FAMST, " | |||
lv_maritalstatussince | TYPE BAPIP0002-FAMDT, " | |||
lv_numberofchildren | TYPE BAPIP0002-ANZKD, " | |||
lv_religion | TYPE BAPIP0002-KONFE, " | |||
lv_language | TYPE BAPIP0002-SPRSL, " | |||
lv_language_iso | TYPE BAPIP0002-SPRSL_ISO, " | |||
lv_nationality | TYPE BAPIP0002-NATIO, " | |||
lv_secondnationality | TYPE BAPIP0002-NATI2, " | |||
lv_thirdnationality | TYPE BAPIP0002-NATI3, " | |||
lv_objectid | TYPE BAPIP0002-OBJPS, " | |||
lv_firstname | TYPE BAPIP0002-VORNA, " | |||
lv_idnumber | TYPE BAPIP0002-PERID, " | |||
lv_nameofformofaddress | TYPE BAPIP0002-NAMEOFANRED, " | |||
lv_nameofgender | TYPE BAPIP0002-NAMEOFGESCH, " | |||
lv_nameofstateofbirth | TYPE BAPIP0002-NAMEOFGBDEP, " | |||
lv_nameofcountryofbirth | TYPE BAPIP0002-NAMEOFGBLND, " | |||
lv_nameofmaritalstatus | TYPE BAPIP0002-NAMEOFFAMST, " | |||
lv_nameofreligion | TYPE BAPIP0002-NAMEOFKONFE, " | |||
lv_nameoflanguage | TYPE BAPIP0002-NAMEOFSPRSL, " | |||
lv_nameofnationality | TYPE BAPIP0002-NAMEOFNATIO, " | |||
lv_nameofsecondnationality | TYPE BAPIP0002-NAMEOFNATI2, " | |||
lv_lastname | TYPE BAPIP0002-NACHN, " | |||
lv_lockindicator | TYPE BAPIP0002-SPRPS, " | |||
lv_nameofthirdnationality | TYPE BAPIP0002-NAMEOFNATI3, " | |||
lv_nameatbirth | TYPE BAPIP0002-NAME2, " | |||
lv_validitybegin | TYPE BAPIP0002-BEGDA, " | |||
lv_secondname | TYPE BAPIP0002-NACH2, " | |||
lv_validityend | TYPE BAPIP0002-ENDDA, " | |||
lv_middlename | TYPE BAPIP0002-MIDNM, " | |||
lv_recordnumber | TYPE BAPIP0002-SEQNR, " | |||
lv_fullname | TYPE BAPIP0002-CNAME, " | |||
lv_knownas | TYPE BAPIP0002-RUFNM. " |
  CALL FUNCTION 'BAPI_PERSDATANL_GETDETAIL' "Read Personal Data |
EXPORTING | ||
EMPLOYEENUMBER | = lv_employeenumber | |
SUBTYPE | = lv_subtype | |
OBJECTID | = lv_objectid | |
LOCKINDICATOR | = lv_lockindicator | |
VALIDITYBEGIN | = lv_validitybegin | |
VALIDITYEND | = lv_validityend | |
RECORDNUMBER | = lv_recordnumber | |
IMPORTING | ||
RETURN | = lv_return | |
ACADEMICGRADE | = lv_academicgrade | |
SECONDACADGRADE | = lv_secondacadgrade | |
ARISTROCRATICTITLE | = lv_aristrocratictitle | |
SURNAMEPREFIX | = lv_surnameprefix | |
SECONDNAMEPREFIX | = lv_secondnameprefix | |
INITIALS | = lv_initials | |
GENDER | = lv_gender | |
DATEOFBIRTH | = lv_dateofbirth | |
BIRTHPLACE | = lv_birthplace | |
STATEOFBIRTH | = lv_stateofbirth | |
FORMOFADDRESS | = lv_formofaddress | |
COUNTRYOFBIRTH | = lv_countryofbirth | |
MARITALSTATUS | = lv_maritalstatus | |
MARITALSTATUSSINCE | = lv_maritalstatussince | |
NUMBEROFCHILDREN | = lv_numberofchildren | |
RELIGION | = lv_religion | |
LANGUAGE | = lv_language | |
LANGUAGE_ISO | = lv_language_iso | |
NATIONALITY | = lv_nationality | |
SECONDNATIONALITY | = lv_secondnationality | |
THIRDNATIONALITY | = lv_thirdnationality | |
FIRSTNAME | = lv_firstname | |
IDNUMBER | = lv_idnumber | |
NAMEOFFORMOFADDRESS | = lv_nameofformofaddress | |
NAMEOFGENDER | = lv_nameofgender | |
NAMEOFSTATEOFBIRTH | = lv_nameofstateofbirth | |
NAMEOFCOUNTRYOFBIRTH | = lv_nameofcountryofbirth | |
NAMEOFMARITALSTATUS | = lv_nameofmaritalstatus | |
NAMEOFRELIGION | = lv_nameofreligion | |
NAMEOFLANGUAGE | = lv_nameoflanguage | |
NAMEOFNATIONALITY | = lv_nameofnationality | |
NAMEOFSECONDNATIONALITY | = lv_nameofsecondnationality | |
LASTNAME | = lv_lastname | |
NAMEOFTHIRDNATIONALITY | = lv_nameofthirdnationality | |
NAMEATBIRTH | = lv_nameatbirth | |
SECONDNAME | = lv_secondname | |
MIDDLENAME | = lv_middlename | |
FULLNAME | = lv_fullname | |
KNOWNAS | = lv_knownas | |
. " BAPI_PERSDATANL_GETDETAIL |
ABAP code using 7.40 inline data declarations to call FM BAPI_PERSDATANL_GETDETAIL
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 BAPIP0002 INTO @DATA(ld_employeenumber). | ||||
"SELECT single TITEL FROM BAPIP0002 INTO @DATA(ld_academicgrade). | ||||
"SELECT single TITL2 FROM BAPIP0002 INTO @DATA(ld_secondacadgrade). | ||||
"SELECT single NAMZU FROM BAPIP0002 INTO @DATA(ld_aristrocratictitle). | ||||
"SELECT single VORSW FROM BAPIP0002 INTO @DATA(ld_surnameprefix). | ||||
"SELECT single VORS2 FROM BAPIP0002 INTO @DATA(ld_secondnameprefix). | ||||
"SELECT single INITS FROM BAPIP0002 INTO @DATA(ld_initials). | ||||
"SELECT single GESCH FROM BAPIP0002 INTO @DATA(ld_gender). | ||||
"SELECT single GBDAT FROM BAPIP0002 INTO @DATA(ld_dateofbirth). | ||||
"SELECT single GBORT FROM BAPIP0002 INTO @DATA(ld_birthplace). | ||||
"SELECT single GBDEP FROM BAPIP0002 INTO @DATA(ld_stateofbirth). | ||||
"SELECT single SUBTY FROM BAPIP0002 INTO @DATA(ld_subtype). | ||||
"SELECT single ANRED FROM BAPIP0002 INTO @DATA(ld_formofaddress). | ||||
"SELECT single GBLND FROM BAPIP0002 INTO @DATA(ld_countryofbirth). | ||||
"SELECT single FAMST FROM BAPIP0002 INTO @DATA(ld_maritalstatus). | ||||
"SELECT single FAMDT FROM BAPIP0002 INTO @DATA(ld_maritalstatussince). | ||||
"SELECT single ANZKD FROM BAPIP0002 INTO @DATA(ld_numberofchildren). | ||||
"SELECT single KONFE FROM BAPIP0002 INTO @DATA(ld_religion). | ||||
"SELECT single SPRSL FROM BAPIP0002 INTO @DATA(ld_language). | ||||
"SELECT single SPRSL_ISO FROM BAPIP0002 INTO @DATA(ld_language_iso). | ||||
"SELECT single NATIO FROM BAPIP0002 INTO @DATA(ld_nationality). | ||||
"SELECT single NATI2 FROM BAPIP0002 INTO @DATA(ld_secondnationality). | ||||
"SELECT single NATI3 FROM BAPIP0002 INTO @DATA(ld_thirdnationality). | ||||
"SELECT single OBJPS FROM BAPIP0002 INTO @DATA(ld_objectid). | ||||
"SELECT single VORNA FROM BAPIP0002 INTO @DATA(ld_firstname). | ||||
"SELECT single PERID FROM BAPIP0002 INTO @DATA(ld_idnumber). | ||||
"SELECT single NAMEOFANRED FROM BAPIP0002 INTO @DATA(ld_nameofformofaddress). | ||||
"SELECT single NAMEOFGESCH FROM BAPIP0002 INTO @DATA(ld_nameofgender). | ||||
"SELECT single NAMEOFGBDEP FROM BAPIP0002 INTO @DATA(ld_nameofstateofbirth). | ||||
"SELECT single NAMEOFGBLND FROM BAPIP0002 INTO @DATA(ld_nameofcountryofbirth). | ||||
"SELECT single NAMEOFFAMST FROM BAPIP0002 INTO @DATA(ld_nameofmaritalstatus). | ||||
"SELECT single NAMEOFKONFE FROM BAPIP0002 INTO @DATA(ld_nameofreligion). | ||||
"SELECT single NAMEOFSPRSL FROM BAPIP0002 INTO @DATA(ld_nameoflanguage). | ||||
"SELECT single NAMEOFNATIO FROM BAPIP0002 INTO @DATA(ld_nameofnationality). | ||||
"SELECT single NAMEOFNATI2 FROM BAPIP0002 INTO @DATA(ld_nameofsecondnationality). | ||||
"SELECT single NACHN FROM BAPIP0002 INTO @DATA(ld_lastname). | ||||
"SELECT single SPRPS FROM BAPIP0002 INTO @DATA(ld_lockindicator). | ||||
"SELECT single NAMEOFNATI3 FROM BAPIP0002 INTO @DATA(ld_nameofthirdnationality). | ||||
"SELECT single NAME2 FROM BAPIP0002 INTO @DATA(ld_nameatbirth). | ||||
"SELECT single BEGDA FROM BAPIP0002 INTO @DATA(ld_validitybegin). | ||||
"SELECT single NACH2 FROM BAPIP0002 INTO @DATA(ld_secondname). | ||||
"SELECT single ENDDA FROM BAPIP0002 INTO @DATA(ld_validityend). | ||||
"SELECT single MIDNM FROM BAPIP0002 INTO @DATA(ld_middlename). | ||||
"SELECT single SEQNR FROM BAPIP0002 INTO @DATA(ld_recordnumber). | ||||
"SELECT single CNAME FROM BAPIP0002 INTO @DATA(ld_fullname). | ||||
"SELECT single RUFNM FROM BAPIP0002 INTO @DATA(ld_knownas). | ||||
Search for further information about these or an SAP related objects