SAP HR_GB_PENSION Function Module for HR-GB: Pension calculation
HR_GB_PENSION is a standard hr gb pension SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for HR-GB: Pension calculation 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 hr gb pension FM, simply by entering the name HR_GB_PENSION into the relevant SAP transaction such as SE37 or SE38.
Function Group: HRG3
Program Name: SAPLHRG3
Main Program: SAPLHRG3
Appliation area: P
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function HR_GB_PENSION 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_GB_PENSION'"HR-GB: Pension calculation.
EXPORTING
PDATE = "Begin date
MINIMUM = "Checkbox
PENPY = "Pensionable pay
FACTR = "Length of period
FBASE = "
HPAY = "Holiday pay
HWKS = "Holiday weeks
HOLEE = "
HOLER = "
ERPENPY = "HR Payroll: Amount
IMPORTING
PENS_VALUES = "
TEXT = "Error text
PARM1 = "Error parameter 1
PARM2 = "Error parameter 2
PARM3 = "Error parameter 3
CHANGING
PENS = "
TABLES
EXCEP = "Exceptions
EXCEPTIONS
PENSION_SCHEME_NOT_SUPPORTED = 1 SCHEME_ID_NOT_FOUND = 2 USER_EXIT = 3
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_SAPLHRG3_001 HR-GB: User exit for pension calculations
IMPORTING Parameters details for HR_GB_PENSION
PDATE - Begin date
Data type: T549S-PDATEOptional: No
Call by Reference: No ( called with pass by value option)
MINIMUM - Checkbox
Data type: XFELDOptional: No
Call by Reference: No ( called with pass by value option)
PENPY - Pensionable pay
Data type: PC207-BETRGOptional: No
Call by Reference: No ( called with pass by value option)
FACTR - Length of period
Data type: PC207-BETPEOptional: No
Call by Reference: No ( called with pass by value option)
FBASE -
Data type: T511K-KWERTOptional: No
Call by Reference: No ( called with pass by value option)
HPAY - Holiday pay
Data type: PC207-BETRGOptional: No
Call by Reference: No ( called with pass by value option)
HWKS - Holiday weeks
Data type: PGBPNIN-HWKSOptional: No
Call by Reference: No ( called with pass by value option)
HOLEE -
Data type: T5G32-HOLEEOptional: No
Call by Reference: No ( called with pass by value option)
HOLER -
Data type: T5G32-HOLEROptional: No
Call by Reference: No ( called with pass by value option)
ERPENPY - HR Payroll: Amount
Data type: PC207-BETRGOptional: No
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for HR_GB_PENSION
PENS_VALUES -
Data type: RPPENSG0Optional: No
Call by Reference: No ( called with pass by value option)
TEXT - Error text
Data type: COptional: No
Call by Reference: No ( called with pass by value option)
PARM1 - Error parameter 1
Data type: COptional: No
Call by Reference: No ( called with pass by value option)
PARM2 - Error parameter 2
Data type: COptional: No
Call by Reference: No ( called with pass by value option)
PARM3 - Error parameter 3
Data type: COptional: No
Call by Reference: No ( called with pass by value option)
CHANGING Parameters details for HR_GB_PENSION
PENS -
Data type: PC22POptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for HR_GB_PENSION
EXCEP - Exceptions
Data type: PC23NOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
PENSION_SCHEME_NOT_SUPPORTED - An unknown pension scheme has been detected
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
SCHEME_ID_NOT_FOUND - Scheme has not been customized in tables T5G3x
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
USER_EXIT - An error has occured in the customer exit
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for HR_GB_PENSION 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_pens | TYPE PC22P, " | |||
| lt_excep | TYPE STANDARD TABLE OF PC23N, " | |||
| lv_pdate | TYPE T549S-PDATE, " | |||
| lv_pens_values | TYPE RPPENSG0, " | |||
| lv_pension_scheme_not_supported | TYPE RPPENSG0, " | |||
| lv_minimum | TYPE XFELD, " | |||
| lv_text | TYPE C, " | |||
| lv_penpy | TYPE PC207-BETRG, " | |||
| lv_scheme_id_not_found | TYPE PC207, " | |||
| lv_factr | TYPE PC207-BETPE, " | |||
| lv_parm1 | TYPE C, " | |||
| lv_user_exit | TYPE C, " | |||
| lv_fbase | TYPE T511K-KWERT, " | |||
| lv_parm2 | TYPE C, " | |||
| lv_hpay | TYPE PC207-BETRG, " | |||
| lv_parm3 | TYPE C, " | |||
| lv_hwks | TYPE PGBPNIN-HWKS, " | |||
| lv_holee | TYPE T5G32-HOLEE, " | |||
| lv_holer | TYPE T5G32-HOLER, " | |||
| lv_erpenpy | TYPE PC207-BETRG. " |
|   CALL FUNCTION 'HR_GB_PENSION' "HR-GB: Pension calculation |
| EXPORTING | ||
| PDATE | = lv_pdate | |
| MINIMUM | = lv_minimum | |
| PENPY | = lv_penpy | |
| FACTR | = lv_factr | |
| FBASE | = lv_fbase | |
| HPAY | = lv_hpay | |
| HWKS | = lv_hwks | |
| HOLEE | = lv_holee | |
| HOLER | = lv_holer | |
| ERPENPY | = lv_erpenpy | |
| IMPORTING | ||
| PENS_VALUES | = lv_pens_values | |
| TEXT | = lv_text | |
| PARM1 | = lv_parm1 | |
| PARM2 | = lv_parm2 | |
| PARM3 | = lv_parm3 | |
| CHANGING | ||
| PENS | = lv_pens | |
| TABLES | ||
| EXCEP | = lt_excep | |
| EXCEPTIONS | ||
| PENSION_SCHEME_NOT_SUPPORTED = 1 | ||
| SCHEME_ID_NOT_FOUND = 2 | ||
| USER_EXIT = 3 | ||
| . " HR_GB_PENSION | ||
ABAP code using 7.40 inline data declarations to call FM HR_GB_PENSION
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 PDATE FROM T549S INTO @DATA(ld_pdate). | ||||
| "SELECT single BETRG FROM PC207 INTO @DATA(ld_penpy). | ||||
| "SELECT single BETPE FROM PC207 INTO @DATA(ld_factr). | ||||
| "SELECT single KWERT FROM T511K INTO @DATA(ld_fbase). | ||||
| "SELECT single BETRG FROM PC207 INTO @DATA(ld_hpay). | ||||
| "SELECT single HWKS FROM PGBPNIN INTO @DATA(ld_hwks). | ||||
| "SELECT single HOLEE FROM T5G32 INTO @DATA(ld_holee). | ||||
| "SELECT single HOLER FROM T5G32 INTO @DATA(ld_holer). | ||||
| "SELECT single BETRG FROM PC207 INTO @DATA(ld_erpenpy). | ||||
Search for further information about these or an SAP related objects