SAP BAPI_ADDRESSEMPCH_GETDETAIL Function Module for Read Employee Address
BAPI_ADDRESSEMPCH_GETDETAIL is a standard bapi addressempch 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 Employee Address 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 addressempch getdetail FM, simply by entering the name BAPI_ADDRESSEMPCH_GETDETAIL into the relevant SAP transaction such as SE37 or SE38.
Function Group: PADR_CH
Program Name: SAPLPADR_CH
Main Program:
Appliation area: P
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:
Function BAPI_ADDRESSEMPCH_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_ADDRESSEMPCH_GETDETAIL'"Read Employee Address.
EXPORTING
EMPLOYEENUMBER = "Personnel number
SUBTYPE = "Subtype
OBJECTID = "Object identification
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
TELEPHONENUMBER = "Telephone number
NAMEOFADDRESSTYPE = "Name of address type
NAMEOFSTATE = "Name of region
NAMEOFCOUNTRY = "Country Name
DISTANCEINKM = "
DISTANCEINKM1 = "
COMPANYOWNEDAPT = "
BUSROUTE = "
COMMTYPE1 = "Communication type 1
COMMNUMBER1 = "Communication number 1
ADDRESSTYPE = "Subtype
COMMTYPE2 = "Communication type 2
COMMNUMBER2 = "Communication number 2
COMMTYPE3 = "Communication type 3
COMMNUMBER3 = "Communication number 3
CONAME = "C/O name
STREETANDHOUSENO = "House number and street
CITY = "Location
DISTRICT = "District
POSTALCODECITY = "Postal code
STATE = "Region
COUNTRY = "Country key
IMPORTING Parameters details for BAPI_ADDRESSEMPCH_GETDETAIL
EMPLOYEENUMBER - Personnel number
Data type: BAPIP0006-PERNROptional: No
Call by Reference: No ( called with pass by value option)
SUBTYPE - Subtype
Data type: BAPIP0006-SUBTYOptional: No
Call by Reference: No ( called with pass by value option)
OBJECTID - Object identification
Data type: BAPIP0006-OBJPSOptional: No
Call by Reference: No ( called with pass by value option)
LOCKINDICATOR - Lock indicator for HR master record
Data type: BAPIP0006-SPRPSOptional: No
Call by Reference: No ( called with pass by value option)
VALIDITYBEGIN - Valid from date
Data type: BAPIP0006-BEGDAOptional: No
Call by Reference: No ( called with pass by value option)
VALIDITYEND - Valid to date
Data type: BAPIP0006-ENDDAOptional: No
Call by Reference: No ( called with pass by value option)
RECORDNUMBER - Number of Infotype Record
Data type: BAPIP0006-SEQNROptional: No
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for BAPI_ADDRESSEMPCH_GETDETAIL
RETURN - Structure for return code
Data type: BAPIRETURN1Optional: No
Call by Reference: No ( called with pass by value option)
TELEPHONENUMBER - Telephone number
Data type: BAPIP0006-TELNROptional: No
Call by Reference: No ( called with pass by value option)
NAMEOFADDRESSTYPE - Name of address type
Data type: BAPIP0006-NAMEOFANSSAOptional: No
Call by Reference: No ( called with pass by value option)
NAMEOFSTATE - Name of region
Data type: BAPIP0006-NAMEOFSTATEOptional: No
Call by Reference: No ( called with pass by value option)
NAMEOFCOUNTRY - Country Name
Data type: BAPIP0006-NAMEOFLAND1Optional: No
Call by Reference: No ( called with pass by value option)
DISTANCEINKM -
Data type: BAPIP0006LCH-DISTANCEINKMOptional: No
Call by Reference: No ( called with pass by value option)
DISTANCEINKM1 -
Data type: BAPIP0006LCH-DISTANCEINKM1Optional: No
Call by Reference: No ( called with pass by value option)
COMPANYOWNEDAPT -
Data type: BAPIP0006-WKWNGOptional: No
Call by Reference: No ( called with pass by value option)
BUSROUTE -
Data type: BAPIP0006LCH-BUSROUTEOptional: No
Call by Reference: No ( called with pass by value option)
COMMTYPE1 - Communication type 1
Data type: BAPIP0006LCH-COMMTYPE1Optional: No
Call by Reference: No ( called with pass by value option)
COMMNUMBER1 - Communication number 1
Data type: BAPIP0006LCH-COMMNUMBER1Optional: No
Call by Reference: No ( called with pass by value option)
ADDRESSTYPE - Subtype
Data type: BAPIP0006-SUBTYOptional: No
Call by Reference: No ( called with pass by value option)
COMMTYPE2 - Communication type 2
Data type: BAPIP0006LCH-COMMTYPE2Optional: No
Call by Reference: No ( called with pass by value option)
COMMNUMBER2 - Communication number 2
Data type: BAPIP0006LCH-COMMNUMBER2Optional: No
Call by Reference: No ( called with pass by value option)
COMMTYPE3 - Communication type 3
Data type: BAPIP0006LCH-COMMTYPE3Optional: No
Call by Reference: No ( called with pass by value option)
COMMNUMBER3 - Communication number 3
Data type: BAPIP0006LCH-COMMNUMBER3Optional: No
Call by Reference: No ( called with pass by value option)
CONAME - C/O name
Data type: BAPIP0006-NAME2Optional: No
Call by Reference: No ( called with pass by value option)
STREETANDHOUSENO - House number and street
Data type: BAPIP0006-STRASOptional: No
Call by Reference: No ( called with pass by value option)
CITY - Location
Data type: BAPIP0006-ORT01Optional: No
Call by Reference: No ( called with pass by value option)
DISTRICT - District
Data type: BAPIP0006-ORT02Optional: No
Call by Reference: No ( called with pass by value option)
POSTALCODECITY - Postal code
Data type: BAPIP0006-PSTLZOptional: No
Call by Reference: No ( called with pass by value option)
STATE - Region
Data type: BAPIP0006-STATEOptional: No
Call by Reference: No ( called with pass by value option)
COUNTRY - Country key
Data type: BAPIP0006-LAND1Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for BAPI_ADDRESSEMPCH_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 BAPIP0006-PERNR, " | |||
lv_telephonenumber | TYPE BAPIP0006-TELNR, " | |||
lv_nameofaddresstype | TYPE BAPIP0006-NAMEOFANSSA, " | |||
lv_nameofstate | TYPE BAPIP0006-NAMEOFSTATE, " | |||
lv_nameofcountry | TYPE BAPIP0006-NAMEOFLAND1, " | |||
lv_distanceinkm | TYPE BAPIP0006LCH-DISTANCEINKM, " | |||
lv_distanceinkm1 | TYPE BAPIP0006LCH-DISTANCEINKM1, " | |||
lv_companyownedapt | TYPE BAPIP0006-WKWNG, " | |||
lv_busroute | TYPE BAPIP0006LCH-BUSROUTE, " | |||
lv_commtype1 | TYPE BAPIP0006LCH-COMMTYPE1, " | |||
lv_commnumber1 | TYPE BAPIP0006LCH-COMMNUMBER1, " | |||
lv_subtype | TYPE BAPIP0006-SUBTY, " | |||
lv_addresstype | TYPE BAPIP0006-SUBTY, " | |||
lv_commtype2 | TYPE BAPIP0006LCH-COMMTYPE2, " | |||
lv_commnumber2 | TYPE BAPIP0006LCH-COMMNUMBER2, " | |||
lv_commtype3 | TYPE BAPIP0006LCH-COMMTYPE3, " | |||
lv_commnumber3 | TYPE BAPIP0006LCH-COMMNUMBER3, " | |||
lv_coname | TYPE BAPIP0006-NAME2, " | |||
lv_objectid | TYPE BAPIP0006-OBJPS, " | |||
lv_lockindicator | TYPE BAPIP0006-SPRPS, " | |||
lv_streetandhouseno | TYPE BAPIP0006-STRAS, " | |||
lv_city | TYPE BAPIP0006-ORT01, " | |||
lv_validitybegin | TYPE BAPIP0006-BEGDA, " | |||
lv_district | TYPE BAPIP0006-ORT02, " | |||
lv_validityend | TYPE BAPIP0006-ENDDA, " | |||
lv_recordnumber | TYPE BAPIP0006-SEQNR, " | |||
lv_postalcodecity | TYPE BAPIP0006-PSTLZ, " | |||
lv_state | TYPE BAPIP0006-STATE, " | |||
lv_country | TYPE BAPIP0006-LAND1. " |
  CALL FUNCTION 'BAPI_ADDRESSEMPCH_GETDETAIL' "Read Employee Address |
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 | |
TELEPHONENUMBER | = lv_telephonenumber | |
NAMEOFADDRESSTYPE | = lv_nameofaddresstype | |
NAMEOFSTATE | = lv_nameofstate | |
NAMEOFCOUNTRY | = lv_nameofcountry | |
DISTANCEINKM | = lv_distanceinkm | |
DISTANCEINKM1 | = lv_distanceinkm1 | |
COMPANYOWNEDAPT | = lv_companyownedapt | |
BUSROUTE | = lv_busroute | |
COMMTYPE1 | = lv_commtype1 | |
COMMNUMBER1 | = lv_commnumber1 | |
ADDRESSTYPE | = lv_addresstype | |
COMMTYPE2 | = lv_commtype2 | |
COMMNUMBER2 | = lv_commnumber2 | |
COMMTYPE3 | = lv_commtype3 | |
COMMNUMBER3 | = lv_commnumber3 | |
CONAME | = lv_coname | |
STREETANDHOUSENO | = lv_streetandhouseno | |
CITY | = lv_city | |
DISTRICT | = lv_district | |
POSTALCODECITY | = lv_postalcodecity | |
STATE | = lv_state | |
COUNTRY | = lv_country | |
. " BAPI_ADDRESSEMPCH_GETDETAIL |
ABAP code using 7.40 inline data declarations to call FM BAPI_ADDRESSEMPCH_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 BAPIP0006 INTO @DATA(ld_employeenumber). | ||||
"SELECT single TELNR FROM BAPIP0006 INTO @DATA(ld_telephonenumber). | ||||
"SELECT single NAMEOFANSSA FROM BAPIP0006 INTO @DATA(ld_nameofaddresstype). | ||||
"SELECT single NAMEOFSTATE FROM BAPIP0006 INTO @DATA(ld_nameofstate). | ||||
"SELECT single NAMEOFLAND1 FROM BAPIP0006 INTO @DATA(ld_nameofcountry). | ||||
"SELECT single DISTANCEINKM FROM BAPIP0006LCH INTO @DATA(ld_distanceinkm). | ||||
"SELECT single DISTANCEINKM1 FROM BAPIP0006LCH INTO @DATA(ld_distanceinkm1). | ||||
"SELECT single WKWNG FROM BAPIP0006 INTO @DATA(ld_companyownedapt). | ||||
"SELECT single BUSROUTE FROM BAPIP0006LCH INTO @DATA(ld_busroute). | ||||
"SELECT single COMMTYPE1 FROM BAPIP0006LCH INTO @DATA(ld_commtype1). | ||||
"SELECT single COMMNUMBER1 FROM BAPIP0006LCH INTO @DATA(ld_commnumber1). | ||||
"SELECT single SUBTY FROM BAPIP0006 INTO @DATA(ld_subtype). | ||||
"SELECT single SUBTY FROM BAPIP0006 INTO @DATA(ld_addresstype). | ||||
"SELECT single COMMTYPE2 FROM BAPIP0006LCH INTO @DATA(ld_commtype2). | ||||
"SELECT single COMMNUMBER2 FROM BAPIP0006LCH INTO @DATA(ld_commnumber2). | ||||
"SELECT single COMMTYPE3 FROM BAPIP0006LCH INTO @DATA(ld_commtype3). | ||||
"SELECT single COMMNUMBER3 FROM BAPIP0006LCH INTO @DATA(ld_commnumber3). | ||||
"SELECT single NAME2 FROM BAPIP0006 INTO @DATA(ld_coname). | ||||
"SELECT single OBJPS FROM BAPIP0006 INTO @DATA(ld_objectid). | ||||
"SELECT single SPRPS FROM BAPIP0006 INTO @DATA(ld_lockindicator). | ||||
"SELECT single STRAS FROM BAPIP0006 INTO @DATA(ld_streetandhouseno). | ||||
"SELECT single ORT01 FROM BAPIP0006 INTO @DATA(ld_city). | ||||
"SELECT single BEGDA FROM BAPIP0006 INTO @DATA(ld_validitybegin). | ||||
"SELECT single ORT02 FROM BAPIP0006 INTO @DATA(ld_district). | ||||
"SELECT single ENDDA FROM BAPIP0006 INTO @DATA(ld_validityend). | ||||
"SELECT single SEQNR FROM BAPIP0006 INTO @DATA(ld_recordnumber). | ||||
"SELECT single PSTLZ FROM BAPIP0006 INTO @DATA(ld_postalcodecity). | ||||
"SELECT single STATE FROM BAPIP0006 INTO @DATA(ld_state). | ||||
"SELECT single LAND1 FROM BAPIP0006 INTO @DATA(ld_country). | ||||
Search for further information about these or an SAP related objects