SAP Function Modules

BAPI_FAMILYMY_GETDETAIL SAP Function module - Read family







BAPI_FAMILYMY_GETDETAIL is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name BAPI_FAMILYMY_GETDETAIL into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: PFAM_MY
Released Date: 31.01.2000
Processing type: Remote-Enabled
remote enabled module settings


Pattern for FM BAPI_FAMILYMY_GETDETAIL - BAPI FAMILYMY GETDETAIL





CALL FUNCTION 'BAPI_FAMILYMY_GETDETAIL' "Read family
  EXPORTING
    employeenumber =            " bapip0021-pernr  Personnel number
    subtype =                   " bapip0021-subty  Subtype
    objectid =                  " bapip0021-objps  Object identification
    lockindicator =             " bapip0021-sprps  Lock indicator for HR master record
    validitybegin =             " bapip0021-begda  Valid from date
    validityend =               " bapip0021-endda  Valid to date
    recordnumber =              " bapip0021-seqnr  Number of infotype record
  IMPORTING
    return =                    " bapireturn1   Structure for return code
    memberid =                  " bapip0021-objps  Child No.
    relationship =              " bapip0021-kdsvh  Relationship to child
    firstname =                 " bapip0021-favor  First name
    lastname =                  " bapip0021-fanam  Last name
    fullname =                  " bapip0021-fcnam  Complete name
    surnameprefix =             " bapip0021-fvrsw  Name affix
    maidenname =                " bapip0021-fgbna  Name at birth
    gender =                    " bapip0021-fasex  Gender key
    dateofbirth =               " bapip0021-fgbdt  Date of birth
    placeofbirth =              " bapip0021-fgbot  Birthplace
    landofbirth =               " bapip0021-fgbld  Country of birth
    nationality =               " bapip0021-fanat  Nationality
    membertype =                " bapip0021-famsa  Type of family record
    nameofmembertype =          " bapip0021-nameoffamsa  Family record type description
    nameofgender =              " bapip0021-nameofgesch  Sex
    nameoflandofbirth =         " bapip0021-nameofgblnd  Birth Country description
    nameofnationality =         " bapip0021-nameofnatio  Nationality text
    nameofschooltype =          " bapip0021my-nameofschooltype  Education Type Description
    relationtext =              " bapip0021my-relationtext  Relationship to child
    personalid =                " bapip0021my-icnum  IC number
    passportnumber =            " bapip0021my-pasnr  Passport number
    taxnumber =                 " bapip0021my-tnoee  Income tax number of employee (MY)
    taxoffice =                 " bapip0021my-stxof  Spouse tax office Malaysia
    referencenumber =           " bapip0021my-ebrnr  Reference personnel number of family member
    employmentstatus =          " bapip0021my-semps  Spouse employment status
    jobtitle =                  " bapip0021my-stltx  Job title
    employername =              " bapip0021my-spemr  Spouse employer
    nameformat =                " bapip0021-fknzn  Name format indicator for employee in a list
    schooltype =                " bapip0021-fasar  School type of family member
    birthcertificateid =        " bapip0021my-bthid  Birth certificate ID
    handicapped =               " bapip0021my-hanch  Child handicap status
    childcustody =              " bapip0021my-chcus  Child custody status
    maritalstatus =             " bapip0021my-marst  Marital status for income tax purpose (MY)
    street =                    " bapip0021my-stras  House number and street
    secondaddress =             " bapip0021my-locat  2nd address line
    thirdaddress =              " bapip0021my-ort02  District
    postalcode =                " bapip0021my-pstlz  Postal code
    city =                      " bapip0021my-ort01  City
    region =                    " bapip0021my-state  Region (State, Province, County)
    country =                   " bapip0021my-land1  Country key
    coname =                    " bapip0021my-name2  C/O name
    telephonenumber =           " bapip0021my-telnr  Telephone number
    commtype1 =                 " bapip0021my-com01  Communication type
    commnumber1 =               " bapip0021my-num01  Communications number
    commtype2 =                 " bapip0021my-com02  Communication type
    commnumber2 =               " bapip0021my-num02  Communications number
    commtype3 =                 " bapip0021my-com03  Communication type
    commnumber3 =               " bapip0021my-num03  Communications number
    commtype4 =                 " bapip0021my-com04  Communication type
    commnumber4 =               " bapip0021my-num04  Communications number
    nameofregion =              " bapip0021my-nameofregion  Description
    .  "  BAPI_FAMILYMY_GETDETAIL

