SAP BAPI_PERSDATAHK_CHANGE Function Module for Change personal data
BAPI_PERSDATAHK_CHANGE is a standard bapi persdatahk change SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Change 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 change FM, simply by entering the name BAPI_PERSDATAHK_CHANGE 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_CHANGE 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_CHANGE'"Change personal data.
EXPORTING
EMPLOYEENUMBER = "Personnel number
* LASTNAME = "Last name
* NAMEATBIRTH = "Name at birth
* KNOWNAS = "Known as
* SECONDACADGRADE = "Second title
* SURNAMEPREFIX = "Name affix
* INITIALS = "Employee's initials
* GENDER = "Gender key
* DATEOFBIRTH = "Date of birth
* BIRTHPLACE = "Birthplace
* STATEOFBIRTH = "State
SUBTYPE = "Subtype
* 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
* NATIONALITY = "Nationality
* SECONDNATIONALITY = "Second nationality
* THIRDNATIONALITY = "Third nationality
* NOCOMMIT = "COMMIT control at BAPI interface
OBJECTID = "Object ID
* NAME_FORMAT_INDICATOR = "Name format indicator
* MARRIAGENUMBER = "Marriage certificate number
LOCKINDICATOR = "Lock indicator for HR master record
VALIDITYBEGIN = "Valid from date
VALIDITYEND = "Valid to date
RECORDNUMBER = "Number of infotype record
* FORMOFADDRESS = "Form-of-address key
* FIRSTNAME = "First name
IMPORTING
RETURN = "Structure for return code
IMPORTING Parameters details for BAPI_PERSDATAHK_CHANGE
EMPLOYEENUMBER - Personnel number
Data type: BAPIP0002HK-EMPLOYEENOOptional: No
Call by Reference: No ( called with pass by value option)
LASTNAME - Last name
Data type: BAPIP0002HK-LASTNAMEOptional: Yes
Call by Reference: No ( called with pass by value option)
NAMEATBIRTH - Name at birth
Data type: BAPIP0002HK-NAMEATBIRTHOptional: Yes
Call by Reference: No ( called with pass by value option)
KNOWNAS - Known as
Data type: BAPIP0002HK-KNOWNASOptional: Yes
Call by Reference: No ( called with pass by value option)
SECONDACADGRADE - Second title
Data type: BAPIP0002HK-SECONDTITLEOptional: Yes
Call by Reference: No ( called with pass by value option)
SURNAMEPREFIX - Name affix
Data type: BAPIP0002HK-SURNAMEPREFIXOptional: Yes
Call by Reference: No ( called with pass by value option)
INITIALS - Employee's initials
Data type: BAPIP0002HK-INITIALSOptional: Yes
Call by Reference: No ( called with pass by value option)
GENDER - Gender key
Data type: BAPIP0002HK-GENDEROptional: Yes
Call by Reference: No ( called with pass by value option)
DATEOFBIRTH - Date of birth
Data type: BAPIP0002HK-DATEOFBIRTHOptional: Yes
Call by Reference: No ( called with pass by value option)
BIRTHPLACE - Birthplace
Data type: BAPIP0002HK-BIRTHPLACEOptional: Yes
Call by Reference: No ( called with pass by value option)
STATEOFBIRTH - State
Data type: BAPIP0002HK-STATEOFBIRTHOptional: Yes
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)
COUNTRYOFBIRTH - Country of birth
Data type: BAPIP0002HK-COUNTRYOFBIRTHOptional: Yes
Call by Reference: No ( called with pass by value option)
MARITALSTATUS - Marital status key
Data type: BAPIP0002HK-MARITALSTATUSOptional: Yes
Call by Reference: No ( called with pass by value option)
MARITALSTATUSSINCE - Valid from date of current marital status
Data type: BAPIP0002HK-MARITALSINCEOptional: Yes
Call by Reference: No ( called with pass by value option)
NUMBEROFCHILDREN - Number of children
Data type: BAPIP0002HK-NUMBEROFCHILDOptional: Yes
Call by Reference: No ( called with pass by value option)
LANGUAGE - Language key
Data type: BAPIP0002HK-LANGUAGEOptional: Yes
Call by Reference: No ( called with pass by value option)
LANGUAGE_ISO - Language according to ISO 639
Data type: BAPIP0002HK-LANGUAGE_ISOOptional: Yes
Call by Reference: No ( called with pass by value option)
NATIONALITY - Nationality
Data type: BAPIP0002HK-NATIONALITYOptional: Yes
Call by Reference: No ( called with pass by value option)
SECONDNATIONALITY - Second nationality
Data type: BAPIP0002HK-SECONDNATIOOptional: Yes
Call by Reference: No ( called with pass by value option)
THIRDNATIONALITY - Third nationality
Data type: BAPIP0002HK-THIRDNATIOOptional: Yes
Call by Reference: No ( called with pass by value option)
NOCOMMIT - COMMIT control at BAPI interface
Data type: BAPI_STAND-NO_COMMITOptional: Yes
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)
NAME_FORMAT_INDICATOR - Name format indicator
Data type: BAPIP0002HK-NAMEFORMATINDIOptional: Yes
Call by Reference: No ( called with pass by value option)
MARRIAGENUMBER - Marriage certificate number
Data type: BAPIP0002HK-MARRIAGENUMBEROptional: Yes
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)
FORMOFADDRESS - Form-of-address key
Data type: BAPIP0002HK-FORMOFADDRESSOptional: Yes
Call by Reference: No ( called with pass by value option)
FIRSTNAME - First name
Data type: BAPIP0002HK-FIRSTNAMEOptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for BAPI_PERSDATAHK_CHANGE
RETURN - Structure for return code
Data type: BAPIRETURN1Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for BAPI_PERSDATAHK_CHANGE 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_lastname | TYPE BAPIP0002HK-LASTNAME, " | |||
lv_nameatbirth | TYPE BAPIP0002HK-NAMEATBIRTH, " | |||
lv_knownas | TYPE BAPIP0002HK-KNOWNAS, " | |||
lv_secondacadgrade | TYPE BAPIP0002HK-SECONDTITLE, " | |||
lv_surnameprefix | TYPE BAPIP0002HK-SURNAMEPREFIX, " | |||
lv_initials | TYPE BAPIP0002HK-INITIALS, " | |||
lv_gender | TYPE BAPIP0002HK-GENDER, " | |||
lv_dateofbirth | TYPE BAPIP0002HK-DATEOFBIRTH, " | |||
lv_birthplace | TYPE BAPIP0002HK-BIRTHPLACE, " | |||
lv_stateofbirth | TYPE BAPIP0002HK-STATEOFBIRTH, " | |||
lv_subtype | TYPE BAPIP0002HK-SUBTYPE, " | |||
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_nationality | TYPE BAPIP0002HK-NATIONALITY, " | |||
lv_secondnationality | TYPE BAPIP0002HK-SECONDNATIO, " | |||
lv_thirdnationality | TYPE BAPIP0002HK-THIRDNATIO, " | |||
lv_nocommit | TYPE BAPI_STAND-NO_COMMIT, " | |||
lv_objectid | TYPE BAPIP0002HK-OBJECTID, " | |||
lv_name_format_indicator | TYPE BAPIP0002HK-NAMEFORMATINDI, " | |||
lv_marriagenumber | TYPE BAPIP0002HK-MARRIAGENUMBER, " | |||
lv_lockindicator | TYPE BAPIP0002HK-LOCKINDIC, " | |||
lv_validitybegin | TYPE BAPIP0002HK-VALIDBEGIN, " | |||
lv_validityend | TYPE BAPIP0002HK-VALIDEND, " | |||
lv_recordnumber | TYPE BAPIP0002HK-RECORDNR, " | |||
lv_formofaddress | TYPE BAPIP0002HK-FORMOFADDRESS, " | |||
lv_firstname | TYPE BAPIP0002HK-FIRSTNAME. " |
  CALL FUNCTION 'BAPI_PERSDATAHK_CHANGE' "Change personal data |
