SAP HRTO_AU_CALC_SERVICE_DTLS Function Module for Calculate Service Details
HRTO_AU_CALC_SERVICE_DTLS is a standard hrto au calc service dtls SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Calculate Service Details 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 hrto au calc service dtls FM, simply by entering the name HRTO_AU_CALC_SERVICE_DTLS into the relevant SAP transaction such as SE37 or SE38.
Function Group: HRTO_AU
Program Name: SAPLHRTO_AU
Main Program: SAPLHRTO_AU
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:
Function HRTO_AU_CALC_SERVICE_DTLS 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 'HRTO_AU_CALC_SERVICE_DTLS'"Calculate Service Details.
EXPORTING
PERNR = "Personnel number
SERVICE_TILL_DATE = "Service till date
IT0023_REQ = "
REDUND_MODEL = "Redundancy model in use.
PSG_ABSENCE = "Personnel subarea grouping for absence and attendance types
EMP_MOLGA = "Country Grouping
TERMINATION_DATE = "Termination Date
IMPORTING
SVDAY_DEF = " Total service days
SVYRS_DEF = " Total service yars
PRE78SVDAY_DEF = "Number of service days pre 78
POST78SVDAY_DEF = "Number of service days post 78
PRE93SVDAY_DEF = "Number of service days pre 93
POST93SVDAY_DEF = "Number of service days post 93
PRE83SVDAY_DEF = "Number of service days pre 83
POST83SVDAY_DEF = "Number of service days post 83
HIREDATE = "Start Date
TABLES
P0023A = "HR Master Record: Infotype 0023 (Other/Previous Employers)
P2001A = "HR Time Record: Absences Infotype (2001)
EXCEPTIONS
PERNR_NOT_ASSIGNED = 1 ENTRY_DATE_NOT_FOUND = 2
IMPORTING Parameters details for HRTO_AU_CALC_SERVICE_DTLS
PERNR - Personnel number
Data type: PERNR-PERNROptional: No
Call by Reference: Yes
SERVICE_TILL_DATE - Service till date
Data type: RPCXXXQX-TRMDTOptional: No
Call by Reference: Yes
IT0023_REQ -
Data type:Optional: No
Call by Reference: Yes
REDUND_MODEL - Redundancy model in use.
Data type:Optional: No
Call by Reference: Yes
PSG_ABSENCE - Personnel subarea grouping for absence and attendance types
Data type: T001P-MOABWOptional: No
Call by Reference: Yes
EMP_MOLGA - Country Grouping
Data type: T001P-MOLGAOptional: No
Call by Reference: Yes
TERMINATION_DATE - Termination Date
Data type: RPCXXXQX-TRMDTOptional: No
Call by Reference: Yes
EXPORTING Parameters details for HRTO_AU_CALC_SERVICE_DTLS
SVDAY_DEF - Total service days
Data type: RPCXXXQX-SVDAYOptional: No
Call by Reference: Yes
SVYRS_DEF - Total service yars
Data type: POptional: No
Call by Reference: Yes
PRE78SVDAY_DEF - Number of service days pre 78
Data type: RPCXXXQX-SVDAYOptional: No
Call by Reference: Yes
POST78SVDAY_DEF - Number of service days post 78
Data type: RPCXXXQX-SVDAYOptional: No
Call by Reference: Yes
PRE93SVDAY_DEF - Number of service days pre 93
Data type: RPCXXXQX-SVDAYOptional: No
Call by Reference: Yes
POST93SVDAY_DEF - Number of service days post 93
Data type: RPCXXXQX-SVDAYOptional: No
Call by Reference: Yes
PRE83SVDAY_DEF - Number of service days pre 83
Data type: RPCXXXQX-SVDAYOptional: No
Call by Reference: Yes
POST83SVDAY_DEF - Number of service days post 83
Data type: RPCXXXQX-SVDAYOptional: No
Call by Reference: Yes
HIREDATE - Start Date
Data type: P0001-BEGDAOptional: No
Call by Reference: Yes
TABLES Parameters details for HRTO_AU_CALC_SERVICE_DTLS
P0023A - HR Master Record: Infotype 0023 (Other/Previous Employers)
Data type: P0023Optional: No
Call by Reference: Yes
P2001A - HR Time Record: Absences Infotype (2001)
Data type: P2001Optional: No
Call by Reference: Yes
EXCEPTIONS details
PERNR_NOT_ASSIGNED - Personnel number not assigned yet
Data type:Optional: No
Call by Reference: Yes
ENTRY_DATE_NOT_FOUND - Hire date not found
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for HRTO_AU_CALC_SERVICE_DTLS 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_p0023a | TYPE STANDARD TABLE OF P0023, " | |||
lv_svday_def | TYPE RPCXXXQX-SVDAY, " | |||
lv_pernr_not_assigned | TYPE RPCXXXQX, " | |||
lt_p2001a | TYPE STANDARD TABLE OF P2001, " | |||
lv_svyrs_def | TYPE P, " | |||
lv_service_till_date | TYPE RPCXXXQX-TRMDT, " | |||
lv_entry_date_not_found | TYPE RPCXXXQX, " | |||
lv_it0023_req | TYPE RPCXXXQX, " | |||
lv_pre78svday_def | TYPE RPCXXXQX-SVDAY, " | |||
lv_redund_model | TYPE RPCXXXQX, " | |||
lv_post78svday_def | TYPE RPCXXXQX-SVDAY, " | |||
lv_psg_absence | TYPE T001P-MOABW, " | |||
lv_pre93svday_def | TYPE RPCXXXQX-SVDAY, " | |||
lv_emp_molga | TYPE T001P-MOLGA, " | |||
lv_post93svday_def | TYPE RPCXXXQX-SVDAY, " | |||
lv_pre83svday_def | TYPE RPCXXXQX-SVDAY, " | |||
lv_termination_date | TYPE RPCXXXQX-TRMDT, " | |||
lv_post83svday_def | TYPE RPCXXXQX-SVDAY, " | |||
lv_hiredate | TYPE P0001-BEGDA. " |
  CALL FUNCTION 'HRTO_AU_CALC_SERVICE_DTLS' "Calculate Service Details |
