SAP RK_KOSTL_CHECK Function Module for Check Cost Center
RK_KOSTL_CHECK is a standard rk kostl check SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Check Cost Center 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 rk kostl check FM, simply by entering the name RK_KOSTL_CHECK into the relevant SAP transaction such as SE37 or SE38.
Function Group: RKSI
Program Name: SAPLRKSI
Main Program: SAPLRKSI
Appliation area: K
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function RK_KOSTL_CHECK 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 'RK_KOSTL_CHECK'"Check Cost Center.
EXPORTING
* BUZEI = ' ' "Posting Row
* SPRAS = ' ' "Language Key
* V_BUKRS = "Company Code Used for Testing
* V_GSBER = ' ' "Business Area Used for Testing
* V_KATYP = ' ' "Cost Element Category Used for Testing
* V_VRGNG = ' ' "
* I_SENDER = "
DATUM = "Date on Which Cost Center Is Tested
* GBBIL = ' ' "Indicator: Business Area Balance
* I_MGEFL = 'X' "Indicator: Record Quantities
KOKRS = "Controlling Area
KOSTL = "Cost center
* KOSTS = 'X' "Indicator: Cost Center Active
* NUREX = ' ' "Indicator: Only Existence Validation
* RKBUK = 'U' "Indicator: Company Code Check
IMPORTING
BUKRS = "Document Company Code
ERROR_OCCURRED = "
GSBER = "Business area
KHINR = "Cost Center Hierarchy Area
KTEXT = "Cost Center: Short Text
MGEFL = "Indicator: Record Cost Center Quantities (* I_MGEFL)
OBJNR = "Cost Center CO Object Number
OWAER = "Cost Center Currency
STAKZ = "Indicator: Statistical Cost Center
XCSKSV = "View of Cost Center Master
EXCEPTIONS
INPUT_ERROR = 1 WRONG_GSBER = 10 WRONG_KATYP = 11 CCA_NOT_ACTIVE = 12 KOSTL_NOT_COMPLETE = 2 KOSTL_NOT_FOUND = 3 NO_GSBER = 4 NO_PRIMARY_POSTING = 5 NO_REVENUES_POSTING = 6 NO_SECUNDARY_POSTING = 7 TEXT_NOT_FOUND = 8 WRONG_BUKRS = 9
IMPORTING Parameters details for RK_KOSTL_CHECK
BUZEI - Posting Row
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
SPRAS - Language Key
Data type: CSKT-SPRASDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
V_BUKRS - Company Code Used for Testing
Data type: CSKS-BUKRSOptional: Yes
Call by Reference: No ( called with pass by value option)
V_GSBER - Business Area Used for Testing
Data type: CSKS-GSBERDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
V_KATYP - Cost Element Category Used for Testing
Data type: CSKB-KATYPDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
V_VRGNG -
Data type: COBL-VORGNDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_SENDER -
Data type: BOOLE_DOptional: Yes
Call by Reference: No ( called with pass by value option)
DATUM - Date on Which Cost Center Is Tested
Data type: CSKS-DATBIOptional: No
Call by Reference: No ( called with pass by value option)
GBBIL - Indicator: Business Area Balance
Data type: T001-XGSBEDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_MGEFL - Indicator: Record Quantities
Data type: CSKS-MGEFLDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
KOKRS - Controlling Area
Data type: CSKS-KOKRSOptional: No
Call by Reference: No ( called with pass by value option)
KOSTL - Cost center
Data type: CSKS-KOSTLOptional: No
Call by Reference: No ( called with pass by value option)
KOSTS - Indicator: Cost Center Active
Data type: TKA00-KOSTSDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
NUREX - Indicator: Only Existence Validation
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
RKBUK - Indicator: Company Code Check
Data type: TKA00-RKBUKDefault: 'U'
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for RK_KOSTL_CHECK
BUKRS - Document Company Code
Data type: CSKS-BUKRSOptional: No
Call by Reference: No ( called with pass by value option)
ERROR_OCCURRED -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
GSBER - Business area
Data type: CSKS-GSBEROptional: No
Call by Reference: No ( called with pass by value option)
KHINR - Cost Center Hierarchy Area
Data type: CSKS-KHINROptional: No
Call by Reference: No ( called with pass by value option)
KTEXT - Cost Center: Short Text
Data type: CSKT-KTEXTOptional: No
Call by Reference: No ( called with pass by value option)
MGEFL - Indicator: Record Cost Center Quantities (* I_MGEFL)
Data type: CSKS-MGEFLOptional: No
Call by Reference: No ( called with pass by value option)
OBJNR - Cost Center CO Object Number
Data type: CSKS-OBJNROptional: No
Call by Reference: No ( called with pass by value option)
OWAER - Cost Center Currency
Data type: CSKS-WAERSOptional: No
Call by Reference: No ( called with pass by value option)
STAKZ - Indicator: Statistical Cost Center
Data type: CSKS-STAKZOptional: No
Call by Reference: No ( called with pass by value option)
XCSKSV - View of Cost Center Master
Data type: CSKSVOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
INPUT_ERROR -
Data type:Optional: No
Call by Reference: Yes
WRONG_GSBER - Cost Center Indicates Other Business Area
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_KATYP - Cost Center Category Not for Postings to Cost Center
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
CCA_NOT_ACTIVE -
Data type:Optional: No
Call by Reference: Yes
KOSTL_NOT_COMPLETE - Cost Center Incompletely Maintained
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
KOSTL_NOT_FOUND - No Cost Center Exists on Given Date
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_GSBER - Cost Center Not Assigned to Any Business Area
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_PRIMARY_POSTING - Cost Center Accepts no Primary Postings
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_REVENUES_POSTING - No Revenue Postings to Cost Center Allowed
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_SECUNDARY_POSTING - No Secondary Postings to Cost Center Allowed
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
TEXT_NOT_FOUND - No Cost Center Text Exists
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_BUKRS - Cost Center Assigned to Other Company Code
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for RK_KOSTL_CHECK 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_bukrs | TYPE CSKS-BUKRS, " | |||
| lv_buzei | TYPE CSKS, " SPACE | |||
| lv_input_error | TYPE CSKS, " | |||
| lv_spras | TYPE CSKT-SPRAS, " SPACE | |||
| lv_wrong_gsber | TYPE CSKT, " | |||
| lv_error_occurred | TYPE CSKT, " | |||
| lv_v_bukrs | TYPE CSKS-BUKRS, " | |||
| lv_wrong_katyp | TYPE CSKS, " | |||
| lv_v_gsber | TYPE CSKS-GSBER, " SPACE | |||
| lv_cca_not_active | TYPE CSKS, " | |||
| lv_v_katyp | TYPE CSKB-KATYP, " SPACE | |||
| lv_v_vrgng | TYPE COBL-VORGN, " SPACE | |||
| lv_i_sender | TYPE BOOLE_D, " | |||
| lv_datum | TYPE CSKS-DATBI, " | |||
| lv_gsber | TYPE CSKS-GSBER, " | |||
| lv_kostl_not_complete | TYPE CSKS, " | |||
| lv_gbbil | TYPE T001-XGSBE, " SPACE | |||
| lv_khinr | TYPE CSKS-KHINR, " | |||
| lv_kostl_not_found | TYPE CSKS, " | |||
| lv_ktext | TYPE CSKT-KTEXT, " | |||
| lv_i_mgefl | TYPE CSKS-MGEFL, " 'X' | |||
| lv_no_gsber | TYPE CSKS, " | |||
| lv_kokrs | TYPE CSKS-KOKRS, " | |||
| lv_mgefl | TYPE CSKS-MGEFL, " | |||
| lv_no_primary_posting | TYPE CSKS, " | |||
| lv_kostl | TYPE CSKS-KOSTL, " | |||
| lv_objnr | TYPE CSKS-OBJNR, " | |||
| lv_no_revenues_posting | TYPE CSKS, " | |||
| lv_kosts | TYPE TKA00-KOSTS, " 'X' | |||
| lv_owaer | TYPE CSKS-WAERS, " | |||
| lv_no_secundary_posting | TYPE CSKS, " | |||
| lv_nurex | TYPE CSKS, " SPACE | |||
| lv_stakz | TYPE CSKS-STAKZ, " | |||
| lv_text_not_found | TYPE CSKS, " | |||
| lv_rkbuk | TYPE TKA00-RKBUK, " 'U' | |||
| lv_xcsksv | TYPE CSKSV, " | |||
| lv_wrong_bukrs | TYPE CSKSV. " |
|   CALL FUNCTION 'RK_KOSTL_CHECK' "Check Cost Center |
| EXPORTING | ||
| BUZEI | = lv_buzei | |
| SPRAS | = lv_spras | |
| V_BUKRS | = lv_v_bukrs | |
| V_GSBER | = lv_v_gsber | |
| V_KATYP | = lv_v_katyp | |
| V_VRGNG | = lv_v_vrgng | |
| I_SENDER | = lv_i_sender | |
| DATUM | = lv_datum | |
| GBBIL | = lv_gbbil | |
| I_MGEFL | = lv_i_mgefl | |
| KOKRS | = lv_kokrs | |
| KOSTL | = lv_kostl | |
| KOSTS | = lv_kosts | |
| NUREX | = lv_nurex | |
| RKBUK | = lv_rkbuk | |
| IMPORTING | ||
| BUKRS | = lv_bukrs | |
| ERROR_OCCURRED | = lv_error_occurred | |
| GSBER | = lv_gsber | |
| KHINR | = lv_khinr | |
| KTEXT | = lv_ktext | |
| MGEFL | = lv_mgefl | |
| OBJNR | = lv_objnr | |
| OWAER | = lv_owaer | |
| STAKZ | = lv_stakz | |
| XCSKSV | = lv_xcsksv | |
| EXCEPTIONS | ||
| INPUT_ERROR = 1 | ||
| WRONG_GSBER = 10 | ||
| WRONG_KATYP = 11 | ||
| CCA_NOT_ACTIVE = 12 | ||
| KOSTL_NOT_COMPLETE = 2 | ||
| KOSTL_NOT_FOUND = 3 | ||
| NO_GSBER = 4 | ||
| NO_PRIMARY_POSTING = 5 | ||
| NO_REVENUES_POSTING = 6 | ||
| NO_SECUNDARY_POSTING = 7 | ||
| TEXT_NOT_FOUND = 8 | ||
| WRONG_BUKRS = 9 | ||
| . " RK_KOSTL_CHECK | ||
ABAP code using 7.40 inline data declarations to call FM RK_KOSTL_CHECK
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 BUKRS FROM CSKS INTO @DATA(ld_bukrs). | ||||
| DATA(ld_buzei) | = ' '. | |||
| "SELECT single SPRAS FROM CSKT INTO @DATA(ld_spras). | ||||
| DATA(ld_spras) | = ' '. | |||
| "SELECT single BUKRS FROM CSKS INTO @DATA(ld_v_bukrs). | ||||
| "SELECT single GSBER FROM CSKS INTO @DATA(ld_v_gsber). | ||||
| DATA(ld_v_gsber) | = ' '. | |||
| "SELECT single KATYP FROM CSKB INTO @DATA(ld_v_katyp). | ||||
| DATA(ld_v_katyp) | = ' '. | |||
| "SELECT single VORGN FROM COBL INTO @DATA(ld_v_vrgng). | ||||
| DATA(ld_v_vrgng) | = ' '. | |||
| "SELECT single DATBI FROM CSKS INTO @DATA(ld_datum). | ||||
| "SELECT single GSBER FROM CSKS INTO @DATA(ld_gsber). | ||||
| "SELECT single XGSBE FROM T001 INTO @DATA(ld_gbbil). | ||||
| DATA(ld_gbbil) | = ' '. | |||
| "SELECT single KHINR FROM CSKS INTO @DATA(ld_khinr). | ||||
| "SELECT single KTEXT FROM CSKT INTO @DATA(ld_ktext). | ||||
| "SELECT single MGEFL FROM CSKS INTO @DATA(ld_i_mgefl). | ||||
| DATA(ld_i_mgefl) | = 'X'. | |||
| "SELECT single KOKRS FROM CSKS INTO @DATA(ld_kokrs). | ||||
| "SELECT single MGEFL FROM CSKS INTO @DATA(ld_mgefl). | ||||
| "SELECT single KOSTL FROM CSKS INTO @DATA(ld_kostl). | ||||
| "SELECT single OBJNR FROM CSKS INTO @DATA(ld_objnr). | ||||
| "SELECT single KOSTS FROM TKA00 INTO @DATA(ld_kosts). | ||||
| DATA(ld_kosts) | = 'X'. | |||
| "SELECT single WAERS FROM CSKS INTO @DATA(ld_owaer). | ||||
| DATA(ld_nurex) | = ' '. | |||
| "SELECT single STAKZ FROM CSKS INTO @DATA(ld_stakz). | ||||
| "SELECT single RKBUK FROM TKA00 INTO @DATA(ld_rkbuk). | ||||
| DATA(ld_rkbuk) | = 'U'. | |||
Search for further information about these or an SAP related objects