SAP BAPI_PERSDATAMY_GETDETAIL Function Module for Read personal data
BAPI_PERSDATAMY_GETDETAIL is a standard bapi persdatamy 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 persdatamy getdetail FM, simply by entering the name BAPI_PERSDATAMY_GETDETAIL into the relevant SAP transaction such as SE37 or SE38.
Function Group: PERS_MY
Program Name: SAPLPERS_MY
Main Program:
Appliation area: P
Release date: 31-Jan-2000
Mode(Normal, Remote etc): Remote-Enabled
Update:
Function BAPI_PERSDATAMY_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_PERSDATAMY_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
ACADEMICGRADE = "Title
SECONDACADGRADE = "Second title
ARISTROCRATICTITLE = "Title
SURNAMEPREFIX = "Name affix
SECONDNAMEPREFIX = "Second name prefix
INITIALS = "Employee's initials
GENDER = "Gender key
BHUMIPUTERASTATUS = "Bhumiputera Status
DATEOFBIRTH = "Date of birth
BIRTHPLACE = "Birthplace
FORMOFADDRESS = "Form-of-address key
STATEOFBIRTH = "State
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
FIRSTNAME = "First name
THIRDNATIONALITY = "Third nationality
IDNUMBER = "Personal ID number
NAMEOFFORMOFADDRESS = "Form of address description
NAMEOFGENDER = "Sex
NAMEOFSTATEOFBIRTH = "Name of federal state
NAMEOFCOUNTRYOFBIRTH = "Birth place description
NAMEOFMARITALSTATUS = "Marital status description
NAMEOFRELIGION = "Religion
NAMEOFLANGUAGE = "Name of language
NAMEOFNATIONALITY = "Nationality text
LASTNAME = "Last name
NAMEOFSECONDNATIONALITY = "Second nationality description
NAMEOFTHIRDNATIONALITY = "Third nationality description
NAME_FORMAT_INDICATOR = "
NAMEATBIRTH = "Name at birth
SECONDNAME = "Second name
MIDDLENAME = "Middle name
FULLNAME = "Full employee name
KNOWNAS = "Known as
IMPORTING Parameters details for BAPI_PERSDATAMY_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 ID
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_PERSDATAMY_GETDETAIL
RETURN - Structure for return code
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 - Title
Data type: BAPIP0002-NAMZUOptional: No
Call by Reference: No ( called with pass by value option)
SURNAMEPREFIX - Name affix
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)
BHUMIPUTERASTATUS - Bhumiputera Status
Data type: BAPIP0002-NACONOptional: 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)
FORMOFADDRESS - Form-of-address key
Data type: BAPIP0002-ANREDOptional: No
Call by Reference: No ( called with pass by value option)
STATEOFBIRTH - State
Data type: BAPIP0002-GBDEPOptional: 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)
FIRSTNAME - First name
Data type: BAPIP0002-VORNAOptional: 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)
IDNUMBER - Personal ID number
Data type: BAPIP0002-PERIDOptional: No
Call by Reference: No ( called with pass by value option)
NAMEOFFORMOFADDRESS - Form of address description
Data type: BAPIP0002-NAMEOFANREDOptional: No
Call by Reference: No ( called with pass by value option)
NAMEOFGENDER - Sex
Data type: BAPIP0002-NAMEOFGESCHOptional: No
Call by Reference: No ( called with pass by value option)
NAMEOFSTATEOFBIRTH - Name of federal state
Data type: BAPIP0002-NAMEOFGBDEPOptional: No
Call by Reference: No ( called with pass by value option)
NAMEOFCOUNTRYOFBIRTH - Birth place description
Data type: BAPIP0002-NAMEOFGBLNDOptional: No
Call by Reference: No ( called with pass by value option)
NAMEOFMARITALSTATUS - Marital status description
Data type: BAPIP0002-NAMEOFFAMSTOptional: No
Call by Reference: No ( called with pass by value option)
NAMEOFRELIGION - 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 - Nationality text
Data type: BAPIP0002-NAMEOFNATIOOptional: 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)
NAMEOFSECONDNATIONALITY - Second nationality description
Data type: BAPIP0002-NAMEOFNATI2Optional: No
Call by Reference: No ( called with pass by value option)
NAMEOFTHIRDNATIONALITY - Third nationality description
Data type: BAPIP0002-NAMEOFNATI3Optional: No
Call by Reference: No ( called with pass by value option)
NAME_FORMAT_INDICATOR -
Data type: BAPIP0002-KNZNMOptional: 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 employee name
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_PERSDATAMY_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_bhumiputerastatus | TYPE BAPIP0002-NACON, " | |||
lv_dateofbirth | TYPE BAPIP0002-GBDAT, " | |||
lv_birthplace | TYPE BAPIP0002-GBORT, " | |||
lv_subtype | TYPE BAPIP0002-SUBTY, " | |||
lv_formofaddress | TYPE BAPIP0002-ANRED, " | |||
lv_stateofbirth | TYPE BAPIP0002-GBDEP, " | |||
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_objectid | TYPE BAPIP0002-OBJPS, " | |||
lv_firstname | TYPE BAPIP0002-VORNA, " | |||
lv_thirdnationality | TYPE BAPIP0002-NATI3, " | |||
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_lastname | TYPE BAPIP0002-NACHN, " | |||
lv_lockindicator | TYPE BAPIP0002-SPRPS, " | |||
lv_nameofsecondnationality | TYPE BAPIP0002-NAMEOFNATI2, " | |||
lv_nameofthirdnationality | TYPE BAPIP0002-NAMEOFNATI3, " | |||
lv_name_format_indicator | TYPE BAPIP0002-KNZNM, " | |||
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_PERSDATAMY_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 | |
BHUMIPUTERASTATUS | = lv_bhumiputerastatus | |
DATEOFBIRTH | = lv_dateofbirth | |
BIRTHPLACE | = lv_birthplace | |
FORMOFADDRESS | = lv_formofaddress | |
STATEOFBIRTH | = lv_stateofbirth | |
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 | |
FIRSTNAME | = lv_firstname | |
THIRDNATIONALITY | = lv_thirdnationality | |
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 | |
LASTNAME | = lv_lastname | |
NAMEOFSECONDNATIONALITY | = lv_nameofsecondnationality | |
NAMEOFTHIRDNATIONALITY | = lv_nameofthirdnationality | |
NAME_FORMAT_INDICATOR | = lv_name_format_indicator | |
NAMEATBIRTH | = lv_nameatbirth | |
SECONDNAME | = lv_secondname | |
MIDDLENAME | = lv_middlename | |
FULLNAME | = lv_fullname | |
KNOWNAS | = lv_knownas | |
. " BAPI_PERSDATAMY_GETDETAIL |
ABAP code using 7.40 inline data declarations to call FM BAPI_PERSDATAMY_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 NACON FROM BAPIP0002 INTO @DATA(ld_bhumiputerastatus). | ||||
"SELECT single GBDAT FROM BAPIP0002 INTO @DATA(ld_dateofbirth). | ||||
"SELECT single GBORT FROM BAPIP0002 INTO @DATA(ld_birthplace). | ||||
"SELECT single SUBTY FROM BAPIP0002 INTO @DATA(ld_subtype). | ||||
"SELECT single ANRED FROM BAPIP0002 INTO @DATA(ld_formofaddress). | ||||
"SELECT single GBDEP FROM BAPIP0002 INTO @DATA(ld_stateofbirth). | ||||
"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 OBJPS FROM BAPIP0002 INTO @DATA(ld_objectid). | ||||
"SELECT single VORNA FROM BAPIP0002 INTO @DATA(ld_firstname). | ||||
"SELECT single NATI3 FROM BAPIP0002 INTO @DATA(ld_thirdnationality). | ||||
"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 NACHN FROM BAPIP0002 INTO @DATA(ld_lastname). | ||||
"SELECT single SPRPS FROM BAPIP0002 INTO @DATA(ld_lockindicator). | ||||
"SELECT single NAMEOFNATI2 FROM BAPIP0002 INTO @DATA(ld_nameofsecondnationality). | ||||
"SELECT single NAMEOFNATI3 FROM BAPIP0002 INTO @DATA(ld_nameofthirdnationality). | ||||
"SELECT single KNZNM FROM BAPIP0002 INTO @DATA(ld_name_format_indicator). | ||||
"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