SAP BAPI_FAMILYTH_CHANGE Function Module for Family TH: Change record
BAPI_FAMILYTH_CHANGE is a standard bapi familyth 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 Family TH: Change record 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 familyth change FM, simply by entering the name BAPI_FAMILYTH_CHANGE into the relevant SAP transaction such as SE37 or SE38.
Function Group: PFAM_TH
Program Name: SAPLPFAM_TH
Main Program:
Appliation area: P
Release date: 01-Feb-2000
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function BAPI_FAMILYTH_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_FAMILYTH_CHANGE'"Family TH: Change record.
EXPORTING
EMPLOYEENUMBER = "Personnel Number
* LASTNAME = "Last name
* FIRSTNAME = "First name
* FORMOFADDRESS = "Form-of-address key
* OTHERTITLE = "Other Title
* DATEOFBIRTH = "Date of birth
* COUNTRYOFBIRTH = "Country of birth
* GENDER = "Gender key
* PHONENUMBER = "Telephone number
* NATIONALITY = "Nationality
* SECONDNATIONALITY = "Second nationality
SUBTYPE = "Subtype
* THIRDNATIONALITY = "Third nationality
* BIRTHPLACE = "Birthplace
* POSTALCODE = "Postal code
* COUNTRY = "Country key
* COMMUNICATIONTYPE01 = "Communication type
* COMMUNICATIONNUMBER01 = "Communications number
* COMMUNICATIONTYPE02 = "Communication type
* COMMUNICATIONNUMBER02 = "Communications number
* COMMUNICATIONTYPE03 = "Communication type
* COMMUNICATIONNUMBER03 = "Communications number
OBJECTID = "Object identification
* COMMUNICATIONTYPE04 = "Communication type
* COMMUNICATIONNUMBER04 = "Communications number
* ALIVEDECEASED = "Alive/Deceased
* JOBTITLE = "Job title
* EMPLOYEROFFAMILYMEMBER = "Employer of Family Member (TH)
* ADDRESSNUMBERSOITROK = "Address Number, Soi Trok (TH)
* STREETTHAMBOL = "Street/Road, Tambol
* CITY = "Province/City (TH)
* DISTRICT = "District (TH)
* NOCOMMIT = "COMMIT control at BAPI interface
LOCKINDICATOR = "Lock indicator for HR master record
VALIDITYBEGIN = "Start date
VALIDITYEND = "End Date
RECORDNUMBER = "Number of infotype record with same key
* MEMBERTYPE = "Type of family record
* NAMEOFSUBTYPE = "Name of subtype
IMPORTING
RETURN = "Return messages
IMPORTING Parameters details for BAPI_FAMILYTH_CHANGE
EMPLOYEENUMBER - Personnel Number
Data type: BAPIP0021-PERNROptional: No
Call by Reference: No ( called with pass by value option)
LASTNAME - Last name
Data type: BAPIP0021-FANAMOptional: Yes
Call by Reference: No ( called with pass by value option)
FIRSTNAME - First name
Data type: BAPIP0021-FAVOROptional: Yes
Call by Reference: No ( called with pass by value option)
FORMOFADDRESS - Form-of-address key
Data type: BAPIP0021TH-FORMOFADDRESSOptional: Yes
Call by Reference: No ( called with pass by value option)
OTHERTITLE - Other Title
Data type: BAPIP0021-FNMZUOptional: Yes
Call by Reference: No ( called with pass by value option)
DATEOFBIRTH - Date of birth
Data type: BAPIP0021-FGBDTOptional: Yes
Call by Reference: No ( called with pass by value option)
COUNTRYOFBIRTH - Country of birth
Data type: BAPIP0021-FGBLDOptional: Yes
Call by Reference: No ( called with pass by value option)
GENDER - Gender key
Data type: BAPIP0021-FASEXOptional: Yes
Call by Reference: No ( called with pass by value option)
PHONENUMBER - Telephone number
Data type: BAPIP0021TH-PHONENUMBEROptional: Yes
Call by Reference: No ( called with pass by value option)
NATIONALITY - Nationality
Data type: BAPIP0021-FANATOptional: Yes
Call by Reference: No ( called with pass by value option)
SECONDNATIONALITY - Second nationality
Data type: BAPIP0021-FANA2Optional: Yes
Call by Reference: No ( called with pass by value option)
SUBTYPE - Subtype
Data type: BAPIP0021-SUBTYOptional: No
Call by Reference: No ( called with pass by value option)
THIRDNATIONALITY - Third nationality
Data type: BAPIP0021-FANA3Optional: Yes
Call by Reference: No ( called with pass by value option)
BIRTHPLACE - Birthplace
Data type: BAPIP0021-FGBOTOptional: Yes
Call by Reference: No ( called with pass by value option)
POSTALCODE - Postal code
Data type: BAPIP0021TH-POSTALCODEOptional: Yes
Call by Reference: No ( called with pass by value option)
COUNTRY - Country key
Data type: BAPIP0021TH-COUNTRYOptional: Yes
Call by Reference: No ( called with pass by value option)
COMMUNICATIONTYPE01 - Communication type
Data type: BAPIP0021TH-COMMUNICATIONTYPE01Optional: Yes
Call by Reference: No ( called with pass by value option)
COMMUNICATIONNUMBER01 - Communications number
Data type: BAPIP0021TH-COMMUNICATIONNUMBER01Optional: Yes
Call by Reference: No ( called with pass by value option)
COMMUNICATIONTYPE02 - Communication type
Data type: BAPIP0021TH-COMMUNICATIONTYPE02Optional: Yes
Call by Reference: No ( called with pass by value option)
COMMUNICATIONNUMBER02 - Communications number
Data type: BAPIP0021TH-COMMUNICATIONNUMBER02Optional: Yes
Call by Reference: No ( called with pass by value option)
COMMUNICATIONTYPE03 - Communication type
Data type: BAPIP0021TH-COMMUNICATIONTYPE03Optional: Yes
Call by Reference: No ( called with pass by value option)
COMMUNICATIONNUMBER03 - Communications number
Data type: BAPIP0021TH-COMMUNICATIONNUMBER03Optional: Yes
Call by Reference: No ( called with pass by value option)
OBJECTID - Object identification
Data type: BAPIP0021-OBJPSOptional: No
Call by Reference: No ( called with pass by value option)
COMMUNICATIONTYPE04 - Communication type
Data type: BAPIP0021TH-COMMUNICATIONTYPE04Optional: Yes
Call by Reference: No ( called with pass by value option)
COMMUNICATIONNUMBER04 - Communications number
Data type: BAPIP0021TH-COMMUNICATIONNUMBER04Optional: Yes
Call by Reference: No ( called with pass by value option)
ALIVEDECEASED - Alive/Deceased
Data type: BAPIP0021TH-ALIVEDECEASEDOptional: Yes
Call by Reference: No ( called with pass by value option)
JOBTITLE - Job title
Data type: BAPIP0021TH-JOBTITLEOptional: Yes
Call by Reference: No ( called with pass by value option)
EMPLOYEROFFAMILYMEMBER - Employer of Family Member (TH)
Data type: BAPIP0021TH-EMPLOYEROFFAMILYMEMBEROptional: Yes
Call by Reference: No ( called with pass by value option)
ADDRESSNUMBERSOITROK - Address Number, Soi Trok (TH)
Data type: BAPIP0021TH-ADDRESSNUMBERSOITROKOptional: Yes
Call by Reference: No ( called with pass by value option)
STREETTHAMBOL - Street/Road, Tambol
Data type: BAPIP0021TH-STREETTHAMBOLOptional: Yes
Call by Reference: No ( called with pass by value option)
CITY - Province/City (TH)
Data type: BAPIP0021TH-CITYOptional: Yes
Call by Reference: No ( called with pass by value option)
DISTRICT - District (TH)
Data type: BAPIP0021TH-DISTRICTOptional: 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)
LOCKINDICATOR - Lock indicator for HR master record
Data type: BAPIP0021-SPRPSOptional: No
Call by Reference: No ( called with pass by value option)
VALIDITYBEGIN - Start date
Data type: BAPIP0021-BEGDAOptional: No
Call by Reference: No ( called with pass by value option)
VALIDITYEND - End Date
Data type: BAPIP0021-ENDDAOptional: No
Call by Reference: No ( called with pass by value option)
RECORDNUMBER - Number of infotype record with same key
Data type: BAPIP0021-SEQNROptional: No
Call by Reference: No ( called with pass by value option)
MEMBERTYPE - Type of family record
Data type: BAPIP0021-FAMSAOptional: Yes
Call by Reference: No ( called with pass by value option)
NAMEOFSUBTYPE - Name of subtype
Data type: BAPIP0021TH-NAMEOFSUBTYPEOptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for BAPI_FAMILYTH_CHANGE
RETURN - Return messages
Data type: BAPIRETURN1Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for BAPI_FAMILYTH_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 BAPIP0021-PERNR, " | |||
| lv_lastname | TYPE BAPIP0021-FANAM, " | |||
| lv_firstname | TYPE BAPIP0021-FAVOR, " | |||
| lv_formofaddress | TYPE BAPIP0021TH-FORMOFADDRESS, " | |||
| lv_othertitle | TYPE BAPIP0021-FNMZU, " | |||
| lv_dateofbirth | TYPE BAPIP0021-FGBDT, " | |||
| lv_countryofbirth | TYPE BAPIP0021-FGBLD, " | |||
| lv_gender | TYPE BAPIP0021-FASEX, " | |||
| lv_phonenumber | TYPE BAPIP0021TH-PHONENUMBER, " | |||
| lv_nationality | TYPE BAPIP0021-FANAT, " | |||
| lv_secondnationality | TYPE BAPIP0021-FANA2, " | |||
| lv_subtype | TYPE BAPIP0021-SUBTY, " | |||
| lv_thirdnationality | TYPE BAPIP0021-FANA3, " | |||
| lv_birthplace | TYPE BAPIP0021-FGBOT, " | |||
| lv_postalcode | TYPE BAPIP0021TH-POSTALCODE, " | |||
| lv_country | TYPE BAPIP0021TH-COUNTRY, " | |||
| lv_communicationtype01 | TYPE BAPIP0021TH-COMMUNICATIONTYPE01, " | |||
| lv_communicationnumber01 | TYPE BAPIP0021TH-COMMUNICATIONNUMBER01, " | |||
| lv_communicationtype02 | TYPE BAPIP0021TH-COMMUNICATIONTYPE02, " | |||
| lv_communicationnumber02 | TYPE BAPIP0021TH-COMMUNICATIONNUMBER02, " | |||
| lv_communicationtype03 | TYPE BAPIP0021TH-COMMUNICATIONTYPE03, " | |||
| lv_communicationnumber03 | TYPE BAPIP0021TH-COMMUNICATIONNUMBER03, " | |||
| lv_objectid | TYPE BAPIP0021-OBJPS, " | |||
| lv_communicationtype04 | TYPE BAPIP0021TH-COMMUNICATIONTYPE04, " | |||
| lv_communicationnumber04 | TYPE BAPIP0021TH-COMMUNICATIONNUMBER04, " | |||
| lv_alivedeceased | TYPE BAPIP0021TH-ALIVEDECEASED, " | |||
| lv_jobtitle | TYPE BAPIP0021TH-JOBTITLE, " | |||
| lv_employeroffamilymember | TYPE BAPIP0021TH-EMPLOYEROFFAMILYMEMBER, " | |||
| lv_addressnumbersoitrok | TYPE BAPIP0021TH-ADDRESSNUMBERSOITROK, " | |||
| lv_streetthambol | TYPE BAPIP0021TH-STREETTHAMBOL, " | |||
| lv_city | TYPE BAPIP0021TH-CITY, " | |||
| lv_district | TYPE BAPIP0021TH-DISTRICT, " | |||
| lv_nocommit | TYPE BAPI_STAND-NO_COMMIT, " | |||
| lv_lockindicator | TYPE BAPIP0021-SPRPS, " | |||
| lv_validitybegin | TYPE BAPIP0021-BEGDA, " | |||
| lv_validityend | TYPE BAPIP0021-ENDDA, " | |||
| lv_recordnumber | TYPE BAPIP0021-SEQNR, " | |||
| lv_membertype | TYPE BAPIP0021-FAMSA, " | |||
| lv_nameofsubtype | TYPE BAPIP0021TH-NAMEOFSUBTYPE. " |
|   CALL FUNCTION 'BAPI_FAMILYTH_CHANGE' "Family TH: Change record |
| EXPORTING | ||
| EMPLOYEENUMBER | = lv_employeenumber | |
| LASTNAME | = lv_lastname | |
| FIRSTNAME | = lv_firstname | |
| FORMOFADDRESS | = lv_formofaddress | |
| OTHERTITLE | = lv_othertitle | |
| DATEOFBIRTH | = lv_dateofbirth | |
| COUNTRYOFBIRTH | = lv_countryofbirth | |
| GENDER | = lv_gender | |
| PHONENUMBER | = lv_phonenumber | |
| NATIONALITY | = lv_nationality | |
| SECONDNATIONALITY | = lv_secondnationality | |
| SUBTYPE | = lv_subtype | |
| THIRDNATIONALITY | = lv_thirdnationality | |
| BIRTHPLACE | = lv_birthplace | |
| POSTALCODE | = lv_postalcode | |
| COUNTRY | = lv_country | |
| COMMUNICATIONTYPE01 | = lv_communicationtype01 | |
| COMMUNICATIONNUMBER01 | = lv_communicationnumber01 | |
| COMMUNICATIONTYPE02 | = lv_communicationtype02 | |
| COMMUNICATIONNUMBER02 | = lv_communicationnumber02 | |
| COMMUNICATIONTYPE03 | = lv_communicationtype03 | |
| COMMUNICATIONNUMBER03 | = lv_communicationnumber03 | |
| OBJECTID | = lv_objectid | |
| COMMUNICATIONTYPE04 | = lv_communicationtype04 | |
| COMMUNICATIONNUMBER04 | = lv_communicationnumber04 | |
| ALIVEDECEASED | = lv_alivedeceased | |
| JOBTITLE | = lv_jobtitle | |
| EMPLOYEROFFAMILYMEMBER | = lv_employeroffamilymember | |
| ADDRESSNUMBERSOITROK | = lv_addressnumbersoitrok | |
| STREETTHAMBOL | = lv_streetthambol | |
| CITY | = lv_city | |
| DISTRICT | = lv_district | |
| NOCOMMIT | = lv_nocommit | |
| LOCKINDICATOR | = lv_lockindicator | |
| VALIDITYBEGIN | = lv_validitybegin | |
| VALIDITYEND | = lv_validityend | |
| RECORDNUMBER | = lv_recordnumber | |
| MEMBERTYPE | = lv_membertype | |
| NAMEOFSUBTYPE | = lv_nameofsubtype | |
| IMPORTING | ||
| RETURN | = lv_return | |
| . " BAPI_FAMILYTH_CHANGE | ||
ABAP code using 7.40 inline data declarations to call FM BAPI_FAMILYTH_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 PERNR FROM BAPIP0021 INTO @DATA(ld_employeenumber). | ||||
| "SELECT single FANAM FROM BAPIP0021 INTO @DATA(ld_lastname). | ||||
| "SELECT single FAVOR FROM BAPIP0021 INTO @DATA(ld_firstname). | ||||
| "SELECT single FORMOFADDRESS FROM BAPIP0021TH INTO @DATA(ld_formofaddress). | ||||
| "SELECT single FNMZU FROM BAPIP0021 INTO @DATA(ld_othertitle). | ||||
| "SELECT single FGBDT FROM BAPIP0021 INTO @DATA(ld_dateofbirth). | ||||
| "SELECT single FGBLD FROM BAPIP0021 INTO @DATA(ld_countryofbirth). | ||||
| "SELECT single FASEX FROM BAPIP0021 INTO @DATA(ld_gender). | ||||
| "SELECT single PHONENUMBER FROM BAPIP0021TH INTO @DATA(ld_phonenumber). | ||||
| "SELECT single FANAT FROM BAPIP0021 INTO @DATA(ld_nationality). | ||||
| "SELECT single FANA2 FROM BAPIP0021 INTO @DATA(ld_secondnationality). | ||||
| "SELECT single SUBTY FROM BAPIP0021 INTO @DATA(ld_subtype). | ||||
| "SELECT single FANA3 FROM BAPIP0021 INTO @DATA(ld_thirdnationality). | ||||
| "SELECT single FGBOT FROM BAPIP0021 INTO @DATA(ld_birthplace). | ||||
| "SELECT single POSTALCODE FROM BAPIP0021TH INTO @DATA(ld_postalcode). | ||||
| "SELECT single COUNTRY FROM BAPIP0021TH INTO @DATA(ld_country). | ||||
| "SELECT single COMMUNICATIONTYPE01 FROM BAPIP0021TH INTO @DATA(ld_communicationtype01). | ||||
| "SELECT single COMMUNICATIONNUMBER01 FROM BAPIP0021TH INTO @DATA(ld_communicationnumber01). | ||||
| "SELECT single COMMUNICATIONTYPE02 FROM BAPIP0021TH INTO @DATA(ld_communicationtype02). | ||||
| "SELECT single COMMUNICATIONNUMBER02 FROM BAPIP0021TH INTO @DATA(ld_communicationnumber02). | ||||
| "SELECT single COMMUNICATIONTYPE03 FROM BAPIP0021TH INTO @DATA(ld_communicationtype03). | ||||
| "SELECT single COMMUNICATIONNUMBER03 FROM BAPIP0021TH INTO @DATA(ld_communicationnumber03). | ||||
| "SELECT single OBJPS FROM BAPIP0021 INTO @DATA(ld_objectid). | ||||
| "SELECT single COMMUNICATIONTYPE04 FROM BAPIP0021TH INTO @DATA(ld_communicationtype04). | ||||
| "SELECT single COMMUNICATIONNUMBER04 FROM BAPIP0021TH INTO @DATA(ld_communicationnumber04). | ||||
| "SELECT single ALIVEDECEASED FROM BAPIP0021TH INTO @DATA(ld_alivedeceased). | ||||
| "SELECT single JOBTITLE FROM BAPIP0021TH INTO @DATA(ld_jobtitle). | ||||
| "SELECT single EMPLOYEROFFAMILYMEMBER FROM BAPIP0021TH INTO @DATA(ld_employeroffamilymember). | ||||
| "SELECT single ADDRESSNUMBERSOITROK FROM BAPIP0021TH INTO @DATA(ld_addressnumbersoitrok). | ||||
| "SELECT single STREETTHAMBOL FROM BAPIP0021TH INTO @DATA(ld_streetthambol). | ||||
| "SELECT single CITY FROM BAPIP0021TH INTO @DATA(ld_city). | ||||
| "SELECT single DISTRICT FROM BAPIP0021TH INTO @DATA(ld_district). | ||||
| "SELECT single NO_COMMIT FROM BAPI_STAND INTO @DATA(ld_nocommit). | ||||
| "SELECT single SPRPS FROM BAPIP0021 INTO @DATA(ld_lockindicator). | ||||
| "SELECT single BEGDA FROM BAPIP0021 INTO @DATA(ld_validitybegin). | ||||
| "SELECT single ENDDA FROM BAPIP0021 INTO @DATA(ld_validityend). | ||||
| "SELECT single SEQNR FROM BAPIP0021 INTO @DATA(ld_recordnumber). | ||||
| "SELECT single FAMSA FROM BAPIP0021 INTO @DATA(ld_membertype). | ||||
| "SELECT single NAMEOFSUBTYPE FROM BAPIP0021TH INTO @DATA(ld_nameofsubtype). | ||||
Search for further information about these or an SAP related objects