SAP BAPI_PERSDATAHK_GETDETAIL Function Module for Read personal data
BAPI_PERSDATAHK_GETDETAIL is a standard bapi persdatahk 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 persdatahk getdetail FM, simply by entering the name BAPI_PERSDATAHK_GETDETAIL into the relevant SAP transaction such as SE37 or SE38.
Function Group: PERS_HK
Program Name: SAPLPERS_HK
Main Program:
Appliation area: P
Release date: 05-Apr-2000
Mode(Normal, Remote etc): Remote-Enabled
Update:
Function BAPI_PERSDATAHK_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_PERSDATAHK_GETDETAIL'"Read personal data.
EXPORTING
EMPLOYEENUMBER = "Personnel number
SUBTYPE = "Subtype
OBJECTID = "Object ID
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 code
GENDER = "Gender key
DATEOFBIRTH = "Date of birth
BIRTHPLACE = "Birthplace
STATEOFBIRTH = "State
COUNTRYOFBIRTH = "Country of birth
MARITALSTATUS = "Marital status key
MARITALSTATUSSINCE = "Valid from date of current marital status
NUMBEROFCHILDREN = "Number of children
LANGUAGE = "Language key
LANGUAGE_ISO = "Language according to ISO 639
FORMOFADDRESS = "Form-of-address key
NATIONALITY = "Nationality
SECONDNATIONALITY = "Second nationality
THIRDNATIONALITY = "Third nationality
NAMEOFFORMOFADDRESS = "Form of address description
NAMEOFGENDER = "Sex
NAMEOFSTATEOFBIRTH = "Name of federal state
NAMEOFCOUNTRYOFBIRTH = "Birth place description
NAMEOFMARITALSTATUS = "Marital status description
NAMEOFLANGUAGE = "Name of language
NAMEOFNATIONALITY = "Nationality text
FIRSTNAME = "First name
NAMEOFSECONDNATIONALITY = "Second nationality description
NAMEOFTHIRDNATIONALITY = "Third nationality description
NAME_FORMAT_INDICATOR = "Name format indicator
MARRIAGENUMBER = "Marriage certificate number
LASTNAME = "Last name
NAMEATBIRTH = "Name at birth
KNOWNAS = "Known as
SECONDACADGRADE = "Second title
SURNAMEPREFIX = "Name affix
INITIALS = "Employee's initials
IMPORTING Parameters details for BAPI_PERSDATAHK_GETDETAIL
EMPLOYEENUMBER - Personnel number
Data type: BAPIP0002HK-EMPLOYEENOOptional: No
Call by Reference: No ( called with pass by value option)
SUBTYPE - Subtype
Data type: BAPIP0002HK-SUBTYPEOptional: No
Call by Reference: No ( called with pass by value option)
OBJECTID - Object ID
Data type: BAPIP0002HK-OBJECTIDOptional: No
Call by Reference: No ( called with pass by value option)
LOCKINDICATOR - Lock indicator for HR master record
Data type: BAPIP0002HK-LOCKINDICOptional: No
Call by Reference: No ( called with pass by value option)
VALIDITYBEGIN - Valid from date
Data type: BAPIP0002HK-VALIDBEGINOptional: No
Call by Reference: No ( called with pass by value option)
VALIDITYEND - Valid to date
Data type: BAPIP0002HK-VALIDENDOptional: No
Call by Reference: No ( called with pass by value option)
RECORDNUMBER - Number of infotype record
Data type: BAPIP0002HK-RECORDNROptional: No
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for BAPI_PERSDATAHK_GETDETAIL
RETURN - Structure for return code
Data type: BAPIRETURN1Optional: No
Call by Reference: No ( called with pass by value option)
GENDER - Gender key
Data type: BAPIP0002HK-GENDEROptional: No
Call by Reference: No ( called with pass by value option)
DATEOFBIRTH - Date of birth
Data type: BAPIP0002HK-DATEOFBIRTHOptional: No
Call by Reference: No ( called with pass by value option)
BIRTHPLACE - Birthplace
Data type: BAPIP0002HK-BIRTHPLACEOptional: No
Call by Reference: No ( called with pass by value option)
STATEOFBIRTH - State
Data type: BAPIP0002HK-STATEOFBIRTHOptional: No
Call by Reference: No ( called with pass by value option)
COUNTRYOFBIRTH - Country of birth
Data type: BAPIP0002HK-COUNTRYOFBIRTHOptional: No
Call by Reference: No ( called with pass by value option)
MARITALSTATUS - Marital status key
Data type: BAPIP0002HK-MARITALSTATUSOptional: No
Call by Reference: No ( called with pass by value option)
MARITALSTATUSSINCE - Valid from date of current marital status
Data type: BAPIP0002HK-MARITALSINCEOptional: No
Call by Reference: No ( called with pass by value option)
NUMBEROFCHILDREN - Number of children
Data type: BAPIP0002HK-NUMBEROFCHILDOptional: No
Call by Reference: No ( called with pass by value option)
LANGUAGE - Language key
Data type: BAPIP0002HK-LANGUAGEOptional: No
Call by Reference: No ( called with pass by value option)
LANGUAGE_ISO - Language according to ISO 639
Data type: BAPIP0002HK-LANGUAGE_ISOOptional: No
Call by Reference: No ( called with pass by value option)
FORMOFADDRESS - Form-of-address key
Data type: BAPIP0002HK-FORMOFADDRESSOptional: No
Call by Reference: No ( called with pass by value option)
NATIONALITY - Nationality
Data type: BAPIP0002HK-NATIONALITYOptional: No
Call by Reference: No ( called with pass by value option)
SECONDNATIONALITY - Second nationality
Data type: BAPIP0002HK-SECONDNATIOOptional: No
Call by Reference: No ( called with pass by value option)
THIRDNATIONALITY - Third nationality
Data type: BAPIP0002HK-THIRDNATIOOptional: No
Call by Reference: No ( called with pass by value option)
NAMEOFFORMOFADDRESS - Form of address description
Data type: BAPIP0002HK-NAMEFORMADDRESOptional: No
Call by Reference: No ( called with pass by value option)
NAMEOFGENDER - Sex
Data type: BAPIP0002HK-NAMEOFGENDEROptional: No
Call by Reference: No ( called with pass by value option)
NAMEOFSTATEOFBIRTH - Name of federal state
Data type: BAPIP0002HK-NAMESTATEBIRTHOptional: No
Call by Reference: No ( called with pass by value option)
NAMEOFCOUNTRYOFBIRTH - Birth place description
Data type: BAPIP0002HK-NAMEBIRCOUNTRYOptional: No
Call by Reference: No ( called with pass by value option)
NAMEOFMARITALSTATUS - Marital status description
Data type: BAPIP0002HK-NAMEMARITALOptional: No
Call by Reference: No ( called with pass by value option)
NAMEOFLANGUAGE - Name of language
Data type: BAPIP0002HK-NAMEOFLANGUAGEOptional: No
Call by Reference: No ( called with pass by value option)
NAMEOFNATIONALITY - Nationality text
Data type: BAPIP0002HK-NAMEOFNATIOOptional: No
Call by Reference: No ( called with pass by value option)
FIRSTNAME - First name
Data type: BAPIP0002HK-FIRSTNAMEOptional: No
Call by Reference: No ( called with pass by value option)
NAMEOFSECONDNATIONALITY - Second nationality description
Data type: BAPIP0002HK-NAMEOFNATIO2Optional: No
Call by Reference: No ( called with pass by value option)
NAMEOFTHIRDNATIONALITY - Third nationality description
Data type: BAPIP0002HK-NAMEOFNATIO3Optional: No
Call by Reference: No ( called with pass by value option)
NAME_FORMAT_INDICATOR - Name format indicator
Data type: BAPIP0002HK-NAMEFORMATINDIOptional: No
Call by Reference: No ( called with pass by value option)
MARRIAGENUMBER - Marriage certificate number
Data type: BAPIP0002HK-MARRIAGENUMBEROptional: No
Call by Reference: No ( called with pass by value option)
LASTNAME - Last name
Data type: BAPIP0002HK-LASTNAMEOptional: No
Call by Reference: No ( called with pass by value option)
NAMEATBIRTH - Name at birth
Data type: BAPIP0002HK-NAMEATBIRTHOptional: No
Call by Reference: No ( called with pass by value option)
KNOWNAS - Known as
Data type: BAPIP0002HK-KNOWNASOptional: No
Call by Reference: No ( called with pass by value option)
SECONDACADGRADE - Second title
Data type: BAPIP0002HK-SECONDTITLEOptional: No
Call by Reference: No ( called with pass by value option)
SURNAMEPREFIX - Name affix
Data type: BAPIP0002HK-SURNAMEPREFIXOptional: No
Call by Reference: No ( called with pass by value option)
INITIALS - Employee's initials
Data type: BAPIP0002HK-INITIALSOptional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for BAPI_PERSDATAHK_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 BAPIP0002HK-EMPLOYEENO, " | |||
lv_gender | TYPE BAPIP0002HK-GENDER, " | |||
lv_dateofbirth | TYPE BAPIP0002HK-DATEOFBIRTH, " | |||
lv_birthplace | TYPE BAPIP0002HK-BIRTHPLACE, " | |||
lv_stateofbirth | TYPE BAPIP0002HK-STATEOFBIRTH, " | |||
lv_countryofbirth | TYPE BAPIP0002HK-COUNTRYOFBIRTH, " | |||
lv_maritalstatus | TYPE BAPIP0002HK-MARITALSTATUS, " | |||
lv_maritalstatussince | TYPE BAPIP0002HK-MARITALSINCE, " | |||
lv_numberofchildren | TYPE BAPIP0002HK-NUMBEROFCHILD, " | |||
lv_language | TYPE BAPIP0002HK-LANGUAGE, " | |||
lv_language_iso | TYPE BAPIP0002HK-LANGUAGE_ISO, " | |||
lv_subtype | TYPE BAPIP0002HK-SUBTYPE, " | |||
lv_formofaddress | TYPE BAPIP0002HK-FORMOFADDRESS, " | |||
lv_nationality | TYPE BAPIP0002HK-NATIONALITY, " | |||
lv_secondnationality | TYPE BAPIP0002HK-SECONDNATIO, " | |||
lv_thirdnationality | TYPE BAPIP0002HK-THIRDNATIO, " | |||
lv_nameofformofaddress | TYPE BAPIP0002HK-NAMEFORMADDRES, " | |||
lv_nameofgender | TYPE BAPIP0002HK-NAMEOFGENDER, " | |||
lv_nameofstateofbirth | TYPE BAPIP0002HK-NAMESTATEBIRTH, " | |||
lv_nameofcountryofbirth | TYPE BAPIP0002HK-NAMEBIRCOUNTRY, " | |||
lv_nameofmaritalstatus | TYPE BAPIP0002HK-NAMEMARITAL, " | |||
lv_nameoflanguage | TYPE BAPIP0002HK-NAMEOFLANGUAGE, " | |||
lv_nameofnationality | TYPE BAPIP0002HK-NAMEOFNATIO, " | |||
lv_objectid | TYPE BAPIP0002HK-OBJECTID, " | |||
lv_firstname | TYPE BAPIP0002HK-FIRSTNAME, " | |||
lv_nameofsecondnationality | TYPE BAPIP0002HK-NAMEOFNATIO2, " | |||
lv_nameofthirdnationality | TYPE BAPIP0002HK-NAMEOFNATIO3, " | |||
lv_name_format_indicator | TYPE BAPIP0002HK-NAMEFORMATINDI, " | |||
lv_marriagenumber | TYPE BAPIP0002HK-MARRIAGENUMBER, " | |||
lv_lastname | TYPE BAPIP0002HK-LASTNAME, " | |||
lv_lockindicator | TYPE BAPIP0002HK-LOCKINDIC, " | |||
lv_nameatbirth | TYPE BAPIP0002HK-NAMEATBIRTH, " | |||
lv_validitybegin | TYPE BAPIP0002HK-VALIDBEGIN, " | |||
lv_knownas | TYPE BAPIP0002HK-KNOWNAS, " | |||
lv_validityend | TYPE BAPIP0002HK-VALIDEND, " | |||
lv_recordnumber | TYPE BAPIP0002HK-RECORDNR, " | |||
lv_secondacadgrade | TYPE BAPIP0002HK-SECONDTITLE, " | |||
lv_surnameprefix | TYPE BAPIP0002HK-SURNAMEPREFIX, " | |||
lv_initials | TYPE BAPIP0002HK-INITIALS. " |
  CALL FUNCTION 'BAPI_PERSDATAHK_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 | |