ABAP code example for Function Module BAPI_FAMILYMY_GETDETAIL





The ABAP code below is a full code listing to execute function module BAPI_FAMILYMY_GETDETAIL including all data declarations. The code uses 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 original method of declaring data variables up front. 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).

DATA:
ld_return  TYPE BAPIRETURN1 ,
ld_memberid  TYPE BAPIP0021-OBJPS ,
ld_relationship  TYPE BAPIP0021-KDSVH ,
ld_firstname  TYPE BAPIP0021-FAVOR ,
ld_lastname  TYPE BAPIP0021-FANAM ,
ld_fullname  TYPE BAPIP0021-FCNAM ,
ld_surnameprefix  TYPE BAPIP0021-FVRSW ,
ld_maidenname  TYPE BAPIP0021-FGBNA ,
ld_gender  TYPE BAPIP0021-FASEX ,
ld_dateofbirth  TYPE BAPIP0021-FGBDT ,
ld_placeofbirth  TYPE BAPIP0021-FGBOT ,
ld_landofbirth  TYPE BAPIP0021-FGBLD ,
ld_nationality  TYPE BAPIP0021-FANAT ,
ld_membertype  TYPE BAPIP0021-FAMSA ,
ld_nameofmembertype  TYPE BAPIP0021-NAMEOFFAMSA ,
ld_nameofgender  TYPE BAPIP0021-NAMEOFGESCH ,
ld_nameoflandofbirth  TYPE BAPIP0021-NAMEOFGBLND ,
ld_nameofnationality  TYPE BAPIP0021-NAMEOFNATIO ,
ld_nameofschooltype  TYPE BAPIP0021MY-NAMEOFSCHOOLTYPE ,
ld_relationtext  TYPE BAPIP0021MY-RELATIONTEXT ,
ld_personalid  TYPE BAPIP0021MY-ICNUM ,
ld_passportnumber  TYPE BAPIP0021MY-PASNR ,
ld_taxnumber  TYPE BAPIP0021MY-TNOEE ,
ld_taxoffice  TYPE BAPIP0021MY-STXOF ,
ld_referencenumber  TYPE BAPIP0021MY-EBRNR ,
ld_employmentstatus  TYPE BAPIP0021MY-SEMPS ,
ld_jobtitle  TYPE BAPIP0021MY-STLTX ,
ld_employername  TYPE BAPIP0021MY-SPEMR ,
ld_nameformat  TYPE BAPIP0021-FKNZN ,
ld_schooltype  TYPE BAPIP0021-FASAR ,
ld_birthcertificateid  TYPE BAPIP0021MY-BTHID ,
ld_handicapped  TYPE BAPIP0021MY-HANCH ,
ld_childcustody  TYPE BAPIP0021MY-CHCUS ,
ld_maritalstatus  TYPE BAPIP0021MY-MARST ,
ld_street  TYPE BAPIP0021MY-STRAS ,
ld_secondaddress  TYPE BAPIP0021MY-LOCAT ,
ld_thirdaddress  TYPE BAPIP0021MY-ORT02 ,
ld_postalcode  TYPE BAPIP0021MY-PSTLZ ,
ld_city  TYPE BAPIP0021MY-ORT01 ,
ld_region  TYPE BAPIP0021MY-STATE ,
ld_country  TYPE BAPIP0021MY-LAND1 ,
ld_coname  TYPE BAPIP0021MY-NAME2 ,
ld_telephonenumber  TYPE BAPIP0021MY-TELNR ,
ld_commtype1  TYPE BAPIP0021MY-COM01 ,
ld_commnumber1  TYPE BAPIP0021MY-NUM01 ,
ld_commtype2  TYPE BAPIP0021MY-COM02 ,
ld_commnumber2  TYPE BAPIP0021MY-NUM02 ,
ld_commtype3  TYPE BAPIP0021MY-COM03 ,
ld_commnumber3  TYPE BAPIP0021MY-NUM03 ,
ld_commtype4  TYPE BAPIP0021MY-COM04 ,
ld_commnumber4  TYPE BAPIP0021MY-NUM04 ,
ld_nameofregion  TYPE BAPIP0021MY-NAMEOFREGION .


