SAP BAPI_FAMILYMY_CHANGE Function Module for Change Family
BAPI_FAMILYMY_CHANGE is a standard bapi familymy 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 Family 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 familymy change FM, simply by entering the name BAPI_FAMILYMY_CHANGE into the relevant SAP transaction such as SE37 or SE38.
Function Group: PFAM_MY
Program Name: SAPLPFAM_MY
Main Program:
Appliation area: P
Release date: 31-Jan-2000
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function BAPI_FAMILYMY_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_FAMILYMY_CHANGE'"Change Family.
EXPORTING
EMPLOYEENUMBER = "Personnel number
* SURNAMEPREFIX = "Name affix
* FULLNAME = "Complete name
* RELATIONSHIP = "Relationship to child
* MAIDENNAME = "Name at birth
* GENDER = "Gender key
* DATEOFBIRTH = "Date of birth
* PLACEOFBIRTH = "Birthplace
* LANDOFBIRTH = "Country of birth
* NATIONALITY = "Nationality
* NOCOMMIT = "COMMIT control at BAPI interface
SUBTYPE = "Subtype
* PERSONALID = "IC number
* PASSPORTNUMBER = "Passport number
* TAXNUMBER = "Income tax number of employee (MY)
* TAXOFFICE = "Spouse tax office Malaysia
* REFERENCENUMBER = "Reference personnel number of family member
* EMPLOYMENTSTATUS = "Spouse employment status
* JOBTITLE = "Job title
* EMPLOYERNAME = "Spouse employer
* NAMEFORMAT = "Name format indicator for employee in a list
* SCHOOLTYPE = "School type of family member
OBJECTID = "Object identification
* BIRTHCERTIFICATEID = "Birth certificate ID
* HANDICAPPED = "Child handicap status
* CHILDCUSTODY = "Child custody status
* MARITALSTATUS = "Marital status for income tax purpose (MY)
* STREET = "House number and street
* SECONDADDRESS = "2nd address line
* THIRDADDRESS = "District
* POSTALCODE = "Postal code
* CITY = "City
* REGION = "Region (State, Province, County)
LOCKINDICATOR = "Lock indicator for HR master record
* COUNTRY = "Country key
* CONAME = "C/O name
* TELEPHONENUMBER = "Telephone number
* COMMTYPE1 = "Communication type
* COMMNUMBER1 = "Communications number
* COMMTYPE2 = "Communication type
* COMMNUMBER2 = "Communications number
* COMMTYPE3 = "Communication type
* COMMNUMBER3 = "Communications number
* COMMTYPE4 = "Communication type
VALIDITYBEGIN = "Valid from date
* COMMNUMBER4 = "Communications number
VALIDITYEND = "Valid to date
RECORDNUMBER = "Number of infotype record
* FIRSTNAME = "First name
* LASTNAME = "Last name
IMPORTING
RETURN = "Structure for return code
IMPORTING Parameters details for BAPI_FAMILYMY_CHANGE
EMPLOYEENUMBER - Personnel number
Data type: BAPIP0021-PERNROptional: No
Call by Reference: No ( called with pass by value option)
SURNAMEPREFIX - Name affix
Data type: BAPIP0021-FVRSWOptional: Yes
Call by Reference: No ( called with pass by value option)
FULLNAME - Complete name
Data type: BAPIP0021-FCNAMOptional: Yes
Call by Reference: No ( called with pass by value option)
RELATIONSHIP - Relationship to child
Data type: BAPIP0021-KDSVHOptional: Yes
Call by Reference: No ( called with pass by value option)
MAIDENNAME - Name at birth
Data type: BAPIP0021-FGBNAOptional: 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)
DATEOFBIRTH - Date of birth
Data type: BAPIP0021-FGBDTOptional: Yes
Call by Reference: No ( called with pass by value option)
PLACEOFBIRTH - Birthplace
Data type: BAPIP0021-FGBOTOptional: Yes
Call by Reference: No ( called with pass by value option)
LANDOFBIRTH - Country of birth
Data type: BAPIP0021-FGBLDOptional: 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)
NOCOMMIT - COMMIT control at BAPI interface
Data type: BAPI_STAND-NO_COMMITOptional: 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)
PERSONALID - IC number
Data type: BAPIP0021MY-ICNUMOptional: Yes
Call by Reference: No ( called with pass by value option)
PASSPORTNUMBER - Passport number
Data type: BAPIP0021MY-PASNROptional: Yes
Call by Reference: No ( called with pass by value option)
TAXNUMBER - Income tax number of employee (MY)
Data type: BAPIP0021MY-TNOEEOptional: Yes
Call by Reference: No ( called with pass by value option)
TAXOFFICE - Spouse tax office Malaysia
Data type: BAPIP0021MY-STXOFOptional: Yes
Call by Reference: No ( called with pass by value option)
REFERENCENUMBER - Reference personnel number of family member
Data type: BAPIP0021MY-EBRNROptional: Yes
Call by Reference: No ( called with pass by value option)
EMPLOYMENTSTATUS - Spouse employment status
Data type: BAPIP0021MY-SEMPSOptional: Yes
Call by Reference: No ( called with pass by value option)
JOBTITLE - Job title
Data type: BAPIP0021MY-STLTXOptional: Yes
Call by Reference: No ( called with pass by value option)
EMPLOYERNAME - Spouse employer
Data type: BAPIP0021MY-SPEMROptional: Yes
Call by Reference: No ( called with pass by value option)
NAMEFORMAT - Name format indicator for employee in a list
Data type: BAPIP0021-FKNZNOptional: Yes
Call by Reference: No ( called with pass by value option)
SCHOOLTYPE - School type of family member
Data type: BAPIP0021-FASAROptional: 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)
BIRTHCERTIFICATEID - Birth certificate ID
Data type: BAPIP0021MY-BTHIDOptional: Yes
Call by Reference: No ( called with pass by value option)
HANDICAPPED - Child handicap status
Data type: BAPIP0021MY-HANCHOptional: Yes
Call by Reference: No ( called with pass by value option)
CHILDCUSTODY - Child custody status
Data type: BAPIP0021MY-CHCUSOptional: Yes
Call by Reference: No ( called with pass by value option)
MARITALSTATUS - Marital status for income tax purpose (MY)
Data type: BAPIP0021MY-MARSTOptional: Yes
Call by Reference: No ( called with pass by value option)
STREET - House number and street
Data type: BAPIP0021MY-STRASOptional: Yes
Call by Reference: No ( called with pass by value option)
SECONDADDRESS - 2nd address line
Data type: BAPIP0021MY-LOCATOptional: Yes
Call by Reference: No ( called with pass by value option)
THIRDADDRESS - District
Data type: BAPIP0021MY-ORT02Optional: Yes
Call by Reference: No ( called with pass by value option)
POSTALCODE - Postal code
Data type: BAPIP0021MY-PSTLZOptional: Yes
Call by Reference: No ( called with pass by value option)
CITY - City
Data type: BAPIP0021MY-ORT01Optional: Yes
Call by Reference: No ( called with pass by value option)
REGION - Region (State, Province, County)
Data type: BAPIP0021MY-STATEOptional: 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)
COUNTRY - Country key
Data type: BAPIP0021MY-LAND1Optional: Yes
Call by Reference: No ( called with pass by value option)
CONAME - C/O name
Data type: BAPIP0021MY-NAME2Optional: Yes
Call by Reference: No ( called with pass by value option)
TELEPHONENUMBER - Telephone number
Data type: BAPIP0021MY-TELNROptional: Yes
Call by Reference: No ( called with pass by value option)
COMMTYPE1 - Communication type
Data type: BAPIP0021MY-COM01Optional: Yes
Call by Reference: No ( called with pass by value option)
COMMNUMBER1 - Communications number
Data type: BAPIP0021MY-NUM01Optional: Yes
Call by Reference: No ( called with pass by value option)
COMMTYPE2 - Communication type
Data type: BAPIP0021MY-COM02Optional: Yes
Call by Reference: No ( called with pass by value option)
COMMNUMBER2 - Communications number
Data type: BAPIP0021MY-NUM02Optional: Yes
Call by Reference: No ( called with pass by value option)
COMMTYPE3 - Communication type
Data type: BAPIP0021MY-COM03Optional: Yes
Call by Reference: No ( called with pass by value option)
COMMNUMBER3 - Communications number
Data type: BAPIP0021MY-NUM03Optional: Yes
Call by Reference: No ( called with pass by value option)
COMMTYPE4 - Communication type
Data type: BAPIP0021MY-COM04Optional: Yes
Call by Reference: No ( called with pass by value option)
VALIDITYBEGIN - Valid from date
Data type: BAPIP0021-BEGDAOptional: No
Call by Reference: No ( called with pass by value option)
COMMNUMBER4 - Communications number
Data type: BAPIP0021MY-NUM04Optional: Yes
Call by Reference: No ( called with pass by value option)
VALIDITYEND - Valid to date
Data type: BAPIP0021-ENDDAOptional: No
Call by Reference: No ( called with pass by value option)
RECORDNUMBER - Number of infotype record
Data type: BAPIP0021-SEQNROptional: No
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)
LASTNAME - Last name
Data type: BAPIP0021-FANAMOptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for BAPI_FAMILYMY_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_FAMILYMY_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_surnameprefix | TYPE BAPIP0021-FVRSW, " | |||
| lv_fullname | TYPE BAPIP0021-FCNAM, " | |||
| lv_relationship | TYPE BAPIP0021-KDSVH, " | |||
| lv_maidenname | TYPE BAPIP0021-FGBNA, " | |||
| lv_gender | TYPE BAPIP0021-FASEX, " | |||
| lv_dateofbirth | TYPE BAPIP0021-FGBDT, " | |||
| lv_placeofbirth | TYPE BAPIP0021-FGBOT, " | |||
| lv_landofbirth | TYPE BAPIP0021-FGBLD, " | |||
| lv_nationality | TYPE BAPIP0021-FANAT, " | |||
| lv_nocommit | TYPE BAPI_STAND-NO_COMMIT, " | |||
| lv_subtype | TYPE BAPIP0021-SUBTY, " | |||
| lv_personalid | TYPE BAPIP0021MY-ICNUM, " | |||
| lv_passportnumber | TYPE BAPIP0021MY-PASNR, " | |||
| lv_taxnumber | TYPE BAPIP0021MY-TNOEE, " | |||
| lv_taxoffice | TYPE BAPIP0021MY-STXOF, " | |||
| lv_referencenumber | TYPE BAPIP0021MY-EBRNR, " | |||
| lv_employmentstatus | TYPE BAPIP0021MY-SEMPS, " | |||
| lv_jobtitle | TYPE BAPIP0021MY-STLTX, " | |||
| lv_employername | TYPE BAPIP0021MY-SPEMR, " | |||
| lv_nameformat | TYPE BAPIP0021-FKNZN, " | |||
| lv_schooltype | TYPE BAPIP0021-FASAR, " | |||
| lv_objectid | TYPE BAPIP0021-OBJPS, " | |||
| lv_birthcertificateid | TYPE BAPIP0021MY-BTHID, " | |||
| lv_handicapped | TYPE BAPIP0021MY-HANCH, " | |||
| lv_childcustody | TYPE BAPIP0021MY-CHCUS, " | |||
| lv_maritalstatus | TYPE BAPIP0021MY-MARST, " | |||
| lv_street | TYPE BAPIP0021MY-STRAS, " | |||
| lv_secondaddress | TYPE BAPIP0021MY-LOCAT, " | |||
| lv_thirdaddress | TYPE BAPIP0021MY-ORT02, " | |||
| lv_postalcode | TYPE BAPIP0021MY-PSTLZ, " | |||
| lv_city | TYPE BAPIP0021MY-ORT01, " | |||
| lv_region | TYPE BAPIP0021MY-STATE, " | |||
| lv_lockindicator | TYPE BAPIP0021-SPRPS, " | |||
| lv_country | TYPE BAPIP0021MY-LAND1, " | |||
| lv_coname | TYPE BAPIP0021MY-NAME2, " | |||
| lv_telephonenumber | TYPE BAPIP0021MY-TELNR, " | |||
| lv_commtype1 | TYPE BAPIP0021MY-COM01, " | |||
| lv_commnumber1 | TYPE BAPIP0021MY-NUM01, " | |||
| lv_commtype2 | TYPE BAPIP0021MY-COM02, " | |||
| lv_commnumber2 | TYPE BAPIP0021MY-NUM02, " | |||
| lv_commtype3 | TYPE BAPIP0021MY-COM03, " | |||
| lv_commnumber3 | TYPE BAPIP0021MY-NUM03, " | |||
| lv_commtype4 | TYPE BAPIP0021MY-COM04, " | |||
| lv_validitybegin | TYPE BAPIP0021-BEGDA, " | |||
| lv_commnumber4 | TYPE BAPIP0021MY-NUM04, " | |||
| lv_validityend | TYPE BAPIP0021-ENDDA, " | |||
| lv_recordnumber | TYPE BAPIP0021-SEQNR, " | |||
| lv_firstname | TYPE BAPIP0021-FAVOR, " | |||
| lv_lastname | TYPE BAPIP0021-FANAM. " |
|   CALL FUNCTION 'BAPI_FAMILYMY_CHANGE' "Change Family |
| EXPORTING | ||
| EMPLOYEENUMBER | = lv_employeenumber | |
| SURNAMEPREFIX | = lv_surnameprefix | |
| FULLNAME | = lv_fullname | |
| RELATIONSHIP | = lv_relationship | |
| MAIDENNAME | = lv_maidenname | |
| GENDER | = lv_gender | |
| DATEOFBIRTH | = lv_dateofbirth | |
| PLACEOFBIRTH | = lv_placeofbirth | |
| LANDOFBIRTH | = lv_landofbirth | |
| NATIONALITY | = lv_nationality | |
| NOCOMMIT | = lv_nocommit | |
| SUBTYPE | = lv_subtype | |
| PERSONALID | = lv_personalid | |
| PASSPORTNUMBER | = lv_passportnumber | |
| TAXNUMBER | = lv_taxnumber | |
| TAXOFFICE | = lv_taxoffice | |
| REFERENCENUMBER | = lv_referencenumber | |
| EMPLOYMENTSTATUS | = lv_employmentstatus | |
| JOBTITLE | = lv_jobtitle | |
| EMPLOYERNAME | = lv_employername | |
| NAMEFORMAT | = lv_nameformat | |
| SCHOOLTYPE | = lv_schooltype | |
| OBJECTID | = lv_objectid | |
| BIRTHCERTIFICATEID | = lv_birthcertificateid | |
| HANDICAPPED | = lv_handicapped | |
| CHILDCUSTODY | = lv_childcustody | |
| MARITALSTATUS | = lv_maritalstatus | |
| STREET | = lv_street | |
| SECONDADDRESS | = lv_secondaddress | |
| THIRDADDRESS | = lv_thirdaddress | |
| POSTALCODE | = lv_postalcode | |
| CITY | = lv_city | |
| REGION | = lv_region | |
| LOCKINDICATOR | = lv_lockindicator | |
| COUNTRY | = lv_country | |
| CONAME | = lv_coname | |
| TELEPHONENUMBER | = lv_telephonenumber | |
| COMMTYPE1 | = lv_commtype1 | |
| COMMNUMBER1 | = lv_commnumber1 | |
| COMMTYPE2 | = lv_commtype2 | |
| COMMNUMBER2 | = lv_commnumber2 | |
| COMMTYPE3 | = lv_commtype3 | |
| COMMNUMBER3 | = lv_commnumber3 | |
| COMMTYPE4 | = lv_commtype4 | |
| VALIDITYBEGIN | = lv_validitybegin | |
| COMMNUMBER4 | = lv_commnumber4 | |
| VALIDITYEND | = lv_validityend | |
| RECORDNUMBER | = lv_recordnumber | |
| FIRSTNAME | = lv_firstname | |
| LASTNAME | = lv_lastname | |
| IMPORTING | ||
| RETURN | = lv_return | |
| . " BAPI_FAMILYMY_CHANGE | ||
ABAP code using 7.40 inline data declarations to call FM BAPI_FAMILYMY_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 FVRSW FROM BAPIP0021 INTO @DATA(ld_surnameprefix). | ||||
| "SELECT single FCNAM FROM BAPIP0021 INTO @DATA(ld_fullname). | ||||
| "SELECT single KDSVH FROM BAPIP0021 INTO @DATA(ld_relationship). | ||||
| "SELECT single FGBNA FROM BAPIP0021 INTO @DATA(ld_maidenname). | ||||
| "SELECT single FASEX FROM BAPIP0021 INTO @DATA(ld_gender). | ||||
| "SELECT single FGBDT FROM BAPIP0021 INTO @DATA(ld_dateofbirth). | ||||
| "SELECT single FGBOT FROM BAPIP0021 INTO @DATA(ld_placeofbirth). | ||||
| "SELECT single FGBLD FROM BAPIP0021 INTO @DATA(ld_landofbirth). | ||||
| "SELECT single FANAT FROM BAPIP0021 INTO @DATA(ld_nationality). | ||||
| "SELECT single NO_COMMIT FROM BAPI_STAND INTO @DATA(ld_nocommit). | ||||
| "SELECT single SUBTY FROM BAPIP0021 INTO @DATA(ld_subtype). | ||||
| "SELECT single ICNUM FROM BAPIP0021MY INTO @DATA(ld_personalid). | ||||
| "SELECT single PASNR FROM BAPIP0021MY INTO @DATA(ld_passportnumber). | ||||
| "SELECT single TNOEE FROM BAPIP0021MY INTO @DATA(ld_taxnumber). | ||||
| "SELECT single STXOF FROM BAPIP0021MY INTO @DATA(ld_taxoffice). | ||||
| "SELECT single EBRNR FROM BAPIP0021MY INTO @DATA(ld_referencenumber). | ||||
| "SELECT single SEMPS FROM BAPIP0021MY INTO @DATA(ld_employmentstatus). | ||||
| "SELECT single STLTX FROM BAPIP0021MY INTO @DATA(ld_jobtitle). | ||||
| "SELECT single SPEMR FROM BAPIP0021MY INTO @DATA(ld_employername). | ||||
| "SELECT single FKNZN FROM BAPIP0021 INTO @DATA(ld_nameformat). | ||||
| "SELECT single FASAR FROM BAPIP0021 INTO @DATA(ld_schooltype). | ||||
| "SELECT single OBJPS FROM BAPIP0021 INTO @DATA(ld_objectid). | ||||
| "SELECT single BTHID FROM BAPIP0021MY INTO @DATA(ld_birthcertificateid). | ||||
| "SELECT single HANCH FROM BAPIP0021MY INTO @DATA(ld_handicapped). | ||||
| "SELECT single CHCUS FROM BAPIP0021MY INTO @DATA(ld_childcustody). | ||||
| "SELECT single MARST FROM BAPIP0021MY INTO @DATA(ld_maritalstatus). | ||||
| "SELECT single STRAS FROM BAPIP0021MY INTO @DATA(ld_street). | ||||
| "SELECT single LOCAT FROM BAPIP0021MY INTO @DATA(ld_secondaddress). | ||||
| "SELECT single ORT02 FROM BAPIP0021MY INTO @DATA(ld_thirdaddress). | ||||
| "SELECT single PSTLZ FROM BAPIP0021MY INTO @DATA(ld_postalcode). | ||||
| "SELECT single ORT01 FROM BAPIP0021MY INTO @DATA(ld_city). | ||||
| "SELECT single STATE FROM BAPIP0021MY INTO @DATA(ld_region). | ||||
| "SELECT single SPRPS FROM BAPIP0021 INTO @DATA(ld_lockindicator). | ||||
| "SELECT single LAND1 FROM BAPIP0021MY INTO @DATA(ld_country). | ||||
| "SELECT single NAME2 FROM BAPIP0021MY INTO @DATA(ld_coname). | ||||
| "SELECT single TELNR FROM BAPIP0021MY INTO @DATA(ld_telephonenumber). | ||||
| "SELECT single COM01 FROM BAPIP0021MY INTO @DATA(ld_commtype1). | ||||
| "SELECT single NUM01 FROM BAPIP0021MY INTO @DATA(ld_commnumber1). | ||||
| "SELECT single COM02 FROM BAPIP0021MY INTO @DATA(ld_commtype2). | ||||
| "SELECT single NUM02 FROM BAPIP0021MY INTO @DATA(ld_commnumber2). | ||||
| "SELECT single COM03 FROM BAPIP0021MY INTO @DATA(ld_commtype3). | ||||
| "SELECT single NUM03 FROM BAPIP0021MY INTO @DATA(ld_commnumber3). | ||||
| "SELECT single COM04 FROM BAPIP0021MY INTO @DATA(ld_commtype4). | ||||
| "SELECT single BEGDA FROM BAPIP0021 INTO @DATA(ld_validitybegin). | ||||
| "SELECT single NUM04 FROM BAPIP0021MY INTO @DATA(ld_commnumber4). | ||||
| "SELECT single ENDDA FROM BAPIP0021 INTO @DATA(ld_validityend). | ||||
| "SELECT single SEQNR FROM BAPIP0021 INTO @DATA(ld_recordnumber). | ||||
| "SELECT single FAVOR FROM BAPIP0021 INTO @DATA(ld_firstname). | ||||
| "SELECT single FANAM FROM BAPIP0021 INTO @DATA(ld_lastname). | ||||
Search for further information about these or an SAP related objects