GENDER | = lv_gender | |
DATEOFBIRTH | = lv_dateofbirth | |
BIRTHPLACE | = lv_birthplace | |
STATEOFBIRTH | = lv_stateofbirth | |
COUNTRYOFBIRTH | = lv_countryofbirth | |
MARITALSTATUS | = lv_maritalstatus | |
MARITALSTATUSSINCE | = lv_maritalstatussince | |
NUMBEROFCHILDREN | = lv_numberofchildren | |
LANGUAGE | = lv_language | |
LANGUAGE_ISO | = lv_language_iso | |
FORMOFADDRESS | = lv_formofaddress | |
NATIONALITY | = lv_nationality | |
SECONDNATIONALITY | = lv_secondnationality | |
THIRDNATIONALITY | = lv_thirdnationality | |
NAMEOFFORMOFADDRESS | = lv_nameofformofaddress | |
NAMEOFGENDER | = lv_nameofgender | |
NAMEOFSTATEOFBIRTH | = lv_nameofstateofbirth | |
NAMEOFCOUNTRYOFBIRTH | = lv_nameofcountryofbirth | |
NAMEOFMARITALSTATUS | = lv_nameofmaritalstatus | |
NAMEOFLANGUAGE | = lv_nameoflanguage | |
NAMEOFNATIONALITY | = lv_nameofnationality | |
FIRSTNAME | = lv_firstname | |
NAMEOFSECONDNATIONALITY | = lv_nameofsecondnationality | |
NAMEOFTHIRDNATIONALITY | = lv_nameofthirdnationality | |
NAME_FORMAT_INDICATOR | = lv_name_format_indicator | |
MARRIAGENUMBER | = lv_marriagenumber | |
LASTNAME | = lv_lastname | |
NAMEATBIRTH | = lv_nameatbirth | |
KNOWNAS | = lv_knownas | |
SECONDACADGRADE | = lv_secondacadgrade | |
SURNAMEPREFIX | = lv_surnameprefix | |
INITIALS | = lv_initials | |
. " BAPI_PERSDATAHK_GETDETAIL |
ABAP code using 7.40 inline data declarations to call FM BAPI_PERSDATAHK_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 EMPLOYEENO FROM BAPIP0002HK INTO @DATA(ld_employeenumber). | ||||
"SELECT single GENDER FROM BAPIP0002HK INTO @DATA(ld_gender). | ||||
"SELECT single DATEOFBIRTH FROM BAPIP0002HK INTO @DATA(ld_dateofbirth). | ||||
"SELECT single BIRTHPLACE FROM BAPIP0002HK INTO @DATA(ld_birthplace). | ||||
"SELECT single STATEOFBIRTH FROM BAPIP0002HK INTO @DATA(ld_stateofbirth). | ||||
"SELECT single COUNTRYOFBIRTH FROM BAPIP0002HK INTO @DATA(ld_countryofbirth). | ||||
"SELECT single MARITALSTATUS FROM BAPIP0002HK INTO @DATA(ld_maritalstatus). | ||||
"SELECT single MARITALSINCE FROM BAPIP0002HK INTO @DATA(ld_maritalstatussince). | ||||
"SELECT single NUMBEROFCHILD FROM BAPIP0002HK INTO @DATA(ld_numberofchildren). | ||||
"SELECT single LANGUAGE FROM BAPIP0002HK INTO @DATA(ld_language). | ||||
"SELECT single LANGUAGE_ISO FROM BAPIP0002HK INTO @DATA(ld_language_iso). | ||||
"SELECT single SUBTYPE FROM BAPIP0002HK INTO @DATA(ld_subtype). | ||||
"SELECT single FORMOFADDRESS FROM BAPIP0002HK INTO @DATA(ld_formofaddress). | ||||
"SELECT single NATIONALITY FROM BAPIP0002HK INTO @DATA(ld_nationality). | ||||
"SELECT single SECONDNATIO FROM BAPIP0002HK INTO @DATA(ld_secondnationality). | ||||
"SELECT single THIRDNATIO FROM BAPIP0002HK INTO @DATA(ld_thirdnationality). | ||||
"SELECT single NAMEFORMADDRES FROM BAPIP0002HK INTO @DATA(ld_nameofformofaddress). | ||||
"SELECT single NAMEOFGENDER FROM BAPIP0002HK INTO @DATA(ld_nameofgender). | ||||
"SELECT single NAMESTATEBIRTH FROM BAPIP0002HK INTO @DATA(ld_nameofstateofbirth). | ||||
"SELECT single NAMEBIRCOUNTRY FROM BAPIP0002HK INTO @DATA(ld_nameofcountryofbirth). | ||||
"SELECT single NAMEMARITAL FROM BAPIP0002HK INTO @DATA(ld_nameofmaritalstatus). | ||||
"SELECT single NAMEOFLANGUAGE FROM BAPIP0002HK INTO @DATA(ld_nameoflanguage). | ||||
"SELECT single NAMEOFNATIO FROM BAPIP0002HK INTO @DATA(ld_nameofnationality). | ||||
"SELECT single OBJECTID FROM BAPIP0002HK INTO @DATA(ld_objectid). | ||||
"SELECT single FIRSTNAME FROM BAPIP0002HK INTO @DATA(ld_firstname). | ||||
"SELECT single NAMEOFNATIO2 FROM BAPIP0002HK INTO @DATA(ld_nameofsecondnationality). | ||||
"SELECT single NAMEOFNATIO3 FROM BAPIP0002HK INTO @DATA(ld_nameofthirdnationality). | ||||
"SELECT single NAMEFORMATINDI FROM BAPIP0002HK INTO @DATA(ld_name_format_indicator). | ||||
"SELECT single MARRIAGENUMBER FROM BAPIP0002HK INTO @DATA(ld_marriagenumber). | ||||
"SELECT single LASTNAME FROM BAPIP0002HK INTO @DATA(ld_lastname). | ||||
"SELECT single LOCKINDIC FROM BAPIP0002HK INTO @DATA(ld_lockindicator). | ||||
"SELECT single NAMEATBIRTH FROM BAPIP0002HK INTO @DATA(ld_nameatbirth). | ||||
"SELECT single VALIDBEGIN FROM BAPIP0002HK INTO @DATA(ld_validitybegin). | ||||
"SELECT single KNOWNAS FROM BAPIP0002HK INTO @DATA(ld_knownas). | ||||
"SELECT single VALIDEND FROM BAPIP0002HK INTO @DATA(ld_validityend). | ||||
"SELECT single RECORDNR FROM BAPIP0002HK INTO @DATA(ld_recordnumber). | ||||
"SELECT single SECONDTITLE FROM BAPIP0002HK INTO @DATA(ld_secondacadgrade). | ||||
"SELECT single SURNAMEPREFIX FROM BAPIP0002HK INTO @DATA(ld_surnameprefix). | ||||
"SELECT single INITIALS FROM BAPIP0002HK INTO @DATA(ld_initials). | ||||
Search for further information about these or an SAP related objects