SAP Function Modules

HR_FR_GET_COTIS SAP Function module







HR_FR_GET_COTIS 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 HR_FR_GET_COTIS into the relevant SAP transaction such as SE37 or SE80.

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


Pattern for FM HR_FR_GET_COTIS - HR FR GET COTIS





CALL FUNCTION 'HR_FR_GET_COTIS' "
  EXPORTING
*   p_regno =                   " pfrs0_tab_regno
*   p_organ =                   " t5f1c-organ
*   p_cotis =                   " t5f1c-cotis
    p_begda =                   " pc223-begda
    p_endda =                   " pc223-endda
*   p_pernr =                   " pernr-pernr
    p_chkdt =                   " pc2aper-chkdt
*   iv_ibegd =                  " begda
*   iv_lactv =                  " endda
*   iv_compl =                  " boole_d
  IMPORTING
    tab_cotis =                 " pfrs0_tab_cotis
    tab_ass =                   " pfrs0_tab_ass
    tab_model =                 " pfrs0_tab_t5f1m
    tab_t5f1h_cot =             " pfrs0_tab_t5f1h_cot
    tab_errors =                " hrerror_tab
* TABLES
*   sv =                        " pc223
*   t_t5f1f =                   " t5f1f
*   t_p0064 =                   " p0064
*   t_t5f1g =                   " t5f1g
*   t_t5f1m =                   " t5f1m
*   wpbp =                      " pc205
*   t0000 =                     " p0000
*   t0001 =                     " p0001
* CHANGING
*   t_t5f1c =                   " pfrs0_tab_t5f1c
  EXCEPTIONS
    ERROR = 1                   "
    NO_COTIS_FOUND = 2          "
    INVALID_REGNO = 3           "
    RATE_ERROR = 4              "
    COND_RULE_ERROR = 5         "
    .  "  HR_FR_GET_COTIS

ABAP code example for Function Module HR_FR_GET_COTIS





The ABAP code below is a full code listing to execute function module HR_FR_GET_COTIS 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:
ld_tab_cotis  TYPE PFRS0_TAB_COTIS ,
ld_tab_ass  TYPE PFRS0_TAB_ASS ,
ld_tab_model  TYPE PFRS0_TAB_T5F1M ,
ld_tab_t5f1h_cot  TYPE PFRS0_TAB_T5F1H_COT ,
ld_tab_errors  TYPE HRERROR_TAB ,
it_sv  TYPE STANDARD TABLE OF PC223,"TABLES PARAM
wa_sv  LIKE LINE OF it_sv ,
it_t_t5f1f  TYPE STANDARD TABLE OF T5F1F,"TABLES PARAM
wa_t_t5f1f  LIKE LINE OF it_t_t5f1f ,
it_t_p0064  TYPE STANDARD TABLE OF P0064,"TABLES PARAM
wa_t_p0064  LIKE LINE OF it_t_p0064 ,
it_t_t5f1g  TYPE STANDARD TABLE OF T5F1G,"TABLES PARAM
wa_t_t5f1g  LIKE LINE OF it_t_t5f1g ,
it_t_t5f1m  TYPE STANDARD TABLE OF T5F1M,"TABLES PARAM
wa_t_t5f1m  LIKE LINE OF it_t_t5f1m ,
it_wpbp  TYPE STANDARD TABLE OF PC205,"TABLES PARAM
wa_wpbp  LIKE LINE OF it_wpbp ,
it_t0000  TYPE STANDARD TABLE OF P0000,"TABLES PARAM
wa_t0000  LIKE LINE OF it_t0000 ,
it_t0001  TYPE STANDARD TABLE OF P0001,"TABLES PARAM
wa_t0001  LIKE LINE OF it_t0001 .

DATA(ld_t_t5f1c) = 'Check type of data required'.
DATA(ld_p_regno) = 'Check type of data required'.

SELECT single ORGAN
FROM T5F1C
INTO @DATA(ld_p_organ).


SELECT single COTIS
FROM T5F1C
INTO @DATA(ld_p_cotis).


DATA(ld_p_begda) = 20210129

DATA(ld_p_endda) = 20210129

DATA(ld_p_pernr) = Check type of data required

DATA(ld_p_chkdt) = 20210129
DATA(ld_iv_ibegd) = 'Check type of data required'.
DATA(ld_iv_lactv) = 'Check type of data required'.
DATA(ld_iv_compl) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_sv to it_sv.

"populate fields of struture and append to itab
append wa_t_t5f1f to it_t_t5f1f.

"populate fields of struture and append to itab
append wa_t_p0064 to it_t_p0064.

"populate fields of struture and append to itab
append wa_t_t5f1g to it_t_t5f1g.

"populate fields of struture and append to itab
append wa_t_t5f1m to it_t_t5f1m.

"populate fields of struture and append to itab
append wa_wpbp to it_wpbp.