EXPORTING | ||
EMPLOYEENUMBER | = lv_employeenumber | |
LASTNAME | = lv_lastname | |
NAMEATBIRTH | = lv_nameatbirth | |
KNOWNAS | = lv_knownas | |
SECONDACADGRADE | = lv_secondacadgrade | |
SURNAMEPREFIX | = lv_surnameprefix | |
INITIALS | = lv_initials | |
GENDER | = lv_gender | |
DATEOFBIRTH | = lv_dateofbirth | |
BIRTHPLACE | = lv_birthplace | |
STATEOFBIRTH | = lv_stateofbirth | |
SUBTYPE | = lv_subtype | |
COUNTRYOFBIRTH | = lv_countryofbirth | |
MARITALSTATUS | = lv_maritalstatus | |
MARITALSTATUSSINCE | = lv_maritalstatussince | |
NUMBEROFCHILDREN | = lv_numberofchildren | |
LANGUAGE | = lv_language | |
LANGUAGE_ISO | = lv_language_iso | |
NATIONALITY | = lv_nationality | |
SECONDNATIONALITY | = lv_secondnationality | |
THIRDNATIONALITY | = lv_thirdnationality | |
NOCOMMIT | = lv_nocommit | |
OBJECTID | = lv_objectid | |
NAME_FORMAT_INDICATOR | = lv_name_format_indicator | |
MARRIAGENUMBER | = lv_marriagenumber | |
LOCKINDICATOR | = lv_lockindicator | |
VALIDITYBEGIN | = lv_validitybegin | |
VALIDITYEND | = lv_validityend | |
RECORDNUMBER | = lv_recordnumber | |
FORMOFADDRESS | = lv_formofaddress | |
FIRSTNAME | = lv_firstname | |
IMPORTING | ||
RETURN | = lv_return | |
. " BAPI_PERSDATAHK_CHANGE |
ABAP code using 7.40 inline data declarations to call FM BAPI_PERSDATAHK_CHANGE
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 LASTNAME FROM BAPIP0002HK INTO @DATA(ld_lastname). | ||||
"SELECT single NAMEATBIRTH FROM BAPIP0002HK INTO @DATA(ld_nameatbirth). | ||||
"SELECT single KNOWNAS FROM BAPIP0002HK INTO @DATA(ld_knownas). | ||||
"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). | ||||
"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 SUBTYPE FROM BAPIP0002HK INTO @DATA(ld_subtype). | ||||
"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 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 NO_COMMIT FROM BAPI_STAND INTO @DATA(ld_nocommit). | ||||
"SELECT single OBJECTID FROM BAPIP0002HK INTO @DATA(ld_objectid). | ||||
"SELECT single NAMEFORMATINDI FROM BAPIP0002HK INTO @DATA(ld_name_format_indicator). | ||||
"SELECT single MARRIAGENUMBER FROM BAPIP0002HK INTO @DATA(ld_marriagenumber). | ||||
"SELECT single LOCKINDIC FROM BAPIP0002HK INTO @DATA(ld_lockindicator). | ||||
"SELECT single VALIDBEGIN FROM BAPIP0002HK INTO @DATA(ld_validitybegin). | ||||
"SELECT single VALIDEND FROM BAPIP0002HK INTO @DATA(ld_validityend). | ||||
"SELECT single RECORDNR FROM BAPIP0002HK INTO @DATA(ld_recordnumber). | ||||
"SELECT single FORMOFADDRESS FROM BAPIP0002HK INTO @DATA(ld_formofaddress). | ||||
"SELECT single FIRSTNAME FROM BAPIP0002HK INTO @DATA(ld_firstname). | ||||
Search for further information about these or an SAP related objects