SAP RK_KOSTL_READ Function Module for Check Cost Center
RK_KOSTL_READ is a standard rk kostl read 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 read FM, simply by entering the name RK_KOSTL_READ into the relevant SAP transaction such as SE37 or SE38.
Function Group: RKSI
Program Name: SAPLRKSI
Main Program:
Appliation area: K
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function RK_KOSTL_READ 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_READ'"Check Cost Center.
EXPORTING
DATUM = "Date
KOKRS = "Controlling area
KOSTL = "Cost center
* KOSTS = 'X' "Indicator: cost centers active / active validation
* NUREX = ' ' "Indicator: Only existence validation
* SPRAS = ' ' "Text language indicator
IMPORTING
BUKRS = "Company code to which cost center belongs
GSBER = "Cost center business area
KHINR = "Cost center hierarchy area
KTEXT = "Cost center short text
MGEFL = "Flag: Manage quantities for cost center
OBJNR = "Cost center CO object number
OWAER = "Cost center currency
STAKZ = "Indicator: Statistical cost center
XCSKSV = "Cost center view
EXCEPTIONS
KOSTL_NOT_COMPLETE = 1 KOSTL_NOT_FOUND = 2 TEXT_NOT_FOUND = 3 KOKRS_MISSING = 4
IMPORTING Parameters details for RK_KOSTL_READ
DATUM - Date
Data type: CSKS-DATBIOptional: No
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 centers active / active validation
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)
SPRAS - Text language indicator
Data type: CSKT-SPRASDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for RK_KOSTL_READ
BUKRS - Company code to which cost center belongs
Data type: CSKS-BUKRSOptional: No
Call by Reference: No ( called with pass by value option)
GSBER - Cost center 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 - Flag: Manage quantities for cost center
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 - Cost center view
Data type: CSKSVOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
KOSTL_NOT_COMPLETE - Cost center not maintained completely
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
KOSTL_NOT_FOUND - Cost center is not available
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
TEXT_NOT_FOUND - No texts found for cost center
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
KOKRS_MISSING -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for RK_KOSTL_READ 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_datum | TYPE CSKS-DATBI, " | |||
| lv_kostl_not_complete | TYPE CSKS, " | |||
| lv_gsber | TYPE CSKS-GSBER, " | |||
| lv_kokrs | TYPE CSKS-KOKRS, " | |||
| lv_kostl_not_found | TYPE CSKS, " | |||
| lv_khinr | TYPE CSKS-KHINR, " | |||
| lv_kostl | TYPE CSKS-KOSTL, " | |||
| lv_text_not_found | TYPE CSKS, " | |||
| lv_kosts | TYPE TKA00-KOSTS, " 'X' | |||
| lv_ktext | TYPE CSKT-KTEXT, " | |||
| lv_kokrs_missing | TYPE CSKT, " | |||
| lv_mgefl | TYPE CSKS-MGEFL, " | |||
| lv_nurex | TYPE CSKS, " SPACE | |||
| lv_objnr | TYPE CSKS-OBJNR, " | |||
| lv_spras | TYPE CSKT-SPRAS, " SPACE | |||
| lv_owaer | TYPE CSKS-WAERS, " | |||
| lv_stakz | TYPE CSKS-STAKZ, " | |||
| lv_xcsksv | TYPE CSKSV. " |
|   CALL FUNCTION 'RK_KOSTL_READ' "Check Cost Center |
| EXPORTING | ||
| DATUM | = lv_datum | |
| KOKRS | = lv_kokrs | |
| KOSTL | = lv_kostl | |
| KOSTS | = lv_kosts | |
| NUREX | = lv_nurex | |
| SPRAS | = lv_spras | |
| IMPORTING | ||
| BUKRS | = lv_bukrs | |
| 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 | ||
| KOSTL_NOT_COMPLETE = 1 | ||
| KOSTL_NOT_FOUND = 2 | ||
| TEXT_NOT_FOUND = 3 | ||
| KOKRS_MISSING = 4 | ||
| . " RK_KOSTL_READ | ||
ABAP code using 7.40 inline data declarations to call FM RK_KOSTL_READ
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). | ||||
| "SELECT single DATBI FROM CSKS INTO @DATA(ld_datum). | ||||
| "SELECT single GSBER FROM CSKS INTO @DATA(ld_gsber). | ||||
| "SELECT single KOKRS FROM CSKS INTO @DATA(ld_kokrs). | ||||
| "SELECT single KHINR FROM CSKS INTO @DATA(ld_khinr). | ||||
| "SELECT single KOSTL FROM CSKS INTO @DATA(ld_kostl). | ||||
| "SELECT single KOSTS FROM TKA00 INTO @DATA(ld_kosts). | ||||
| DATA(ld_kosts) | = 'X'. | |||
| "SELECT single KTEXT FROM CSKT INTO @DATA(ld_ktext). | ||||
| "SELECT single MGEFL FROM CSKS INTO @DATA(ld_mgefl). | ||||
| DATA(ld_nurex) | = ' '. | |||
| "SELECT single OBJNR FROM CSKS INTO @DATA(ld_objnr). | ||||
| "SELECT single SPRAS FROM CSKT INTO @DATA(ld_spras). | ||||
| DATA(ld_spras) | = ' '. | |||
| "SELECT single WAERS FROM CSKS INTO @DATA(ld_owaer). | ||||
| "SELECT single STAKZ FROM CSKS INTO @DATA(ld_stakz). | ||||
Search for further information about these or an SAP related objects