SAP Function Modules

BAPI_FAMILYMY_CREATE SAP Function module - Create Family







BAPI_FAMILYMY_CREATE 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_CREATE 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_CREATE - BAPI FAMILYMY CREATE





CALL FUNCTION 'BAPI_FAMILYMY_CREATE' "Create Family
  EXPORTING
    inemployeenumber =          " bapip0021-pernr  Personnel number
    invaliditybegin =           " bapip0021-begda  Valid from date
    invalidityend =             " bapip0021-endda  Valid to date
*   membertype =                " bapip0021-famsa  Type of family record
*   firstname =                 " bapip0021-favor  First name
*   lastname =                  " bapip0021-fanam  Last name
*   fullname =                  " bapip0021-fcnam  Complete name
*   surnameprefix =             " bapip0021-fvrsw  Name affix
*   relationship =              " bapip0021-kdsvh  Relationship to child
*   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
*   nocommit =                  " bapi_stand-no_commit  COMMIT control at BAPI interface
*   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)
*   memberid =                  " bapip0021-objps  Child No.
*   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
  IMPORTING
    return =                    " bapireturn1   Structure for return code
    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  Start date
    validityend =               " bapip0021-endda  End Date
    recordnumber =              " bapip0021-seqnr  Number of infotype record
    .  "  BAPI_FAMILYMY_CREATE

ABAP code example for Function Module BAPI_FAMILYMY_CREATE





The ABAP code below is a full code listing to execute function module BAPI_FAMILYMY_CREATE 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_employeenumber  TYPE BAPIP0021-PERNR ,
ld_subtype  TYPE BAPIP0021-SUBTY ,
ld_objectid  TYPE BAPIP0021-OBJPS ,
ld_lockindicator  TYPE BAPIP0021-SPRPS ,
ld_validitybegin  TYPE BAPIP0021-BEGDA ,
ld_validityend  TYPE BAPIP0021-ENDDA ,
ld_recordnumber  TYPE BAPIP0021-SEQNR .


DATA(ld_inemployeenumber) = Check type of data required

DATA(ld_invaliditybegin) = 20210129

DATA(ld_invalidityend) = 20210129

DATA(ld_membertype) = some text here

DATA(ld_firstname) = some text here

DATA(ld_lastname) = some text here

DATA(ld_fullname) = some text here

DATA(ld_surnameprefix) = some text here

DATA(ld_relationship) = some text here

DATA(ld_maidenname) = some text here

DATA(ld_gender) = some text here

DATA(ld_dateofbirth) = 20210129

DATA(ld_placeofbirth) = some text here

DATA(ld_landofbirth) = some text here

DATA(ld_nationality) = some text here

DATA(ld_nocommit) = some text here

DATA(ld_personalid) = some text here

DATA(ld_passportnumber) = some text here

DATA(ld_taxnumber) = some text here

DATA(ld_taxoffice) = some text here

DATA(ld_referencenumber) = some text here

DATA(ld_employmentstatus) = some text here

DATA(ld_jobtitle) = some text here

DATA(ld_employername) = some text here

DATA(ld_nameformat) = Check type of data required

DATA(ld_schooltype) = some text here

DATA(ld_birthcertificateid) = some text here

DATA(ld_handicapped) = some text here

DATA(ld_childcustody) = some text here

DATA(ld_maritalstatus) = some text here

DATA(ld_memberid) = some text here

DATA(ld_street) = some text here

DATA(ld_secondaddress) = some text here

DATA(ld_thirdaddress) = some text here

DATA(ld_postalcode) = some text here

DATA(ld_city) = some text here

DATA(ld_region) = some text here

DATA(ld_country) = some text here

DATA(ld_coname) = some text here

DATA(ld_telephonenumber) = some text here

DATA(ld_commtype1) = some text here

DATA(ld_commnumber1) = some text here

DATA(ld_commtype2) = some text here

DATA(ld_commnumber2) = some text here

DATA(ld_commtype3) = some text here

DATA(ld_commnumber3) = some text here

