SAP Function Modules

K_CSKS_AUTHORITY_CHECK SAP Function module - Authorization check for the cost center master







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

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


Pattern for FM K_CSKS_AUTHORITY_CHECK - K CSKS AUTHORITY CHECK





CALL FUNCTION 'K_CSKS_AUTHORITY_CHECK' "Authorization check for the cost center master
* EXPORTING
*   actvt = SPACE               " tact-actvt    Activity
*   kokrs = SPACE               " ccss-kokrs    Controlling Area
*   kostl = SPACE               " ccss-kostl    Cost center
*   kstgr = SPACE               " csks-khinr
*   kostl_flag = SPACE          "               Determine ALL authorization ?
  IMPORTING
    e_old_rc =                  " sy-subrc
    e_new_rc =                  " sy-subrc
  EXCEPTIONS
    SYSTEM_ERROR = 1            "               technical error within the functio
    USER_NOT_AUTHORIZED = 2     "               User does not have the required au
    .  "  K_CSKS_AUTHORITY_CHECK

ABAP code example for Function Module K_CSKS_AUTHORITY_CHECK





The ABAP code below is a full code listing to execute function module K_CSKS_AUTHORITY_CHECK 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_old_rc  TYPE SY-SUBRC ,
ld_e_new_rc  TYPE SY-SUBRC .


SELECT single ACTVT
FROM TACT
INTO @DATA(ld_actvt).


DATA(ld_kokrs) = some text here

DATA(ld_kostl) = some text here

SELECT single KHINR
FROM CSKS
INTO @DATA(ld_kstgr).

DATA(ld_kostl_flag) = 'some text here'. . CALL FUNCTION 'K_CSKS_AUTHORITY_CHECK' * EXPORTING * actvt = ld_actvt * kokrs = ld_kokrs * kostl = ld_kostl * kstgr = ld_kstgr * kostl_flag = ld_kostl_flag IMPORTING e_old_rc = ld_e_old_rc e_new_rc = ld_e_new_rc EXCEPTIONS SYSTEM_ERROR = 1 USER_NOT_AUTHORIZED = 2 . " K_CSKS_AUTHORITY_CHECK
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_old_rc  TYPE SY-SUBRC ,
ld_actvt  TYPE TACT-ACTVT ,
ld_e_new_rc  TYPE SY-SUBRC ,
ld_kokrs  TYPE CCSS-KOKRS ,
ld_kostl  TYPE CCSS-KOSTL ,
ld_kstgr  TYPE CSKS-KHINR ,
ld_kostl_flag  TYPE STRING .


SELECT single ACTVT
FROM TACT
INTO ld_actvt.


ld_kokrs = some text here

ld_kostl = some text here

SELECT single KHINR
FROM CSKS
INTO ld_kstgr.

ld_kostl_flag = 'some text here'.

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