SAP K_KSTRG_CHECK Function Module for
K_KSTRG_CHECK is a standard k kstrg check SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, 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 k kstrg check FM, simply by entering the name K_KSTRG_CHECK into the relevant SAP transaction such as SE37 or SE38.
Function Group: KKPB
Program Name: SAPLKKPB
Main Program: SAPLKKPB
Appliation area: K
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function K_KSTRG_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 'K_KSTRG_CHECK'".
EXPORTING
* DATUM = '99991231' "Validity Date
* V_GSBER = ' ' "Business area to be checked
* V_KOKRS = ' ' "Controlling area to be checked
* GBBIL = ' ' "Business area balance sheet active?
* KATYP = ' ' "Cost element type to be checked
KSTRG = "Cost object
* NO_BUFFER = ' ' "Do not read from data buffer
* RKBUK = ' ' "RK company code validation active?
* SPRAS = ' ' "Language Key for Short Text
* VRGNG = ' ' "Transaction to be checked
* V_BUKRS = ' ' "Company code to be checked
IMPORTING
E_BUKRS = "Company code of cost object
E_TOPKZ = "Indic.: Cost obj is top node of hierarchy
E_APROF = "Settlement profile of cost object
E_TOP_KSTRG = "Highest cost obj. (only with new settlement procedure)
E_SRULE_GENERATE = "Indic.: Generate settlm. rule to highest cost obj
E_CKPHV = "Master record of cost object (view)
E_GSBER = "Business area of cost object
E_KOKRS = "Controlling area of cost object
E_OBJNR = "CO object number
E_WERKS = "Plant of cost object
OWAER = "Object Currency
SCOPE = "Controlling area
E_CKPHS = "Control table for cost object
EXCEPTIONS
KSTRG_NOT_ACTIV = 1 ACTIVITY_NOT_ALLOWED = 2 KATYP_NOT_ALLOWED = 3 NOT_FOUND = 4 POSTING_NOT_ALLOWED = 5 WRONG_BUKRS = 6 WRONG_GSBER = 7 WRONG_KOKRS = 8
IMPORTING Parameters details for K_KSTRG_CHECK
DATUM - Validity Date
Data type: CKPH-DATBIDefault: '99991231'
Optional: Yes
Call by Reference: No ( called with pass by value option)
V_GSBER - Business area to be checked
Data type: CKPH-GSBERDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
V_KOKRS - Controlling area to be checked
Data type: CKPH-KOKRSDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
GBBIL - Business area balance sheet active?
Data type: T001-XGSBEDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
KATYP - Cost element type to be checked
Data type: CSKB-KATYPDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
KSTRG - Cost object
Data type: CKPH-KSTRGOptional: No
Call by Reference: No ( called with pass by value option)
NO_BUFFER - Do not read from data buffer
Data type: CDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
RKBUK - RK company code validation active?
Data type: TKA00-RKBUKDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
SPRAS - Language Key for Short Text
Data type: CKPHT-SPRASDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
VRGNG - Transaction to be checked
Data type: TKAVG-ACTIVITYDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
V_BUKRS - Company code to be checked
Data type: CKPH-BUKRSDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for K_KSTRG_CHECK
E_BUKRS - Company code of cost object
Data type: CKPH-BUKRSOptional: No
Call by Reference: No ( called with pass by value option)
E_TOPKZ - Indic.: Cost obj is top node of hierarchy
Data type: COptional: No
Call by Reference: No ( called with pass by value option)
E_APROF - Settlement profile of cost object
Data type: TKKP1-APROFOptional: No
Call by Reference: No ( called with pass by value option)
E_TOP_KSTRG - Highest cost obj. (only with new settlement procedure)
Data type: CKPHV-KSTRGOptional: No
Call by Reference: No ( called with pass by value option)
E_SRULE_GENERATE - Indic.: Generate settlm. rule to highest cost obj
Data type: COptional: No
Call by Reference: No ( called with pass by value option)
E_CKPHV - Master record of cost object (view)
Data type: CKPHVOptional: No
Call by Reference: No ( called with pass by value option)
E_GSBER - Business area of cost object
Data type: CKPH-GSBEROptional: No
Call by Reference: No ( called with pass by value option)
E_KOKRS - Controlling area of cost object
Data type: CKPH-KOKRSOptional: No
Call by Reference: No ( called with pass by value option)
E_OBJNR - CO object number
Data type: CKPH-OBJNROptional: No
Call by Reference: No ( called with pass by value option)
E_WERKS - Plant of cost object
Data type: CKPH-WERKSOptional: No
Call by Reference: No ( called with pass by value option)
OWAER - Object Currency
Data type: CKPH-OBJWROptional: No
Call by Reference: No ( called with pass by value option)
SCOPE - Controlling area
Data type: CKPHS-SCOPEOptional: No
Call by Reference: No ( called with pass by value option)
E_CKPHS - Control table for cost object
Data type: CKPHSOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
KSTRG_NOT_ACTIV - Cost object is not active in controlling area
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ACTIVITY_NOT_ALLOWED - Transaction is not allowed
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
KATYP_NOT_ALLOWED - Cost element type not allowed
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NOT_FOUND - Cost object not available for the date
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
POSTING_NOT_ALLOWED - Posting to cost object is not allowed
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_BUKRS - Cost object has other company code
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_GSBER - Cost object has other business area
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_KOKRS - Cost object has other controlling area
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for K_KSTRG_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_datum | TYPE CKPH-DATBI, " '99991231' | |||
| lv_e_bukrs | TYPE CKPH-BUKRS, " | |||
| lv_kstrg_not_activ | TYPE CKPH, " | |||
| lv_e_topkz | TYPE C, " | |||
| lv_v_gsber | TYPE CKPH-GSBER, " SPACE | |||
| lv_e_aprof | TYPE TKKP1-APROF, " | |||
| lv_v_kokrs | TYPE CKPH-KOKRS, " SPACE | |||
| lv_e_top_kstrg | TYPE CKPHV-KSTRG, " | |||
| lv_e_srule_generate | TYPE C, " | |||
| lv_gbbil | TYPE T001-XGSBE, " SPACE | |||
| lv_e_ckphv | TYPE CKPHV, " | |||
| lv_activity_not_allowed | TYPE CKPHV, " | |||
| lv_katyp | TYPE CSKB-KATYP, " SPACE | |||
| lv_e_gsber | TYPE CKPH-GSBER, " | |||
| lv_katyp_not_allowed | TYPE CKPH, " | |||
| lv_kstrg | TYPE CKPH-KSTRG, " | |||
| lv_e_kokrs | TYPE CKPH-KOKRS, " | |||
| lv_not_found | TYPE CKPH, " | |||
| lv_e_objnr | TYPE CKPH-OBJNR, " | |||
| lv_no_buffer | TYPE C, " SPACE | |||
| lv_posting_not_allowed | TYPE C, " | |||
| lv_rkbuk | TYPE TKA00-RKBUK, " SPACE | |||
| lv_e_werks | TYPE CKPH-WERKS, " | |||
| lv_wrong_bukrs | TYPE CKPH, " | |||
| lv_owaer | TYPE CKPH-OBJWR, " | |||
| lv_spras | TYPE CKPHT-SPRAS, " SPACE | |||
| lv_wrong_gsber | TYPE CKPHT, " | |||
| lv_scope | TYPE CKPHS-SCOPE, " | |||
| lv_vrgng | TYPE TKAVG-ACTIVITY, " SPACE | |||
| lv_wrong_kokrs | TYPE TKAVG, " | |||
| lv_e_ckphs | TYPE CKPHS, " | |||
| lv_v_bukrs | TYPE CKPH-BUKRS. " SPACE |
|   CALL FUNCTION 'K_KSTRG_CHECK' " |
| EXPORTING | ||
| DATUM | = lv_datum | |
| V_GSBER | = lv_v_gsber | |
| V_KOKRS | = lv_v_kokrs | |
| GBBIL | = lv_gbbil | |
| KATYP | = lv_katyp | |
| KSTRG | = lv_kstrg | |
| NO_BUFFER | = lv_no_buffer | |
| RKBUK | = lv_rkbuk | |
| SPRAS | = lv_spras | |
| VRGNG | = lv_vrgng | |
| V_BUKRS | = lv_v_bukrs | |
| IMPORTING | ||
| E_BUKRS | = lv_e_bukrs | |
| E_TOPKZ | = lv_e_topkz | |
| E_APROF | = lv_e_aprof | |
| E_TOP_KSTRG | = lv_e_top_kstrg | |
| E_SRULE_GENERATE | = lv_e_srule_generate | |
| E_CKPHV | = lv_e_ckphv | |
| E_GSBER | = lv_e_gsber | |
| E_KOKRS | = lv_e_kokrs | |
| E_OBJNR | = lv_e_objnr | |
| E_WERKS | = lv_e_werks | |
| OWAER | = lv_owaer | |
| SCOPE | = lv_scope | |
| E_CKPHS | = lv_e_ckphs | |
| EXCEPTIONS | ||
| KSTRG_NOT_ACTIV = 1 | ||
| ACTIVITY_NOT_ALLOWED = 2 | ||
| KATYP_NOT_ALLOWED = 3 | ||
| NOT_FOUND = 4 | ||
| POSTING_NOT_ALLOWED = 5 | ||
| WRONG_BUKRS = 6 | ||
| WRONG_GSBER = 7 | ||
| WRONG_KOKRS = 8 | ||
| . " K_KSTRG_CHECK | ||
ABAP code using 7.40 inline data declarations to call FM K_KSTRG_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 DATBI FROM CKPH INTO @DATA(ld_datum). | ||||
| DATA(ld_datum) | = '99991231'. | |||
| "SELECT single BUKRS FROM CKPH INTO @DATA(ld_e_bukrs). | ||||
| "SELECT single GSBER FROM CKPH INTO @DATA(ld_v_gsber). | ||||
| DATA(ld_v_gsber) | = ' '. | |||
| "SELECT single APROF FROM TKKP1 INTO @DATA(ld_e_aprof). | ||||
| "SELECT single KOKRS FROM CKPH INTO @DATA(ld_v_kokrs). | ||||
| DATA(ld_v_kokrs) | = ' '. | |||
| "SELECT single KSTRG FROM CKPHV INTO @DATA(ld_e_top_kstrg). | ||||
| "SELECT single XGSBE FROM T001 INTO @DATA(ld_gbbil). | ||||
| DATA(ld_gbbil) | = ' '. | |||
| "SELECT single KATYP FROM CSKB INTO @DATA(ld_katyp). | ||||
| DATA(ld_katyp) | = ' '. | |||
| "SELECT single GSBER FROM CKPH INTO @DATA(ld_e_gsber). | ||||
| "SELECT single KSTRG FROM CKPH INTO @DATA(ld_kstrg). | ||||
| "SELECT single KOKRS FROM CKPH INTO @DATA(ld_e_kokrs). | ||||
| "SELECT single OBJNR FROM CKPH INTO @DATA(ld_e_objnr). | ||||
| DATA(ld_no_buffer) | = ' '. | |||
| "SELECT single RKBUK FROM TKA00 INTO @DATA(ld_rkbuk). | ||||
| DATA(ld_rkbuk) | = ' '. | |||
| "SELECT single WERKS FROM CKPH INTO @DATA(ld_e_werks). | ||||
| "SELECT single OBJWR FROM CKPH INTO @DATA(ld_owaer). | ||||
| "SELECT single SPRAS FROM CKPHT INTO @DATA(ld_spras). | ||||
| DATA(ld_spras) | = ' '. | |||
| "SELECT single SCOPE FROM CKPHS INTO @DATA(ld_scope). | ||||
| "SELECT single ACTIVITY FROM TKAVG INTO @DATA(ld_vrgng). | ||||
| DATA(ld_vrgng) | = ' '. | |||
| "SELECT single BUKRS FROM CKPH INTO @DATA(ld_v_bukrs). | ||||
| DATA(ld_v_bukrs) | = ' '. | |||
Search for further information about these or an SAP related objects