SAP PGET_ABSENCES Function Module for Read Leave Entitlement and absences
PGET_ABSENCES is a standard pget absences 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 Leave Entitlement and absences 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 pget absences FM, simply by entering the name PGET_ABSENCES into the relevant SAP transaction such as SE37 or SE38.
Function Group: PZWC
Program Name: SAPLPZWC
Main Program:
Appliation area: P
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function PGET_ABSENCES 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 'PGET_ABSENCES'"Read Leave Entitlement and absences.
EXPORTING
T_PERNR = "
* DATUM = SY-DATUM "
* DATEND = SY-DATUM "SYSTEM: Current date
IMPORTING
MOLGA = "
ABKRS = "
PABRJ = "
PABRP = "
TABLES
* ZABSENCE = "Attendance or absence quota type
EXCEPTIONS
NO_INFOTYPE_1 = 1 T500P_NOT_SETUP = 2 T549A_NOT_SETUP = 3 T503_NOT_SETUP = 4 T569V_NOT_SETUP = 5 T001P_NOT_SETUP = 6
IMPORTING Parameters details for PGET_ABSENCES
T_PERNR -
Data type: PERNR-PERNROptional: No
Call by Reference: No ( called with pass by value option)
DATUM -
Data type: SY-DATUMDefault: SY-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)
DATEND - SYSTEM: Current date
Data type: SY-DATUMDefault: SY-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for PGET_ABSENCES
MOLGA -
Data type: T500P-MOLGAOptional: No
Call by Reference: Yes
ABKRS -
Data type: P0001-ABKRSOptional: No
Call by Reference: Yes
PABRJ -
Data type: T569V-PABRJOptional: No
Call by Reference: Yes
PABRP -
Data type: T569V-PABRPOptional: No
Call by Reference: Yes
TABLES Parameters details for PGET_ABSENCES
ZABSENCE - Attendance or absence quota type
Data type: PLEAVE_ABSENCEOptional: Yes
Call by Reference: Yes
EXCEPTIONS details
NO_INFOTYPE_1 -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
T500P_NOT_SETUP -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
T549A_NOT_SETUP -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
T503_NOT_SETUP -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
T569V_NOT_SETUP -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
T001P_NOT_SETUP -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for PGET_ABSENCES 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_molga | TYPE T500P-MOLGA, " | |||
| lv_t_pernr | TYPE PERNR-PERNR, " | |||
| lt_zabsence | TYPE STANDARD TABLE OF PLEAVE_ABSENCE, " | |||
| lv_no_infotype_1 | TYPE PLEAVE_ABSENCE, " | |||
| lv_abkrs | TYPE P0001-ABKRS, " | |||
| lv_datum | TYPE SY-DATUM, " SY-DATUM | |||
| lv_t500p_not_setup | TYPE SY, " | |||
| lv_pabrj | TYPE T569V-PABRJ, " | |||
| lv_datend | TYPE SY-DATUM, " SY-DATUM | |||
| lv_t549a_not_setup | TYPE SY, " | |||
| lv_pabrp | TYPE T569V-PABRP, " | |||
| lv_t503_not_setup | TYPE T569V, " | |||
| lv_t569v_not_setup | TYPE T569V, " | |||
| lv_t001p_not_setup | TYPE T569V. " |
|   CALL FUNCTION 'PGET_ABSENCES' "Read Leave Entitlement and absences |
| EXPORTING | ||
| T_PERNR | = lv_t_pernr | |
| DATUM | = lv_datum | |
| DATEND | = lv_datend | |
| IMPORTING | ||
| MOLGA | = lv_molga | |
| ABKRS | = lv_abkrs | |
| PABRJ | = lv_pabrj | |
| PABRP | = lv_pabrp | |
| TABLES | ||
| ZABSENCE | = lt_zabsence | |
| EXCEPTIONS | ||
| NO_INFOTYPE_1 = 1 | ||
| T500P_NOT_SETUP = 2 | ||
| T549A_NOT_SETUP = 3 | ||
| T503_NOT_SETUP = 4 | ||
| T569V_NOT_SETUP = 5 | ||
| T001P_NOT_SETUP = 6 | ||
| . " PGET_ABSENCES | ||
ABAP code using 7.40 inline data declarations to call FM PGET_ABSENCES
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 MOLGA FROM T500P INTO @DATA(ld_molga). | ||||
| "SELECT single PERNR FROM PERNR INTO @DATA(ld_t_pernr). | ||||
| "SELECT single ABKRS FROM P0001 INTO @DATA(ld_abkrs). | ||||
| "SELECT single DATUM FROM SY INTO @DATA(ld_datum). | ||||
| DATA(ld_datum) | = SY-DATUM. | |||
| "SELECT single PABRJ FROM T569V INTO @DATA(ld_pabrj). | ||||
| "SELECT single DATUM FROM SY INTO @DATA(ld_datend). | ||||
| DATA(ld_datend) | = SY-DATUM. | |||
| "SELECT single PABRP FROM T569V INTO @DATA(ld_pabrp). | ||||
Search for further information about these or an SAP related objects