SAP BAPI_EMPLOYEE_GETDATA Function Module for Find Personnel Numbers for Specified Search Criteria









BAPI_EMPLOYEE_GETDATA is a standard bapi employee getdata SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Find Personnel Numbers for Specified Search Criteria 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 employee getdata FM, simply by entering the name BAPI_EMPLOYEE_GETDATA into the relevant SAP transaction such as SE37 or SE38.

Function Group: RH65
Program Name: SAPLRH65
Main Program: SAPLRH65
Appliation area: P
Release date: 23-Sep-1997
Mode(Normal, Remote etc): Remote-Enabled
Update:



Function BAPI_EMPLOYEE_GETDATA 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_EMPLOYEE_GETDATA'"Find Personnel Numbers for Specified Search Criteria
EXPORTING
* EMPLOYEE_ID = "
* POSTXT = "Search String for Position
* COSTCENTER = "Search String for Cost Center
* BLDING_NO = "Search String for Building Number
* ROOM_NO = "Search String for Room Number
* PHONE_NO = "Search String for Telephone Number
* LIPLATE_NO = "Search String for License Plate Number
* USERID = "Search String for Communications ID
* DATE = SY-DATUM "Search Date
* EXTENSION = "Telephone extension
* READDB = FALSE "Re-Read Database
* LASTNAME_M = "Search String for Last Name
* ORGTXT_LG = "Search String for Organizational Unit (long)
* JOBTXT_LG = "Search String for Job (long)
* POSTXT_LG = "Search String for Position (long)
* AUTHORITY_CHECK = 'X' "Authorization check
* FSTNAME_M = "Search String for First Name
* FST_NAME_K = "Search String for First Name (Katakana)
* LST_NAME_K = "Search String for Last Name (Katakana)
* FST_NAME_R = "Search String for First Name (Romaji)
* LST_NAME_R = "Search String for Last Name (Romaji)
* ORGTXT = "Search String for Organizational Unit
* JOBTXT = "Search String for Job

IMPORTING
RETURN = "Structure for Return Code

TABLES
* ORG_ASSIGNMENT = "Results List for Organizational Assignment
* PERSONAL_DATA = "Results List for Personal Data
* INTERNAL_CONTROL = "Results List for Internal Control
* COMMUNICATION = "Results List for Communication
* ARCHIVELINK = "Results List for Optical Archive
.




Customer Function user exits

Below is a list of CUSTOMER FUNCTION exit user exits that are available within this program and maybe relevant for this FM.
EXIT_SAPLRH65_001 Search String Enhancement

IMPORTING Parameters details for BAPI_EMPLOYEE_GETDATA

EMPLOYEE_ID -

Data type: BAPIEMPLB-PERNO
Optional: Yes
Call by Reference: No ( called with pass by value option)

POSTXT - Search String for Position

Data type: BAPIEMPLB-POSTXT
Optional: Yes
Call by Reference: No ( called with pass by value option)

COSTCENTER - Search String for Cost Center

Data type: BAPIEMPLB-COSTCENTER
Optional: Yes
Call by Reference: No ( called with pass by value option)

BLDING_NO - Search String for Building Number

Data type: BAPIEMPLB-BLDING_NO
Optional: Yes
Call by Reference: No ( called with pass by value option)

ROOM_NO - Search String for Room Number

Data type: BAPIEMPLB-ROOM_NO
Optional: Yes
Call by Reference: No ( called with pass by value option)

PHONE_NO - Search String for Telephone Number

Data type: BAPIEMPLB-PHONE_NO
Optional: Yes
Call by Reference: No ( called with pass by value option)

LIPLATE_NO - Search String for License Plate Number

Data type: BAPIEMPLB-LIPLATE_NO
Optional: Yes
Call by Reference: No ( called with pass by value option)

USERID - Search String for Communications ID

Data type: BAPIEMPLB-USERID
Optional: Yes
Call by Reference: No ( called with pass by value option)

DATE - Search Date

Data type: BAPIEMPLB-DATE
Default: SY-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXTENSION - Telephone extension

Data type: BAPIEMPLB-EXTENSION
Optional: Yes
Call by Reference: No ( called with pass by value option)

READDB - Re-Read Database

Data type: BAPIEMPLB-READDB
Default: FALSE
Optional: Yes
Call by Reference: No ( called with pass by value option)

LASTNAME_M - Search String for Last Name

Data type: BAPIEMPLB-LASTNAME_M
Optional: Yes
Call by Reference: No ( called with pass by value option)

ORGTXT_LG - Search String for Organizational Unit (long)

