SAP HR_IN_SPA_FACTORIZATION Function Module for Salary packaging: Factorization of salary components









HR_IN_SPA_FACTORIZATION is a standard hr in spa factorization SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Salary packaging: Factorization of salary components 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 in spa factorization FM, simply by entering the name HR_IN_SPA_FACTORIZATION into the relevant SAP transaction such as SE37 or SE38.

Function Group: HRPADINA1
Program Name: SAPLHRPADINA1
Main Program: SAPLHRPADINA1
Appliation area: P
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function HR_IN_SPA_FACTORIZATION 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_IN_SPA_FACTORIZATION'"Salary packaging: Factorization of salary components
EXPORTING
PERNR = "
DATE = "
SCOMP = "
CATEGORY = "
* PERCENTAGE = "
EMP_INFO = "
* PFREQ = "Payroll time units
* LT_SELECTED_SCOMP = "Salary packaging: display table type
* UP_SELECTED_SCOMP = "Salary packaging: display table type

IMPORTING
AMOUNT = "
PERC_OUT = "New percentage

TABLES
SPACK_TAB = "Salary packaging package table
INFORMATION_TAB = "

EXCEPTIONS
CALCULATION_FAILED = 1
.




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_SAPLHRPADINA1_002 To calculate eligibility amount based on the feature value
EXIT_SAPLHRPADINA1_003 To calculate eligibility number based on feature value
EXIT_SAPLHRPADINA1_004 To calculate date based on the feature value
EXIT_SAPLHRPADINA1_005 To calculate eligibiltiy amount/number
EXIT_SAPLHRPADINA1_006 To calculate amount based on INVAL D
EXIT_SAPLHRPADINA1_007 Carry forward dates as per customer logic
EXIT_SAPLHRPADINA1_008 Customer exit for saving additional info claims
EXIT_SAPLHRPADINA1_009 Customer exit for printing additional info claims

IMPORTING Parameters details for HR_IN_SPA_FACTORIZATION

PERNR -

Data type: PERNR-PERNR
Optional: No
Call by Reference: No ( called with pass by value option)

DATE -

Data type: SY-DATUM
Optional: No
Call by Reference: No ( called with pass by value option)

SCOMP -

Data type: PACKAGE_TAB-SCOMP
Optional: No
Call by Reference: No ( called with pass by value option)

CATEGORY -

Data type: PACKAGE_TAB-NECAT
Optional: No
Call by Reference: Yes

PERCENTAGE -

Data type: PACKAGE_TAB-NEPCT
Optional: Yes
Call by Reference: Yes

EMP_INFO -

Data type: HRCM_EMPINFO
Optional: No
Call by Reference: Yes

PFREQ - Payroll time units

Data type: T549R-ZEINH
Optional: Yes
Call by Reference: Yes

LT_SELECTED_SCOMP - Salary packaging: display table type

Data type: HRSPA_SCOMP_LIST
Optional: Yes
Call by Reference: No ( called with pass by value option)

UP_SELECTED_SCOMP - Salary packaging: display table type

Data type: HRSPA_SCOMP_LIST
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for HR_IN_SPA_FACTORIZATION

AMOUNT -

Data type: PACKAGE_TAB-NEAMT
Optional: No
Call by Reference: Yes

PERC_OUT - New percentage

Data type: PACKAGE_TAB-NEPCT
Optional: No
Call by Reference: Yes

TABLES Parameters details for HR_IN_SPA_FACTORIZATION

SPACK_TAB - Salary packaging package table

Data type: SPA_PACKAGE_COMPONENT
Optional: No
Call by Reference: No ( called with pass by value option)

INFORMATION_TAB -

Data type: INFO_TAB
Optional: No
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

CALCULATION_FAILED -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for HR_IN_SPA_FACTORIZATION 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, "   
lv_amount  TYPE PACKAGE_TAB-NEAMT, "   
lt_spack_tab  TYPE STANDARD TABLE OF SPA_PACKAGE_COMPONENT, "   
lv_calculation_failed  TYPE SPA_PACKAGE_COMPONENT, "   
lv_date  TYPE SY-DATUM, "   
lv_perc_out  TYPE PACKAGE_TAB-NEPCT, "   
lt_information_tab  TYPE STANDARD TABLE OF INFO_TAB, "   
lv_scomp  TYPE PACKAGE_TAB-SCOMP, "   
lv_category  TYPE PACKAGE_TAB-NECAT, "   
lv_percentage  TYPE PACKAGE_TAB-NEPCT, "   
lv_emp_info  TYPE HRCM_EMPINFO, "   
lv_pfreq  TYPE T549R-ZEINH, "   
lv_lt_selected_scomp  TYPE HRSPA_SCOMP_LIST, "   
lv_up_selected_scomp  TYPE HRSPA_SCOMP_LIST. "   

  CALL FUNCTION 'HR_IN_SPA_FACTORIZATION'  "Salary packaging: Factorization of salary components
    EXPORTING
         PERNR = lv_pernr
         DATE = lv_date
         SCOMP = lv_scomp
         CATEGORY = lv_category
         PERCENTAGE = lv_percentage
         EMP_INFO = lv_emp_info
         PFREQ = lv_pfreq
         LT_SELECTED_SCOMP = lv_lt_selected_scomp
         UP_SELECTED_SCOMP = lv_up_selected_scomp
    IMPORTING
         AMOUNT = lv_amount
         PERC_OUT = lv_perc_out
    TABLES
         SPACK_TAB = lt_spack_tab
         INFORMATION_TAB = lt_information_tab
    EXCEPTIONS
        CALCULATION_FAILED = 1
. " HR_IN_SPA_FACTORIZATION




ABAP code using 7.40 inline data declarations to call FM HR_IN_SPA_FACTORIZATION

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 NEAMT FROM PACKAGE_TAB INTO @DATA(ld_amount).
 
 
 
"SELECT single DATUM FROM SY INTO @DATA(ld_date).
 
"SELECT single NEPCT FROM PACKAGE_TAB INTO @DATA(ld_perc_out).
 
 
"SELECT single SCOMP FROM PACKAGE_TAB INTO @DATA(ld_scomp).
 
"SELECT single NECAT FROM PACKAGE_TAB INTO @DATA(ld_category).
 
"SELECT single NEPCT FROM PACKAGE_TAB INTO @DATA(ld_percentage).
 
 
"SELECT single ZEINH FROM T549R INTO @DATA(ld_pfreq).
 
 
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!