SAP HR_GET_LEAVE_DATA Function Module for
HR_GET_LEAVE_DATA is a standard hr get leave data 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 get leave data FM, simply by entering the name HR_GET_LEAVE_DATA into the relevant SAP transaction such as SE37 or SE38.
Function Group: HRGL
Program Name: SAPLHRGL
Main Program: SAPLHRGL
Appliation area: P
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:
Function HR_GET_LEAVE_DATA 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_GET_LEAVE_DATA'".
EXPORTING
PERNR = "Personnel number
* CDATUM = SY-DATUM "Key date
* UBEGD = "Start of deduction period
* UENDD = "End of deduction period (key date)
* BEGDA_0005 = '18000101' "From date (IT 0005)
* ENDDA_0005 = '99991231' "To date (IT 0005)
* SEL_MOD = 'S' "Selection mode
* OBJPS_0005 = "Object identification
* LANGU = SY-LANGU "
IMPORTING
ENTITLE = "Entitlement up to key date (cumulated)
ACCOUNT = "Accounted up to key date (cumulated)
ORDERED = "Requested up to key date (cumulated)
REDUCED = "Compensated up to key date (cumulated)
UNIT = "
ISOCODE = "
UNITTEXT = "
TABLES
* XANSP = "Table of individual values
* URART_SEL = "Selection options for leave types
* I0005 = "Infotype table leave entitlement
* I0083 = "Infotype table leave compensation
* I0003 = "
* I0001 = "
EXCEPTIONS
INFTY_0005_NOT_DEFINED = 1 INFTY_0003_NOT_DEFINED = 2 INFTY_0083_NOT_DEFINED = 3 MISSING_AUTHORITY = 4 OLD_NE_NEW_PC_VERSION_NR = 5 INFTY_0001_NOT_DEFINED = 6
IMPORTING Parameters details for HR_GET_LEAVE_DATA
PERNR - Personnel number
Data type: PERNR-PERNROptional: No
Call by Reference: No ( called with pass by value option)
CDATUM - Key date
Data type: P0005-UBE01Default: SY-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)
UBEGD - Start of deduction period
Data type: P0005-UBE01Optional: Yes
Call by Reference: No ( called with pass by value option)
UENDD - End of deduction period (key date)
Data type: P0005-UEN01Optional: Yes
Call by Reference: No ( called with pass by value option)
BEGDA_0005 - From date (IT 0005)
Data type: P0005-BEGDADefault: '18000101'
Optional: Yes
Call by Reference: No ( called with pass by value option)
ENDDA_0005 - To date (IT 0005)
Data type: P0005-ENDDADefault: '99991231'
Optional: Yes
Call by Reference: No ( called with pass by value option)
SEL_MOD - Selection mode
Data type: TPTIM_SELMODDefault: 'S'
Optional: Yes
Call by Reference: No ( called with pass by value option)
OBJPS_0005 - Object identification
Data type: P0005-OBJPSOptional: Yes
Call by Reference: No ( called with pass by value option)
LANGU -
Data type: SY-LANGUDefault: SY-LANGU
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for HR_GET_LEAVE_DATA
ENTITLE - Entitlement up to key date (cumulated)
Data type: TPTIM_ENTITLEOptional: No
Call by Reference: No ( called with pass by value option)
ACCOUNT - Accounted up to key date (cumulated)
Data type: TPTIM_ACCOUNTOptional: No
Call by Reference: No ( called with pass by value option)
ORDERED - Requested up to key date (cumulated)
Data type: TPTIM_ORDEREDOptional: No
Call by Reference: No ( called with pass by value option)
REDUCED - Compensated up to key date (cumulated)
Data type: TPTIM_REDUCEOptional: No
Call by Reference: No ( called with pass by value option)
UNIT -
Data type: TPTIM_UNITOptional: No
Call by Reference: No ( called with pass by value option)
ISOCODE -
Data type: TPTIM_ISOCDOptional: No
Call by Reference: No ( called with pass by value option)
UNITTEXT -
Data type: TPTIM_UTEXTOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for HR_GET_LEAVE_DATA
XANSP - Table of individual values
Data type: TPTIM_XANSPOptional: Yes
Call by Reference: No ( called with pass by value option)
URART_SEL - Selection options for leave types
Data type: TPTIM_URSELOptional: Yes
Call by Reference: No ( called with pass by value option)
I0005 - Infotype table leave entitlement
Data type: P0005Optional: Yes
Call by Reference: No ( called with pass by value option)
I0083 - Infotype table leave compensation
Data type: P0083Optional: Yes
Call by Reference: No ( called with pass by value option)
I0003 -
Data type: P0003Optional: Yes
Call by Reference: No ( called with pass by value option)
I0001 -
Data type: P0001Optional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
INFTY_0005_NOT_DEFINED - IT 0005 not in T582A
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INFTY_0003_NOT_DEFINED - IT 0083 not in T582A
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INFTY_0083_NOT_DEFINED - IT 0083 not in T582A
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
MISSING_AUTHORITY - No authorization to read ITs
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
OLD_NE_NEW_PC_VERSION_NR - Version of cluster PC is obsolete
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INFTY_0001_NOT_DEFINED -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for HR_GET_LEAVE_DATA 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_pernr | TYPE PERNR-PERNR, " | |||
lt_xansp | TYPE STANDARD TABLE OF TPTIM_XANSP, " | |||
lv_entitle | TYPE TPTIM_ENTITLE, " | |||
lv_infty_0005_not_defined | TYPE TPTIM_ENTITLE, " | |||
lv_cdatum | TYPE P0005-UBE01, " SY-DATUM | |||
lv_account | TYPE TPTIM_ACCOUNT, " | |||
lt_urart_sel | TYPE STANDARD TABLE OF TPTIM_URSEL, " | |||
lv_infty_0003_not_defined | TYPE TPTIM_URSEL, " | |||
lt_i0005 | TYPE STANDARD TABLE OF P0005, " | |||
lv_ubegd | TYPE P0005-UBE01, " | |||
lv_ordered | TYPE TPTIM_ORDERED, " | |||
lv_infty_0083_not_defined | TYPE TPTIM_ORDERED, " | |||
lt_i0083 | TYPE STANDARD TABLE OF P0083, " | |||
lv_uendd | TYPE P0005-UEN01, " | |||
lv_reduced | TYPE TPTIM_REDUCE, " | |||
lv_missing_authority | TYPE TPTIM_REDUCE, " | |||
lv_unit | TYPE TPTIM_UNIT, " | |||
lt_i0003 | TYPE STANDARD TABLE OF P0003, " | |||
lv_begda_0005 | TYPE P0005-BEGDA, " '18000101' | |||
lv_old_ne_new_pc_version_nr | TYPE P0005, " | |||
lt_i0001 | TYPE STANDARD TABLE OF P0001, " | |||
lv_isocode | TYPE TPTIM_ISOCD, " | |||
lv_endda_0005 | TYPE P0005-ENDDA, " '99991231' | |||
lv_infty_0001_not_defined | TYPE P0005, " | |||
lv_sel_mod | TYPE TPTIM_SELMOD, " 'S' | |||
lv_unittext | TYPE TPTIM_UTEXT, " | |||
lv_objps_0005 | TYPE P0005-OBJPS, " | |||
lv_langu | TYPE SY-LANGU. " SY-LANGU |
  CALL FUNCTION 'HR_GET_LEAVE_DATA' " |