"populate fields of struture and append to itab
append wa_t0000 to it_t0000.

"populate fields of struture and append to itab
append wa_t0001 to it_t0001. . CALL FUNCTION 'HR_FR_GET_COTIS' EXPORTING * p_regno = ld_p_regno * p_organ = ld_p_organ * p_cotis = ld_p_cotis p_begda = ld_p_begda p_endda = ld_p_endda * p_pernr = ld_p_pernr p_chkdt = ld_p_chkdt * iv_ibegd = ld_iv_ibegd * iv_lactv = ld_iv_lactv * iv_compl = ld_iv_compl IMPORTING tab_cotis = ld_tab_cotis tab_ass = ld_tab_ass tab_model = ld_tab_model tab_t5f1h_cot = ld_tab_t5f1h_cot tab_errors = ld_tab_errors * TABLES * sv = it_sv * t_t5f1f = it_t_t5f1f * t_p0064 = it_t_p0064 * t_t5f1g = it_t_t5f1g * t_t5f1m = it_t_t5f1m * wpbp = it_wpbp * t0000 = it_t0000 * t0001 = it_t0001 * CHANGING * t_t5f1c = ld_t_t5f1c EXCEPTIONS ERROR = 1 NO_COTIS_FOUND = 2 INVALID_REGNO = 3 RATE_ERROR = 4 COND_RULE_ERROR = 5 . " HR_FR_GET_COTIS
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 ELSEIF SY-SUBRC EQ 5. "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_t_t5f1c  TYPE PFRS0_TAB_T5F1C ,
ld_tab_cotis  TYPE PFRS0_TAB_COTIS ,
ld_p_regno  TYPE PFRS0_TAB_REGNO ,
it_sv  TYPE STANDARD TABLE OF PC223 ,
wa_sv  LIKE LINE OF it_sv,
ld_tab_ass  TYPE PFRS0_TAB_ASS ,
ld_p_organ  TYPE T5F1C-ORGAN ,
it_t_t5f1f  TYPE STANDARD TABLE OF T5F1F ,
wa_t_t5f1f  LIKE LINE OF it_t_t5f1f,
ld_tab_model  TYPE PFRS0_TAB_T5F1M ,
ld_p_cotis  TYPE T5F1C-COTIS ,
it_t_p0064  TYPE STANDARD TABLE OF P0064 ,
wa_t_p0064  LIKE LINE OF it_t_p0064,
ld_tab_t5f1h_cot  TYPE PFRS0_TAB_T5F1H_COT ,
ld_p_begda  TYPE PC223-BEGDA ,
it_t_t5f1g  TYPE STANDARD TABLE OF T5F1G ,
wa_t_t5f1g  LIKE LINE OF it_t_t5f1g,
ld_tab_errors  TYPE HRERROR_TAB ,
ld_p_endda  TYPE PC223-ENDDA ,
it_t_t5f1m  TYPE STANDARD TABLE OF T5F1M ,
wa_t_t5f1m  LIKE LINE OF it_t_t5f1m,
it_wpbp  TYPE STANDARD TABLE OF PC205 ,
wa_wpbp  LIKE LINE OF it_wpbp,
ld_p_pernr  TYPE PERNR-PERNR ,
it_t0000  TYPE STANDARD TABLE OF P0000 ,
wa_t0000  LIKE LINE OF it_t0000,
ld_p_chkdt  TYPE PC2APER-CHKDT ,
it_t0001  TYPE STANDARD TABLE OF P0001 ,
wa_t0001  LIKE LINE OF it_t0001,
ld_iv_ibegd  TYPE BEGDA ,
ld_iv_lactv  TYPE ENDDA ,
ld_iv_compl  TYPE BOOLE_D .

ld_t_t5f1c = 'Check type of data required'.
ld_p_regno = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_sv to it_sv.

SELECT single ORGAN
FROM T5F1C
INTO ld_p_organ.


"populate fields of struture and append to itab
append wa_t_t5f1f to it_t_t5f1f.

SELECT single COTIS
FROM T5F1C
INTO ld_p_cotis.


"populate fields of struture and append to itab
append wa_t_p0064 to it_t_p0064.

ld_p_begda = 20210129

"populate fields of struture and append to itab
append wa_t_t5f1g to it_t_t5f1g.

ld_p_endda = 20210129

"populate fields of struture and append to itab
append wa_t_t5f1m to it_t_t5f1m.

"populate fields of struture and append to itab
append wa_wpbp to it_wpbp.

ld_p_pernr = Check type of data required

"populate fields of struture and append to itab
append wa_t0000 to it_t0000.

ld_p_chkdt = 20210129

"populate fields of struture and append to itab
append wa_t0001 to it_t0001.
ld_iv_ibegd = 'Check type of data required'.
ld_iv_lactv = 'Check type of data required'.
ld_iv_compl = 'Check type of data required'.

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 HR_FR_GET_COTIS or its description.