SAP Function Modules

WFP_SIMULATE_ABSENCE_DEDUCTION SAP Function module







WFP_SIMULATE_ABSENCE_DEDUCTION is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name WFP_SIMULATE_ABSENCE_DEDUCTION into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: RHEI
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM WFP_SIMULATE_ABSENCE_DEDUCTION - WFP SIMULATE ABSENCE DEDUCTION





CALL FUNCTION 'WFP_SIMULATE_ABSENCE_DEDUCTION' "
* EXPORTING
*   begin_date = SY-DATUM       " sy-datum
*   end_date = SY-DATUM         " sy-datum
  TABLES
    employees =                 " rptpernr
    simulated_data =            " prelp
    psp =                       " pdpsp
*   employee_deduction =        " wfp_employee_deduction
*   groupings =                 "
* CHANGING
*   ch_auth_infty_tab =         " hrsp_tty_auth_infty_tab
  EXCEPTIONS
    ERROR_CALCULATING_TIMES = 1  "
    ERROR_DEDUCTION_QUOTA = 2   "
    ERROR_QUODED_BUFFER = 3     "
    ERROR_GET_QUOTA_DEDUCTION = 4  "
    .  "  WFP_SIMULATE_ABSENCE_DEDUCTION

ABAP code example for Function Module WFP_SIMULATE_ABSENCE_DEDUCTION





The ABAP code below is a full code listing to execute function module WFP_SIMULATE_ABSENCE_DEDUCTION including all data declarations. The code uses 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 original method of declaring data variables up front. 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).

DATA:
it_employees  TYPE STANDARD TABLE OF RPTPERNR,"TABLES PARAM
wa_employees  LIKE LINE OF it_employees ,
it_simulated_data  TYPE STANDARD TABLE OF PRELP,"TABLES PARAM
wa_simulated_data  LIKE LINE OF it_simulated_data ,
it_psp  TYPE STANDARD TABLE OF PDPSP,"TABLES PARAM
wa_psp  LIKE LINE OF it_psp ,
it_employee_deduction  TYPE STANDARD TABLE OF WFP_EMPLOYEE_DEDUCTION,"TABLES PARAM
wa_employee_deduction  LIKE LINE OF it_employee_deduction ,
it_groupings  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_groupings  LIKE LINE OF it_groupings .

DATA(ld_ch_auth_infty_tab) = 'Check type of data required'.
DATA(ld_begin_date) = '20210129'.
DATA(ld_end_date) = '20210129'.

"populate fields of struture and append to itab
append wa_employees to it_employees.

"populate fields of struture and append to itab
append wa_simulated_data to it_simulated_data.

"populate fields of struture and append to itab
append wa_psp to it_psp.

"populate fields of struture and append to itab
append wa_employee_deduction to it_employee_deduction.

"populate fields of struture and append to itab
append wa_groupings to it_groupings. . CALL FUNCTION 'WFP_SIMULATE_ABSENCE_DEDUCTION' * EXPORTING * begin_date = ld_begin_date * end_date = ld_end_date TABLES employees = it_employees simulated_data = it_simulated_data psp = it_psp * employee_deduction = it_employee_deduction * groupings = it_groupings * CHANGING * ch_auth_infty_tab = ld_ch_auth_infty_tab EXCEPTIONS ERROR_CALCULATING_TIMES = 1 ERROR_DEDUCTION_QUOTA = 2 ERROR_QUODED_BUFFER = 3 ERROR_GET_QUOTA_DEDUCTION = 4 . " WFP_SIMULATE_ABSENCE_DEDUCTION
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_ch_auth_infty_tab  TYPE HRSP_TTY_AUTH_INFTY_TAB ,
ld_begin_date  TYPE SY-DATUM ,
it_employees  TYPE STANDARD TABLE OF RPTPERNR ,
wa_employees  LIKE LINE OF it_employees,
ld_end_date  TYPE SY-DATUM ,
it_simulated_data  TYPE STANDARD TABLE OF PRELP ,
wa_simulated_data  LIKE LINE OF it_simulated_data,
it_psp  TYPE STANDARD TABLE OF PDPSP ,
wa_psp  LIKE LINE OF it_psp,
it_employee_deduction  TYPE STANDARD TABLE OF WFP_EMPLOYEE_DEDUCTION ,
wa_employee_deduction  LIKE LINE OF it_employee_deduction,
it_groupings  TYPE STANDARD TABLE OF STRING ,
wa_groupings  LIKE LINE OF it_groupings.

ld_ch_auth_infty_tab = '20210129'.
ld_begin_date = '20210129'.

"populate fields of struture and append to itab
append wa_employees to it_employees.
ld_end_date = '20210129'.

"populate fields of struture and append to itab
append wa_simulated_data to it_simulated_data.

"populate fields of struture and append to itab
append wa_psp to it_psp.

"populate fields of struture and append to itab
append wa_employee_deduction to it_employee_deduction.

"populate fields of struture and append to itab
append wa_groupings to it_groupings.

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name WFP_SIMULATE_ABSENCE_DEDUCTION or its description.