EXPORTING | ||
PERNR | = lv_pernr | |
CDATUM | = lv_cdatum | |
UBEGD | = lv_ubegd | |
UENDD | = lv_uendd | |
BEGDA_0005 | = lv_begda_0005 | |
ENDDA_0005 | = lv_endda_0005 | |
SEL_MOD | = lv_sel_mod | |
OBJPS_0005 | = lv_objps_0005 | |
LANGU | = lv_langu | |
IMPORTING | ||
ENTITLE | = lv_entitle | |
ACCOUNT | = lv_account | |
ORDERED | = lv_ordered | |
REDUCED | = lv_reduced | |
UNIT | = lv_unit | |
ISOCODE | = lv_isocode | |
UNITTEXT | = lv_unittext | |
TABLES | ||
XANSP | = lt_xansp | |
URART_SEL | = lt_urart_sel | |
I0005 | = lt_i0005 | |
I0083 | = lt_i0083 | |
I0003 | = lt_i0003 | |
I0001 | = lt_i0001 | |
EXCEPTIONS | ||
INFTY_0005_NOT_DEFINED = 1 | ||
INFTY_0003_NOT_DEFINED = 2 | ||
INFTY_0083_NOT_DEFINED = 3 | ||
MISSING_AUTHORITY = 4 | ||
OLD_NE_NEW_PC_VERSION_NR = 5 | ||
INFTY_0001_NOT_DEFINED = 6 | ||
. " HR_GET_LEAVE_DATA |
ABAP code using 7.40 inline data declarations to call FM HR_GET_LEAVE_DATA
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_pernr). | ||||
"SELECT single UBE01 FROM P0005 INTO @DATA(ld_cdatum). | ||||
DATA(ld_cdatum) | = SY-DATUM. | |||
"SELECT single UBE01 FROM P0005 INTO @DATA(ld_ubegd). | ||||
"SELECT single UEN01 FROM P0005 INTO @DATA(ld_uendd). | ||||
"SELECT single BEGDA FROM P0005 INTO @DATA(ld_begda_0005). | ||||
DATA(ld_begda_0005) | = '18000101'. | |||
"SELECT single ENDDA FROM P0005 INTO @DATA(ld_endda_0005). | ||||
DATA(ld_endda_0005) | = '99991231'. | |||
DATA(ld_sel_mod) | = 'S'. | |||
"SELECT single OBJPS FROM P0005 INTO @DATA(ld_objps_0005). | ||||
"SELECT single LANGU FROM SY INTO @DATA(ld_langu). | ||||
DATA(ld_langu) | = SY-LANGU. | |||
Search for further information about these or an SAP related objects