SAP HR_RU_SEN_CALCULATE_COMPLETE Function Module for Employment Period Calculation for Calculation Process
HR_RU_SEN_CALCULATE_COMPLETE is a standard hr ru sen calculate complete SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Employment Period Calculation for Calculation Process 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 ru sen calculate complete FM, simply by entering the name HR_RU_SEN_CALCULATE_COMPLETE into the relevant SAP transaction such as SE37 or SE38.
Function Group: HRPADRU_RULES2
Program Name: SAPLHRPADRU_RULES2
Main Program: SAPLHRPADRU_RULES2
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:
Function HR_RU_SEN_CALCULATE_COMPLETE 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_RU_SEN_CALCULATE_COMPLETE'"Employment Period Calculation for Calculation Process.
EXPORTING
ID_PERNR = "Personnel Number
* ID_ENDDA = "Evaluation end
* IS_DURATION = "Duration
* ID_PROTO = "Log for Employment Period Calculation
* IT_PSTEP_TSPST = "Override Valuation Model for Each Process Step
* ID_SCODE = "Object Abbreviation
* ID_STEXT = "Object Name
* ID_MOLGA = "Country Grouping
ID_PROCE = "Calculation Process
* ID_PSTEP = "Process step
* ID_SEL_DATE = SY-DATUM "Selection Date
* IR_GPCONTEXT = "
* ID_GPVAL = "Grouping Value
* ID_CALTY = "Calculation Type
* ID_BEGDA = "Evaluation Start
IMPORTING
ED_DATE = "Key Date Result
ES_DURATION = "Duration Result
ET_WEIGHT_PERIOD = "Weighted Periods
ET_WEIGHT_PEAK = "Weighted Decimal Peak
TABLES
LL_SRULE_WPERIOD = "Weighted Period of a Selection Rule
* LL_SRULE_PEAK = "Duration of Selection Rule
EXCEPTIONS
WRONG_IMPORT_PARAMETER = 1 WRONG_CALCULATION_TYPE = 2 PROCESS_NOT_FOUND = 3 PROCESS_PSTEP_NOT_FOUND = 4 NO_RESULT_FOR_CALTY = 5 ERROR_OF_OTHER_FUNCTIONS = 6
IMPORTING Parameters details for HR_RU_SEN_CALCULATE_COMPLETE
ID_PERNR - Personnel Number
Data type: PERNR-PERNROptional: No
Call by Reference: Yes
ID_ENDDA - Evaluation end
Data type: ENDDAOptional: Yes
Call by Reference: Yes
IS_DURATION - Duration
Data type: PSEN_DURATIONOptional: Yes
Call by Reference: Yes
ID_PROTO - Log for Employment Period Calculation
Data type: PSEN_PROTOOptional: Yes
Call by Reference: Yes
IT_PSTEP_TSPST - Override Valuation Model for Each Process Step
Data type: HRSEN00_PSTEP_TSPSTOptional: Yes
Call by Reference: Yes
ID_SCODE - Object Abbreviation
Data type: SHORT_DOptional: Yes
Call by Reference: Yes
ID_STEXT - Object Name
Data type: STEXTOptional: Yes
Call by Reference: Yes
ID_MOLGA - Country Grouping
Data type: T525P-MOLGAOptional: Yes
Call by Reference: Yes
ID_PROCE - Calculation Process
Data type: T525P-PROCEOptional: No
Call by Reference: Yes
ID_PSTEP - Process step
Data type: T525R-PSTEPOptional: Yes
Call by Reference: Yes
ID_SEL_DATE - Selection Date
Data type: BEGDADefault: SY-DATUM
Optional: Yes
Call by Reference: Yes
IR_GPCONTEXT -
Data type: IF_HRCCE_GROUPING_CONTEXTOptional: Yes
Call by Reference: Yes
ID_GPVAL - Grouping Value
Data type: PCCE_GPVALOptional: Yes
Call by Reference: Yes
ID_CALTY - Calculation Type
Data type: PSEN_CALTYOptional: Yes
Call by Reference: Yes
ID_BEGDA - Evaluation Start
Data type: BEGDAOptional: Yes
Call by Reference: Yes
EXPORTING Parameters details for HR_RU_SEN_CALCULATE_COMPLETE
ED_DATE - Key Date Result
Data type: ENDDAOptional: No
Call by Reference: Yes
ES_DURATION - Duration Result
Data type: PSEN_DURATION_DECOptional: No
Call by Reference: Yes
ET_WEIGHT_PERIOD - Weighted Periods
Data type: HRSEN00_WEIGHT_PERIODOptional: No
Call by Reference: Yes
ET_WEIGHT_PEAK - Weighted Decimal Peak
Data type: HRSEN00_WEIGHT_PEAK_DECOptional: No
Call by Reference: Yes
TABLES Parameters details for HR_RU_SEN_CALCULATE_COMPLETE
LL_SRULE_WPERIOD - Weighted Period of a Selection Rule
Data type: PSEN_SEL_RULE_WGHT_PERIODOptional: No
Call by Reference: Yes
LL_SRULE_PEAK - Duration of Selection Rule
Data type: PSEN_SEL_RULE_PEAK_DECOptional: Yes
Call by Reference: Yes
EXCEPTIONS details
WRONG_IMPORT_PARAMETER - Incorrect Import Parameter
Data type:Optional: No
Call by Reference: Yes
WRONG_CALCULATION_TYPE - Incorrect Calculation Type Parameter
Data type:Optional: No
Call by Reference: Yes
PROCESS_NOT_FOUND - Calculation Process Does Not Exist
Data type:Optional: No
Call by Reference: Yes
PROCESS_PSTEP_NOT_FOUND - Process Step Does Not Exist
Data type:Optional: No
Call by Reference: Yes
NO_RESULT_FOR_CALTY - No Result for Selected Calculation Type
Data type:Optional: No
Call by Reference: Yes
ERROR_OF_OTHER_FUNCTIONS - Errors in Other Function Modules
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for HR_RU_SEN_CALCULATE_COMPLETE 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_ed_date | TYPE ENDDA, " | |||
lv_id_pernr | TYPE PERNR-PERNR, " | |||
lt_ll_srule_wperiod | TYPE STANDARD TABLE OF PSEN_SEL_RULE_WGHT_PERIOD, " | |||
lv_wrong_import_parameter | TYPE PSEN_SEL_RULE_WGHT_PERIOD, " | |||
lv_id_endda | TYPE ENDDA, " | |||
lv_is_duration | TYPE PSEN_DURATION, " | |||
lv_id_proto | TYPE PSEN_PROTO, " | |||
lv_it_pstep_tspst | TYPE HRSEN00_PSTEP_TSPST, " | |||
lv_id_scode | TYPE SHORT_D, " | |||
lv_id_stext | TYPE STEXT, " | |||
lv_id_molga | TYPE T525P-MOLGA, " | |||
lv_es_duration | TYPE PSEN_DURATION_DEC, " | |||
lt_ll_srule_peak | TYPE STANDARD TABLE OF PSEN_SEL_RULE_PEAK_DEC, " | |||
lv_wrong_calculation_type | TYPE PSEN_SEL_RULE_PEAK_DEC, " | |||
lv_id_proce | TYPE T525P-PROCE, " | |||
lv_et_weight_period | TYPE HRSEN00_WEIGHT_PERIOD, " | |||
lv_process_not_found | TYPE HRSEN00_WEIGHT_PERIOD, " | |||
lv_id_pstep | TYPE T525R-PSTEP, " | |||
lv_et_weight_peak | TYPE HRSEN00_WEIGHT_PEAK_DEC, " | |||
lv_process_pstep_not_found | TYPE HRSEN00_WEIGHT_PEAK_DEC, " | |||
lv_id_sel_date | TYPE BEGDA, " SY-DATUM | |||
lv_no_result_for_calty | TYPE BEGDA, " | |||
lv_ir_gpcontext | TYPE IF_HRCCE_GROUPING_CONTEXT, " | |||
lv_error_of_other_functions | TYPE IF_HRCCE_GROUPING_CONTEXT, " | |||
lv_id_gpval | TYPE PCCE_GPVAL, " | |||
lv_id_calty | TYPE PSEN_CALTY, " | |||
lv_id_begda | TYPE BEGDA. " |
  CALL FUNCTION 'HR_RU_SEN_CALCULATE_COMPLETE' "Employment Period Calculation for Calculation Process |