Data type: BAPIP0001B-ORGTXT
Optional: Yes
Call by Reference: No ( called with pass by value option)

JOBTXT_LG - Search String for Job (long)

Data type: BAPIP0001B-JOBTXT
Optional: Yes
Call by Reference: No ( called with pass by value option)

POSTXT_LG - Search String for Position (long)

Data type: BAPIP0001B-POSTXT
Optional: Yes
Call by Reference: No ( called with pass by value option)

AUTHORITY_CHECK - Authorization check

Data type: CHAR1
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

FSTNAME_M - Search String for First Name

Data type: BAPIEMPLB-FSTNAME_M
Optional: Yes
Call by Reference: No ( called with pass by value option)

FST_NAME_K - Search String for First Name (Katakana)

Data type: BAPIEMPLB-FST_NAME_K
Optional: Yes
Call by Reference: No ( called with pass by value option)

LST_NAME_K - Search String for Last Name (Katakana)

Data type: BAPIEMPLB-LST_NAME_K
Optional: Yes
Call by Reference: No ( called with pass by value option)

FST_NAME_R - Search String for First Name (Romaji)

Data type: BAPIEMPLB-FST_NAME_R
Optional: Yes
Call by Reference: No ( called with pass by value option)

LST_NAME_R - Search String for Last Name (Romaji)

Data type: BAPIEMPLB-LST_NAME_R
Optional: Yes
Call by Reference: No ( called with pass by value option)

ORGTXT - Search String for Organizational Unit

Data type: BAPIEMPLB-ORGTXT
Optional: Yes
Call by Reference: No ( called with pass by value option)

JOBTXT - Search String for Job

Data type: BAPIEMPLB-JOBTXT
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for BAPI_EMPLOYEE_GETDATA

RETURN - Structure for Return Code

Data type: BAPIRETURN
Optional: No
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for BAPI_EMPLOYEE_GETDATA

ORG_ASSIGNMENT - Results List for Organizational Assignment

Data type: BAPIP0001B
Optional: Yes
Call by Reference: No ( called with pass by value option)

PERSONAL_DATA - Results List for Personal Data

Data type: BAPIP0002B
Optional: Yes
Call by Reference: No ( called with pass by value option)

INTERNAL_CONTROL - Results List for Internal Control

Data type: BAPIP0032B
Optional: Yes
Call by Reference: No ( called with pass by value option)

COMMUNICATION - Results List for Communication

Data type: BAPIP0105B
Optional: Yes
Call by Reference: No ( called with pass by value option)

ARCHIVELINK - Results List for Optical Archive

Data type: BAPITOAV0
Optional: Yes
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for BAPI_EMPLOYEE_GETDATA 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 BAPIRETURN, "   
lv_employee_id  TYPE BAPIEMPLB-PERNO, "   
lt_org_assignment  TYPE STANDARD TABLE OF BAPIP0001B, "   
lv_postxt  TYPE BAPIEMPLB-POSTXT, "   
lv_costcenter  TYPE BAPIEMPLB-COSTCENTER, "   
lv_blding_no  TYPE BAPIEMPLB-BLDING_NO, "   
lv_room_no  TYPE BAPIEMPLB-ROOM_NO, "   
lv_phone_no  TYPE BAPIEMPLB-PHONE_NO, "   
lv_liplate_no  TYPE BAPIEMPLB-LIPLATE_NO, "   
lv_userid  TYPE BAPIEMPLB-USERID, "   
lv_date  TYPE BAPIEMPLB-DATE, "   SY-DATUM
lv_extension  TYPE BAPIEMPLB-EXTENSION, "   
lv_readdb  TYPE BAPIEMPLB-READDB, "   FALSE
lv_lastname_m  TYPE BAPIEMPLB-LASTNAME_M, "   
lt_personal_data  TYPE STANDARD TABLE OF BAPIP0002B, "   
lv_orgtxt_lg  TYPE BAPIP0001B-ORGTXT, "   
lv_jobtxt_lg  TYPE BAPIP0001B-JOBTXT, "   
lv_postxt_lg  TYPE BAPIP0001B-POSTXT, "   
lv_authority_check  TYPE CHAR1, "   'X'
lv_fstname_m  TYPE BAPIEMPLB-FSTNAME_M, "   
lt_internal_control  TYPE STANDARD TABLE OF BAPIP0032B, "   
lv_fst_name_k  TYPE BAPIEMPLB-FST_NAME_K, "   
lt_communication  TYPE STANDARD TABLE OF BAPIP0105B, "   
lv_lst_name_k  TYPE BAPIEMPLB-LST_NAME_K, "   
lt_archivelink  TYPE STANDARD TABLE OF BAPITOAV0, "   
lv_fst_name_r  TYPE BAPIEMPLB-FST_NAME_R, "   
lv_lst_name_r  TYPE BAPIEMPLB-LST_NAME_R, "   
lv_orgtxt  TYPE BAPIEMPLB-ORGTXT, "   
lv_jobtxt  TYPE BAPIEMPLB-JOBTXT. "   

  CALL FUNCTION 'BAPI_EMPLOYEE_GETDATA'  "Find Personnel Numbers for Specified Search Criteria
    EXPORTING
         EMPLOYEE_ID = lv_employee_id
         POSTXT = lv_postxt
         COSTCENTER = lv_costcenter
         BLDING_NO = lv_blding_no
         ROOM_NO = lv_room_no
         PHONE_NO = lv_phone_no
         LIPLATE_NO = lv_liplate_no
         USERID = lv_userid
         DATE = lv_date
         EXTENSION = lv_extension
         READDB = lv_readdb
         LASTNAME_M = lv_lastname_m
         ORGTXT_LG = lv_orgtxt_lg
         JOBTXT_LG = lv_jobtxt_lg
         POSTXT_LG = lv_postxt_lg
         AUTHORITY_CHECK = lv_authority_check
         FSTNAME_M = lv_fstname_m
         FST_NAME_K = lv_fst_name_k
         LST_NAME_K = lv_lst_name_k
         FST_NAME_R = lv_fst_name_r
         LST_NAME_R = lv_lst_name_r
         ORGTXT = lv_orgtxt
         JOBTXT = lv_jobtxt
    IMPORTING
         RETURN = lv_return
    TABLES
         ORG_ASSIGNMENT = lt_org_assignment
         PERSONAL_DATA = lt_personal_data
         INTERNAL_CONTROL = lt_internal_control
         COMMUNICATION = lt_communication
         ARCHIVELINK = lt_archivelink
