SAP Function Modules

K_RES_CHECK_RESRC_DATA SAP Function module







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

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


Pattern for FM K_RES_CHECK_RESRC_DATA - K RES CHECK RESRC DATA





CALL FUNCTION 'K_RES_CHECK_RESRC_DATA' "
  EXPORTING
    id_kokrs =                  " tka01-kokrs
*   id_gjahr =                  " ccss-gjahr
*   id_versn =                  " ccss-versn
*   i_analyse = SPACE           " c
  IMPORTING
    e_tfill =                   " sy-tfill
    e_pfill =                   " sy-tfill
* TABLES
*   it_resrc =                  " v_cskr_s
*   e_objnr =                   " cokp
*   e_konr =                    " konr
  EXCEPTIONS
    ERROR_ENCRYPTING_RESOURCE = 1  "
    ERROR_EXISTING_DATA = 2     "
    .  "  K_RES_CHECK_RESRC_DATA

ABAP code example for Function Module K_RES_CHECK_RESRC_DATA





The ABAP code below is a full code listing to execute function module K_RES_CHECK_RESRC_DATA 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_e_tfill  TYPE SY-TFILL ,
ld_e_pfill  TYPE SY-TFILL ,
it_it_resrc  TYPE STANDARD TABLE OF V_CSKR_S,"TABLES PARAM
wa_it_resrc  LIKE LINE OF it_it_resrc ,
it_e_objnr  TYPE STANDARD TABLE OF COKP,"TABLES PARAM
wa_e_objnr  LIKE LINE OF it_e_objnr ,
it_e_konr  TYPE STANDARD TABLE OF KONR,"TABLES PARAM
wa_e_konr  LIKE LINE OF it_e_konr .


SELECT single KOKRS
FROM TKA01
INTO @DATA(ld_id_kokrs).


DATA(ld_id_gjahr) = Check type of data required

DATA(ld_id_versn) = some text here
DATA(ld_i_analyse) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_resrc to it_it_resrc.

"populate fields of struture and append to itab
append wa_e_objnr to it_e_objnr.

"populate fields of struture and append to itab
append wa_e_konr to it_e_konr. . CALL FUNCTION 'K_RES_CHECK_RESRC_DATA' EXPORTING id_kokrs = ld_id_kokrs * id_gjahr = ld_id_gjahr * id_versn = ld_id_versn * i_analyse = ld_i_analyse IMPORTING e_tfill = ld_e_tfill e_pfill = ld_e_pfill * TABLES * it_resrc = it_it_resrc * e_objnr = it_e_objnr * e_konr = it_e_konr EXCEPTIONS ERROR_ENCRYPTING_RESOURCE = 1 ERROR_EXISTING_DATA = 2 . " K_RES_CHECK_RESRC_DATA
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 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_e_tfill  TYPE SY-TFILL ,
ld_id_kokrs  TYPE TKA01-KOKRS ,
it_it_resrc  TYPE STANDARD TABLE OF V_CSKR_S ,
wa_it_resrc  LIKE LINE OF it_it_resrc,
ld_e_pfill  TYPE SY-TFILL ,
ld_id_gjahr  TYPE CCSS-GJAHR ,
it_e_objnr  TYPE STANDARD TABLE OF COKP ,
wa_e_objnr  LIKE LINE OF it_e_objnr,
ld_id_versn  TYPE CCSS-VERSN ,
it_e_konr  TYPE STANDARD TABLE OF KONR ,
wa_e_konr  LIKE LINE OF it_e_konr,
ld_i_analyse  TYPE C .


SELECT single KOKRS
FROM TKA01
INTO ld_id_kokrs.


"populate fields of struture and append to itab
append wa_it_resrc to it_it_resrc.

ld_id_gjahr = Check type of data required

"populate fields of struture and append to itab
append wa_e_objnr to it_e_objnr.

ld_id_versn = some text here

"populate fields of struture and append to itab
append wa_e_konr to it_e_konr.
ld_i_analyse = '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 K_RES_CHECK_RESRC_DATA or its description.