DATA(ld_commtype4) = some text here

DATA(ld_commnumber4) = some text here . CALL FUNCTION 'BAPI_FAMILYMY_CREATE' EXPORTING inemployeenumber = ld_inemployeenumber invaliditybegin = ld_invaliditybegin invalidityend = ld_invalidityend * membertype = ld_membertype * firstname = ld_firstname * lastname = ld_lastname * fullname = ld_fullname * surnameprefix = ld_surnameprefix * relationship = ld_relationship * maidenname = ld_maidenname * gender = ld_gender * dateofbirth = ld_dateofbirth * placeofbirth = ld_placeofbirth * landofbirth = ld_landofbirth * nationality = ld_nationality * nocommit = ld_nocommit * 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 * memberid = ld_memberid * 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 IMPORTING return = ld_return employeenumber = ld_employeenumber subtype = ld_subtype objectid = ld_objectid lockindicator = ld_lockindicator validitybegin = ld_validitybegin validityend = ld_validityend recordnumber = ld_recordnumber . " BAPI_FAMILYMY_CREATE
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_inemployeenumber  TYPE BAPIP0021-PERNR ,
ld_employeenumber  TYPE BAPIP0021-PERNR ,
ld_invaliditybegin  TYPE BAPIP0021-BEGDA ,
ld_subtype  TYPE BAPIP0021-SUBTY ,
ld_invalidityend  TYPE BAPIP0021-ENDDA ,
ld_objectid  TYPE BAPIP0021-OBJPS ,
ld_membertype  TYPE BAPIP0021-FAMSA ,
ld_lockindicator  TYPE BAPIP0021-SPRPS ,
ld_firstname  TYPE BAPIP0021-FAVOR ,
ld_lastname  TYPE BAPIP0021-FANAM ,
ld_validitybegin  TYPE BAPIP0021-BEGDA ,
ld_validityend  TYPE BAPIP0021-ENDDA ,
ld_fullname  TYPE BAPIP0021-FCNAM ,
ld_recordnumber  TYPE BAPIP0021-SEQNR ,
ld_surnameprefix  TYPE BAPIP0021-FVRSW ,
ld_relationship  TYPE BAPIP0021-KDSVH ,
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_nocommit  TYPE BAPI_STAND-NO_COMMIT ,
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_memberid  TYPE BAPIP0021-OBJPS ,
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_inemployeenumber = Check type of data required

ld_invaliditybegin = 20210129

ld_invalidityend = 20210129

ld_membertype = some text here

ld_firstname = some text here

ld_lastname = some text here

ld_fullname = some text here

ld_surnameprefix = some text here

ld_relationship = some text here

ld_maidenname = some text here

ld_gender = some text here

ld_dateofbirth = 20210129

ld_placeofbirth = some text here

ld_landofbirth = some text here

ld_nationality = some text here

ld_nocommit = some text here

ld_personalid = some text here

ld_passportnumber = some text here

ld_taxnumber = some text here

ld_taxoffice = some text here

ld_referencenumber = some text here

ld_employmentstatus = some text here

ld_jobtitle = some text here

ld_employername = some text here

ld_nameformat = Check type of data required

ld_schooltype = some text here

ld_birthcertificateid = some text here

ld_handicapped = some text here

ld_childcustody = some text here

ld_maritalstatus = some text here

ld_memberid = some text here

ld_street = some text here

ld_secondaddress = some text here

ld_thirdaddress = some text here

ld_postalcode = some text here

ld_city = some text here

ld_region = some text here

ld_country = some text here

ld_coname = some text here

ld_telephonenumber = some text here

ld_commtype1 = some text here

ld_commnumber1 = some text here

ld_commtype2 = some text here

ld_commnumber2 = some text here

ld_commtype3 = some text here

ld_commnumber3 = some text here

ld_commtype4 = some text here

ld_commnumber4 = some text here

SAP Documentation for FM BAPI_FAMILYMY_CREATE


You can use this method to create 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_CREATE or its description.