EXPORTING | ||
ID_PERNR | = lv_id_pernr | |
ID_ENDDA | = lv_id_endda | |
IS_DURATION | = lv_is_duration | |
ID_PROTO | = lv_id_proto | |
IT_PSTEP_TSPST | = lv_it_pstep_tspst | |
ID_SCODE | = lv_id_scode | |
ID_STEXT | = lv_id_stext | |
ID_MOLGA | = lv_id_molga | |
ID_PROCE | = lv_id_proce | |
ID_PSTEP | = lv_id_pstep | |
ID_SEL_DATE | = lv_id_sel_date | |
IR_GPCONTEXT | = lv_ir_gpcontext | |
ID_GPVAL | = lv_id_gpval | |
ID_CALTY | = lv_id_calty | |
ID_BEGDA | = lv_id_begda | |
IMPORTING | ||
ED_DATE | = lv_ed_date | |
ES_DURATION | = lv_es_duration | |
ET_WEIGHT_PERIOD | = lv_et_weight_period | |
ET_WEIGHT_PEAK | = lv_et_weight_peak | |
TABLES | ||
LL_SRULE_WPERIOD | = lt_ll_srule_wperiod | |
LL_SRULE_PEAK | = lt_ll_srule_peak | |
EXCEPTIONS | ||
WRONG_IMPORT_PARAMETER = 1 | ||
WRONG_CALCULATION_TYPE = 2 | ||
PROCESS_NOT_FOUND = 3 | ||
PROCESS_PSTEP_NOT_FOUND = 4 | ||
NO_RESULT_FOR_CALTY = 5 | ||
ERROR_OF_OTHER_FUNCTIONS = 6 | ||
. " HR_RU_SEN_CALCULATE_COMPLETE |
ABAP code using 7.40 inline data declarations to call FM HR_RU_SEN_CALCULATE_COMPLETE
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_id_pernr). | ||||
"SELECT single MOLGA FROM T525P INTO @DATA(ld_id_molga). | ||||
"SELECT single PROCE FROM T525P INTO @DATA(ld_id_proce). | ||||
"SELECT single PSTEP FROM T525R INTO @DATA(ld_id_pstep). | ||||
DATA(ld_id_sel_date) | = SY-DATUM. | |||
Search for further information about these or an SAP related objects