DATA(ld_employeenumber) = Check type of data required

DATA(ld_subtype) = some text here

DATA(ld_objectid) = some text here

DATA(ld_lockindicator) = some text here

DATA(ld_validitybegin) = 20210129

DATA(ld_validityend) = 20210129

DATA(ld_recordnumber) = Check type of data required . CALL FUNCTION 'BAPI_FAMILYMY_GETDETAIL' EXPORTING employeenumber = ld_employeenumber subtype = ld_subtype objectid = ld_objectid lockindicator = ld_lockindicator validitybegin = ld_validitybegin validityend = ld_validityend recordnumber = ld_recordnumber IMPORTING return = ld_return memberid = ld_memberid relationship = ld_relationship firstname = ld_firstname lastname = ld_lastname fullname = ld_fullname surnameprefix = ld_surnameprefix maidenname = ld_maidenname gender = ld_gender dateofbirth = ld_dateofbirth placeofbirth = ld_placeofbirth landofbirth = ld_landofbirth nationality = ld_nationality membertype = ld_membertype nameofmembertype = ld_nameofmembertype nameofgender = ld_nameofgender nameoflandofbirth = ld_nameoflandofbirth nameofnationality = ld_nameofnationality nameofschooltype = ld_nameofschooltype relationtext = ld_relationtext personalid = ld_personalid passportnumber = ld_passportnumber taxnumber = ld_taxnumber taxoffice = ld_taxoffice referencenumber = ld_referencenumber employmentstatus = ld_employmentstatus jobtitle = ld_jobtitle employername = ld_employername nameformat = ld_nameformat schooltype = ld_schooltype birthcertificateid = ld_birthcertificateid handicapped = ld_handicapped childcustody = ld_childcustody maritalstatus = ld_maritalstatus street = ld_street secondaddress = ld_secondaddress thirdaddress = ld_thirdaddress postalcode = ld_postalcode city = ld_city region = ld_region country = ld_country coname = ld_coname telephonenumber = ld_telephonenumber commtype1 = ld_commtype1 commnumber1 = ld_commnumber1 commtype2 = ld_commtype2 commnumber2 = ld_commnumber2 commtype3 = ld_commtype3 commnumber3 = ld_commnumber3 commtype4 = ld_commtype4 commnumber4 = ld_commnumber4 nameofregion = ld_nameofregion . " BAPI_FAMILYMY_GETDETAIL
IF SY-SUBRC EQ 0. "All OK ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_return  TYPE BAPIRETURN1 ,
ld_employeenumber  TYPE BAPIP0021-PERNR ,
ld_memberid  TYPE BAPIP0021-OBJPS ,
ld_subtype  TYPE BAPIP0021-SUBTY ,
ld_relationship  TYPE BAPIP0021-KDSVH ,
ld_objectid  TYPE BAPIP0021-OBJPS ,
ld_firstname  TYPE BAPIP0021-FAVOR ,
ld_lockindicator  TYPE BAPIP0021-SPRPS ,
ld_lastname  TYPE BAPIP0021-FANAM ,
ld_validitybegin  TYPE BAPIP0021-BEGDA ,
ld_fullname  TYPE BAPIP0021-FCNAM ,
ld_validityend  TYPE BAPIP0021-ENDDA ,
ld_surnameprefix  TYPE BAPIP0021-FVRSW ,
ld_recordnumber  TYPE BAPIP0021-SEQNR ,
ld_maidenname  TYPE BAPIP0021-FGBNA ,
ld_gender  TYPE BAPIP0021-FASEX ,
ld_dateofbirth  TYPE BAPIP0021-FGBDT ,
ld_placeofbirth  TYPE BAPIP0021-FGBOT ,
ld_landofbirth  TYPE BAPIP0021-FGBLD ,
ld_nationality  TYPE BAPIP0021-FANAT ,
ld_membertype  TYPE BAPIP0021-FAMSA ,
ld_nameofmembertype  TYPE BAPIP0021-NAMEOFFAMSA ,
ld_nameofgender  TYPE BAPIP0021-NAMEOFGESCH ,
ld_nameoflandofbirth  TYPE BAPIP0021-NAMEOFGBLND ,
ld_nameofnationality  TYPE BAPIP0021-NAMEOFNATIO ,
ld_nameofschooltype  TYPE BAPIP0021MY-NAMEOFSCHOOLTYPE ,
ld_relationtext  TYPE BAPIP0021MY-RELATIONTEXT ,
ld_personalid  TYPE BAPIP0021MY-ICNUM ,
ld_passportnumber  TYPE BAPIP0021MY-PASNR ,
ld_taxnumber  TYPE BAPIP0021MY-TNOEE ,
ld_taxoffice  TYPE BAPIP0021MY-STXOF ,
ld_referencenumber  TYPE BAPIP0021MY-EBRNR ,
ld_employmentstatus  TYPE BAPIP0021MY-SEMPS ,
ld_jobtitle  TYPE BAPIP0021MY-STLTX ,
ld_employername  TYPE BAPIP0021MY-SPEMR ,
ld_nameformat  TYPE BAPIP0021-FKNZN ,
ld_schooltype  TYPE BAPIP0021-FASAR ,
ld_birthcertificateid  TYPE BAPIP0021MY-BTHID ,
ld_handicapped  TYPE BAPIP0021MY-HANCH ,
ld_childcustody  TYPE BAPIP0021MY-CHCUS ,
ld_maritalstatus  TYPE BAPIP0021MY-MARST ,
ld_street  TYPE BAPIP0021MY-STRAS ,
ld_secondaddress  TYPE BAPIP0021MY-LOCAT ,
ld_thirdaddress  TYPE BAPIP0021MY-ORT02 ,
ld_postalcode  TYPE BAPIP0021MY-PSTLZ ,
ld_city  TYPE BAPIP0021MY-ORT01 ,
ld_region  TYPE BAPIP0021MY-STATE ,
ld_country  TYPE BAPIP0021MY-LAND1 ,
ld_coname  TYPE BAPIP0021MY-NAME2 ,
ld_telephonenumber  TYPE BAPIP0021MY-TELNR ,
ld_commtype1  TYPE BAPIP0021MY-COM01 ,
ld_commnumber1  TYPE BAPIP0021MY-NUM01 ,
ld_commtype2  TYPE BAPIP0021MY-COM02 ,
ld_commnumber2  TYPE BAPIP0021MY-NUM02 ,
ld_commtype3  TYPE BAPIP0021MY-COM03 ,
ld_commnumber3  TYPE BAPIP0021MY-NUM03 ,
ld_commtype4  TYPE BAPIP0021MY-COM04 ,
ld_commnumber4  TYPE BAPIP0021MY-NUM04 ,
ld_nameofregion  TYPE BAPIP0021MY-NAMEOFREGION .


ld_employeenumber = Check type of data required

ld_subtype = some text here

ld_objectid = some text here

ld_lockindicator = some text here

ld_validitybegin = 20210129

ld_validityend = 20210129

ld_recordnumber = Check type of data required

SAP Documentation for FM BAPI_FAMILYMY_GETDETAIL


You can use this method to read a Family/Related Person record (0021 0213). ...See here for full SAP fm documentation









Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name BAPI_FAMILYMY_GETDETAIL or its description.