. " BAPI_EMPLOYEE_GETDATA




ABAP code using 7.40 inline data declarations to call FM BAPI_EMPLOYEE_GETDATA

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 PERNO FROM BAPIEMPLB INTO @DATA(ld_employee_id).
 
 
"SELECT single POSTXT FROM BAPIEMPLB INTO @DATA(ld_postxt).
 
"SELECT single COSTCENTER FROM BAPIEMPLB INTO @DATA(ld_costcenter).
 
"SELECT single BLDING_NO FROM BAPIEMPLB INTO @DATA(ld_blding_no).
 
"SELECT single ROOM_NO FROM BAPIEMPLB INTO @DATA(ld_room_no).
 
"SELECT single PHONE_NO FROM BAPIEMPLB INTO @DATA(ld_phone_no).
 
"SELECT single LIPLATE_NO FROM BAPIEMPLB INTO @DATA(ld_liplate_no).
 
"SELECT single USERID FROM BAPIEMPLB INTO @DATA(ld_userid).
 
"SELECT single DATE FROM BAPIEMPLB INTO @DATA(ld_date).
DATA(ld_date) = SY-DATUM.
 
"SELECT single EXTENSION FROM BAPIEMPLB INTO @DATA(ld_extension).
 
"SELECT single READDB FROM BAPIEMPLB INTO @DATA(ld_readdb).
DATA(ld_readdb) = FALSE.
 
"SELECT single LASTNAME_M FROM BAPIEMPLB INTO @DATA(ld_lastname_m).
 
 
"SELECT single ORGTXT FROM BAPIP0001B INTO @DATA(ld_orgtxt_lg).
 
"SELECT single JOBTXT FROM BAPIP0001B INTO @DATA(ld_jobtxt_lg).
 
"SELECT single POSTXT FROM BAPIP0001B INTO @DATA(ld_postxt_lg).
 
DATA(ld_authority_check) = 'X'.
 
"SELECT single FSTNAME_M FROM BAPIEMPLB INTO @DATA(ld_fstname_m).
 
 
"SELECT single FST_NAME_K FROM BAPIEMPLB INTO @DATA(ld_fst_name_k).
 
 
"SELECT single LST_NAME_K FROM BAPIEMPLB INTO @DATA(ld_lst_name_k).
 
 
"SELECT single FST_NAME_R FROM BAPIEMPLB INTO @DATA(ld_fst_name_r).
 
"SELECT single LST_NAME_R FROM BAPIEMPLB INTO @DATA(ld_lst_name_r).
 
"SELECT single ORGTXT FROM BAPIEMPLB INTO @DATA(ld_orgtxt).
 
"SELECT single JOBTXT FROM BAPIEMPLB INTO @DATA(ld_jobtxt).
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!