SAP HR_LEAVING_DATE Function Module for









HR_LEAVING_DATE is a standard hr leaving date SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, 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 hr leaving date FM, simply by entering the name HR_LEAVING_DATE into the relevant SAP transaction such as SE37 or SE38.

Function Group: RPAI
Program Name: SAPLRPAI
Main Program: SAPLRPAI
Appliation area: P
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:



Function HR_LEAVING_DATE 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 'HR_LEAVING_DATE'"
EXPORTING
PERSNR = "Employee's personnel number
* RCLAS = "
* BEGDA = '18000101' "
* ENDDA = '99991231' "
* VARKY = "
* INITIALIZE_PS_BUFFER = 'X' "

IMPORTING
LEAVINGDATE = "Leaving date

TABLES
* LEAVING_DATES = "Table of all leaving dates

EXCEPTIONS
LEAVING_DATE_NOT_FOUND = 1 PERNR_NOT_ASSIGNED = 2
.




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_SAPLRPAI_001 User Exit for HR_ENTRY_DATE
EXIT_SAPLRPAI_002 User Exit for HR_LEAVING_DATE

IMPORTING Parameters details for HR_LEAVING_DATE

PERSNR - Employee's personnel number

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

RCLAS -

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

BEGDA -

Data type: P0000-BEGDA
Default: '18000101'
Optional: Yes
Call by Reference: No ( called with pass by value option)

ENDDA -

Data type: P0000-ENDDA
Default: '99991231'
Optional: Yes
Call by Reference: No ( called with pass by value option)

VARKY -

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

INITIALIZE_PS_BUFFER -

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

EXPORTING Parameters details for HR_LEAVING_DATE

LEAVINGDATE - Leaving date

Data type: P0000-BEGDA
Optional: No
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for HR_LEAVING_DATE

LEAVING_DATES - Table of all leaving dates

Data type: HIDA
Optional: Yes
Call by Reference: Yes

EXCEPTIONS details

LEAVING_DATE_NOT_FOUND - No leaving date found

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

PERNR_NOT_ASSIGNED - Personnel number not assigned yet

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

Copy and paste ABAP code example for HR_LEAVING_DATE 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_persnr  TYPE PERNR-PERNR, "   
lv_leavingdate  TYPE P0000-BEGDA, "   
lt_leaving_dates  TYPE STANDARD TABLE OF HIDA, "   
lv_leaving_date_not_found  TYPE HIDA, "   
lv_rclas  TYPE PME36-RCLAS, "   
lv_pernr_not_assigned  TYPE PME36, "   
lv_begda  TYPE P0000-BEGDA, "   '18000101'
lv_endda  TYPE P0000-ENDDA, "   '99991231'
lv_varky  TYPE PME36-VARKY, "   
lv_initialize_ps_buffer  TYPE XFELD. "   'X'

  CALL FUNCTION 'HR_LEAVING_DATE'  "
    EXPORTING
         PERSNR = lv_persnr
         RCLAS = lv_rclas
         BEGDA = lv_begda
         ENDDA = lv_endda
         VARKY = lv_varky
         INITIALIZE_PS_BUFFER = lv_initialize_ps_buffer
    IMPORTING
         LEAVINGDATE = lv_leavingdate
    TABLES
         LEAVING_DATES = lt_leaving_dates
    EXCEPTIONS
        LEAVING_DATE_NOT_FOUND = 1
        PERNR_NOT_ASSIGNED = 2
. " HR_LEAVING_DATE




ABAP code using 7.40 inline data declarations to call FM HR_LEAVING_DATE

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 PERNR INTO @DATA(ld_persnr).
 
"SELECT single BEGDA FROM P0000 INTO @DATA(ld_leavingdate).
 
 
 
"SELECT single RCLAS FROM PME36 INTO @DATA(ld_rclas).
 
 
"SELECT single BEGDA FROM P0000 INTO @DATA(ld_begda).
DATA(ld_begda) = '18000101'.
 
"SELECT single ENDDA FROM P0000 INTO @DATA(ld_endda).
DATA(ld_endda) = '99991231'.
 
"SELECT single VARKY FROM PME36 INTO @DATA(ld_varky).
 
DATA(ld_initialize_ps_buffer) = 'X'.
 


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!