EXPORTING | ||
PERNR | = lv_pernr | |
SERVICE_TILL_DATE | = lv_service_till_date | |
IT0023_REQ | = lv_it0023_req | |
REDUND_MODEL | = lv_redund_model | |
PSG_ABSENCE | = lv_psg_absence | |
EMP_MOLGA | = lv_emp_molga | |
TERMINATION_DATE | = lv_termination_date | |
IMPORTING | ||
SVDAY_DEF | = lv_svday_def | |
SVYRS_DEF | = lv_svyrs_def | |
PRE78SVDAY_DEF | = lv_pre78svday_def | |
POST78SVDAY_DEF | = lv_post78svday_def | |
PRE93SVDAY_DEF | = lv_pre93svday_def | |
POST93SVDAY_DEF | = lv_post93svday_def | |
PRE83SVDAY_DEF | = lv_pre83svday_def | |
POST83SVDAY_DEF | = lv_post83svday_def | |
HIREDATE | = lv_hiredate | |
TABLES | ||
P0023A | = lt_p0023a | |
P2001A | = lt_p2001a | |
EXCEPTIONS | ||
PERNR_NOT_ASSIGNED = 1 | ||
ENTRY_DATE_NOT_FOUND = 2 | ||
. " HRTO_AU_CALC_SERVICE_DTLS |
ABAP code using 7.40 inline data declarations to call FM HRTO_AU_CALC_SERVICE_DTLS
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 SVDAY FROM RPCXXXQX INTO @DATA(ld_svday_def). | ||||
"SELECT single TRMDT FROM RPCXXXQX INTO @DATA(ld_service_till_date). | ||||
"SELECT single SVDAY FROM RPCXXXQX INTO @DATA(ld_pre78svday_def). | ||||
"SELECT single SVDAY FROM RPCXXXQX INTO @DATA(ld_post78svday_def). | ||||
"SELECT single MOABW FROM T001P INTO @DATA(ld_psg_absence). | ||||
"SELECT single SVDAY FROM RPCXXXQX INTO @DATA(ld_pre93svday_def). | ||||
"SELECT single MOLGA FROM T001P INTO @DATA(ld_emp_molga). | ||||
"SELECT single SVDAY FROM RPCXXXQX INTO @DATA(ld_post93svday_def). | ||||
"SELECT single SVDAY FROM RPCXXXQX INTO @DATA(ld_pre83svday_def). | ||||
"SELECT single TRMDT FROM RPCXXXQX INTO @DATA(ld_termination_date). | ||||
"SELECT single SVDAY FROM RPCXXXQX INTO @DATA(ld_post83svday_def). | ||||
"SELECT single BEGDA FROM P0001 INTO @DATA(ld_hiredate). | ||||
Search for further information about these or an SAP related objects