SAP RH_GET_COMPENSATION Function Module for
RH_GET_COMPENSATION is a standard rh get compensation 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 rh get compensation FM, simply by entering the name RH_GET_COMPENSATION into the relevant SAP transaction such as SE37 or SE38.
Function Group: HRTEM00COMP
Program Name: SAPLHRTEM00COMP
Main Program:
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function RH_GET_COMPENSATION 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 'RH_GET_COMPENSATION'".
EXPORTING
* BEGDA = SY-DATUM "
* ENDDA = SY-DATUM "
* ISTAT = "
* LOCAL_CURR = "
* STORNO = 'X' "
* BOOKING = 'X' "
TABLES
OBJECT = "
* COMP_TAB = "
* SUM_TAB = "
* INFOTYPE1001 = "
EXCEPTIONS
BEGDA_GREATER_ENDDA = 1 OBJECT_EMPTY = 2 NOTHING_FOUND = 3
IMPORTING Parameters details for RH_GET_COMPENSATION
BEGDA -
Data type: PLOG-BEGDADefault: SY-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)
ENDDA -
Data type: PLOG-ENDDADefault: SY-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)
ISTAT -
Data type: PLOG-ISTATOptional: Yes
Call by Reference: No ( called with pass by value option)
LOCAL_CURR -
Data type: HRVCOMP_DATA-CURRENCYOptional: Yes
Call by Reference: No ( called with pass by value option)
STORNO -
Data type: HRRHV1-FLAGRDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
BOOKING -
Data type: HRRHV1-FLAGRDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for RH_GET_COMPENSATION
OBJECT -
Data type: HRSOBIDOptional: No
Call by Reference: Yes
COMP_TAB -
Data type: HRVCOMP_DATAOptional: Yes
Call by Reference: Yes
SUM_TAB -
Data type: HRVCOMP_DATAOptional: Yes
Call by Reference: Yes
INFOTYPE1001 -
Data type: HRI1001Optional: Yes
Call by Reference: Yes
EXCEPTIONS details
BEGDA_GREATER_ENDDA -
Data type:Optional: No
Call by Reference: Yes
OBJECT_EMPTY -
Data type:Optional: No
Call by Reference: Yes
NOTHING_FOUND -
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for RH_GET_COMPENSATION 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_begda | TYPE PLOG-BEGDA, " SY-DATUM | |||
| lt_object | TYPE STANDARD TABLE OF HRSOBID, " | |||
| lv_begda_greater_endda | TYPE HRSOBID, " | |||
| lv_endda | TYPE PLOG-ENDDA, " SY-DATUM | |||
| lt_comp_tab | TYPE STANDARD TABLE OF HRVCOMP_DATA, " | |||
| lv_object_empty | TYPE HRVCOMP_DATA, " | |||
| lv_istat | TYPE PLOG-ISTAT, " | |||
| lt_sum_tab | TYPE STANDARD TABLE OF HRVCOMP_DATA, " | |||
| lv_nothing_found | TYPE HRVCOMP_DATA, " | |||
| lv_local_curr | TYPE HRVCOMP_DATA-CURRENCY, " | |||
| lt_infotype1001 | TYPE STANDARD TABLE OF HRI1001, " | |||
| lv_storno | TYPE HRRHV1-FLAGR, " 'X' | |||
| lv_booking | TYPE HRRHV1-FLAGR. " 'X' |
|   CALL FUNCTION 'RH_GET_COMPENSATION' " |
| EXPORTING | ||
| BEGDA | = lv_begda | |
| ENDDA | = lv_endda | |
| ISTAT | = lv_istat | |
| LOCAL_CURR | = lv_local_curr | |
| STORNO | = lv_storno | |
| BOOKING | = lv_booking | |
| TABLES | ||
| OBJECT | = lt_object | |
| COMP_TAB | = lt_comp_tab | |
| SUM_TAB | = lt_sum_tab | |
| INFOTYPE1001 | = lt_infotype1001 | |
| EXCEPTIONS | ||
| BEGDA_GREATER_ENDDA = 1 | ||
| OBJECT_EMPTY = 2 | ||
| NOTHING_FOUND = 3 | ||
| . " RH_GET_COMPENSATION | ||
ABAP code using 7.40 inline data declarations to call FM RH_GET_COMPENSATION
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 BEGDA FROM PLOG INTO @DATA(ld_begda). | ||||
| DATA(ld_begda) | = SY-DATUM. | |||
| "SELECT single ENDDA FROM PLOG INTO @DATA(ld_endda). | ||||
| DATA(ld_endda) | = SY-DATUM. | |||
| "SELECT single ISTAT FROM PLOG INTO @DATA(ld_istat). | ||||
| "SELECT single CURRENCY FROM HRVCOMP_DATA INTO @DATA(ld_local_curr). | ||||
| "SELECT single FLAGR FROM HRRHV1 INTO @DATA(ld_storno). | ||||
| DATA(ld_storno) | = 'X'. | |||
| "SELECT single FLAGR FROM HRRHV1 INTO @DATA(ld_booking). | ||||
| DATA(ld_booking) | = 'X'. | |||
Search for further information about these or an SAP related objects