SAP K_ORDER_CHECK Function Module for Check Request
K_ORDER_CHECK is a standard k order 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 Request 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 k order check FM, simply by entering the name K_ORDER_CHECK into the relevant SAP transaction such as SE37 or SE38.
Function Group: RKIO
Program Name: SAPLRKIO
Main Program: SAPLRKIO
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function K_ORDER_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_ORDER_CHECK'"Check Request.
EXPORTING
AUFNR = "
* TEST_BUKRS = ' ' "Company code
* TEST_GSBER = ' ' "Business area
* TEST_KOKRS = ' ' "Controlling area
* TEST_VRGNG_CO = ' ' "
* TEST_VRGNG = ' ' "Activity
* ACTVT = '02' "
* E_AUFKV = ' ' "
* GBBIL = ' ' "
* KATYP = ' ' "
* MSG_ZEILE = "Line for error log
* NO_BUFFER = ' ' "Flag 'do not buffer orders'
* NO_READ = ' ' "
* RKBUK = ' ' "
* TEST_AUART = ' ' "Order type
IMPORTING
ASTNR = "
KOKRS = "
KOSTL = "
KTEXT = "
OBJNR = "
OBLIGO = "
OWAER = "
PRCTR = "
SCOPE = "Controlling area
STAKZ = "
WARNING_OCCURRED = "Flag 'Warning message occurred'
AUART = "
WERKS = "
LOGSYSTEM = "Logical system
AUTYP = "
BUKRS = "
COPAR = "
ERLOESE = "
ERROR_OCCURRED = "Error occurred
GSBER = "
I_AUFKV = "
EXCEPTIONS
NOT_ALLOWED = 1 NOT_FOUND = 2 NO_GSBER = 3 WRONG_AUART = 4 WRONG_AUTYP = 5 WRONG_BUKRS = 6 WRONG_GSBER = 7 WRONG_KOKRS = 8
Customer Function user exits
Below is a list of CUSTOMER FUNCTION exit user exits that are available within this program and maybe relevant for this FM.EXIT_SAPLRKIO_001 Reporting: Master Data Maintenance
EXIT_SAPLRKIO_002 Internal Orders: Check for Business Transaction and Authorization
IMPORTING Parameters details for K_ORDER_CHECK
AUFNR -
Data type: AUFK-AUFNROptional: No
Call by Reference: No ( called with pass by value option)
TEST_BUKRS - Company code
Data type: AUFK-BUKRSDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
TEST_GSBER - Business area
Data type: AUFK-GSBERDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
TEST_KOKRS - Controlling area
Data type: AUFK-KOKRSDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
TEST_VRGNG_CO -
Data type: TKAVG-ACTIVITYDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
TEST_VRGNG - Activity
Data type: TKAVG-ACTIVITYDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
ACTVT -
Data type: TACT-ACTVTDefault: '02'
Optional: Yes
Call by Reference: No ( called with pass by value option)
E_AUFKV -
Data type: AUFKVDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
GBBIL -
Data type: T001-XGSBEDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
KATYP -
Data type: CSKB-KATYPDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
MSG_ZEILE - Line for error log
Data type: MESG-ZEILEOptional: Yes
Call by Reference: No ( called with pass by value option)
NO_BUFFER - Flag 'do not buffer orders'
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
NO_READ -
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
RKBUK -
Data type: TKA00-RKBUKDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
TEST_AUART - Order type
Data type: T003O-AUARTDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for K_ORDER_CHECK
ASTNR -
Data type: AUFK-ASTNROptional: No
Call by Reference: No ( called with pass by value option)
KOKRS -
Data type: AUFK-KOKRSOptional: No
Call by Reference: No ( called with pass by value option)
KOSTL -
Data type: AUFK-KOSTLOptional: No
Call by Reference: No ( called with pass by value option)
KTEXT -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
OBJNR -
Data type: AUFK-OBJNROptional: No
Call by Reference: No ( called with pass by value option)
OBLIGO -
Data type: T003O-OBLIGOOptional: No
Call by Reference: No ( called with pass by value option)
OWAER -
Data type: AUFK-WAERSOptional: No
Call by Reference: No ( called with pass by value option)
PRCTR -
Data type: AUFK-PRCTROptional: No
Call by Reference: No ( called with pass by value option)
SCOPE - Controlling area
Data type: AUFK-SCOPEOptional: No
Call by Reference: No ( called with pass by value option)
STAKZ -
Data type: AUFK-ASTKZOptional: No
Call by Reference: No ( called with pass by value option)
WARNING_OCCURRED - Flag 'Warning message occurred'
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
AUART -
Data type: AUFK-AUARTOptional: No
Call by Reference: No ( called with pass by value option)
WERKS -
Data type: AUFK-WERKSOptional: No
Call by Reference: No ( called with pass by value option)
LOGSYSTEM - Logical system
Data type: AUFK-LOGSYSTEMOptional: No
Call by Reference: No ( called with pass by value option)
AUTYP -
Data type: AUFK-AUTYPOptional: No
Call by Reference: No ( called with pass by value option)
BUKRS -
Data type: AUFK-BUKRSOptional: No
Call by Reference: No ( called with pass by value option)
COPAR -
Data type: T003O-COPAROptional: No
Call by Reference: No ( called with pass by value option)
ERLOESE -
Data type: T003O-ERLOESEOptional: No
Call by Reference: No ( called with pass by value option)
ERROR_OCCURRED - Error occurred
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
GSBER -
Data type: AUFK-GSBEROptional: No
Call by Reference: No ( called with pass by value option)
I_AUFKV -
Data type: AUFKVOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NOT_ALLOWED - Transaction not allowed
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NOT_FOUND - Order not found
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_GSBER - Order is not allocated to a business area
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_AUART - Order belongs to different order type
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_AUTYP - Order category not supported
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_BUKRS - Order is allocated to a different company code
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_GSBER - Order is allocated to a different business area
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_KOKRS - Order is allocated to a different controlling area
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for K_ORDER_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_astnr | TYPE AUFK-ASTNR, " | |||
| lv_aufnr | TYPE AUFK-AUFNR, " | |||
| lv_not_allowed | TYPE AUFK, " | |||
| lv_kokrs | TYPE AUFK-KOKRS, " | |||
| lv_test_bukrs | TYPE AUFK-BUKRS, " SPACE | |||
| lv_kostl | TYPE AUFK-KOSTL, " | |||
| lv_test_gsber | TYPE AUFK-GSBER, " SPACE | |||
| lv_ktext | TYPE AUFK, " | |||
| lv_test_kokrs | TYPE AUFK-KOKRS, " SPACE | |||
| lv_objnr | TYPE AUFK-OBJNR, " | |||
| lv_test_vrgng_co | TYPE TKAVG-ACTIVITY, " SPACE | |||
| lv_obligo | TYPE T003O-OBLIGO, " | |||
| lv_test_vrgng | TYPE TKAVG-ACTIVITY, " SPACE | |||
| lv_actvt | TYPE TACT-ACTVT, " '02' | |||
| lv_owaer | TYPE AUFK-WAERS, " | |||
| lv_prctr | TYPE AUFK-PRCTR, " | |||
| lv_scope | TYPE AUFK-SCOPE, " | |||
| lv_stakz | TYPE AUFK-ASTKZ, " | |||
| lv_warning_occurred | TYPE AUFK, " | |||
| lv_auart | TYPE AUFK-AUART, " | |||
| lv_e_aufkv | TYPE AUFKV, " SPACE | |||
| lv_not_found | TYPE AUFKV, " | |||
| lv_werks | TYPE AUFK-WERKS, " | |||
| lv_logsystem | TYPE AUFK-LOGSYSTEM, " | |||
| lv_autyp | TYPE AUFK-AUTYP, " | |||
| lv_gbbil | TYPE T001-XGSBE, " SPACE | |||
| lv_no_gsber | TYPE T001, " | |||
| lv_bukrs | TYPE AUFK-BUKRS, " | |||
| lv_katyp | TYPE CSKB-KATYP, " SPACE | |||
| lv_wrong_auart | TYPE CSKB, " | |||
| lv_copar | TYPE T003O-COPAR, " | |||
| lv_msg_zeile | TYPE MESG-ZEILE, " | |||
| lv_wrong_autyp | TYPE MESG, " | |||
| lv_erloese | TYPE T003O-ERLOESE, " | |||
| lv_no_buffer | TYPE T003O, " SPACE | |||
| lv_wrong_bukrs | TYPE T003O, " | |||
| lv_no_read | TYPE T003O, " SPACE | |||
| lv_wrong_gsber | TYPE T003O, " | |||
| lv_error_occurred | TYPE T003O, " | |||
| lv_gsber | TYPE AUFK-GSBER, " | |||
| lv_rkbuk | TYPE TKA00-RKBUK, " SPACE | |||
| lv_wrong_kokrs | TYPE TKA00, " | |||
| lv_i_aufkv | TYPE AUFKV, " | |||
| lv_test_auart | TYPE T003O-AUART. " SPACE |
|   CALL FUNCTION 'K_ORDER_CHECK' "Check Request |
| EXPORTING | ||
| AUFNR | = lv_aufnr | |
| TEST_BUKRS | = lv_test_bukrs | |
| TEST_GSBER | = lv_test_gsber | |
| TEST_KOKRS | = lv_test_kokrs | |
| TEST_VRGNG_CO | = lv_test_vrgng_co | |
| TEST_VRGNG | = lv_test_vrgng | |
| ACTVT | = lv_actvt | |
| E_AUFKV | = lv_e_aufkv | |
| GBBIL | = lv_gbbil | |
| KATYP | = lv_katyp | |
| MSG_ZEILE | = lv_msg_zeile | |
| NO_BUFFER | = lv_no_buffer | |
| NO_READ | = lv_no_read | |
| RKBUK | = lv_rkbuk | |
| TEST_AUART | = lv_test_auart | |
| IMPORTING | ||
| ASTNR | = lv_astnr | |
| KOKRS | = lv_kokrs | |
| KOSTL | = lv_kostl | |
| KTEXT | = lv_ktext | |
| OBJNR | = lv_objnr | |
| OBLIGO | = lv_obligo | |
| OWAER | = lv_owaer | |
| PRCTR | = lv_prctr | |
| SCOPE | = lv_scope | |
| STAKZ | = lv_stakz | |
| WARNING_OCCURRED | = lv_warning_occurred | |
| AUART | = lv_auart | |
| WERKS | = lv_werks | |
| LOGSYSTEM | = lv_logsystem | |
| AUTYP | = lv_autyp | |
| BUKRS | = lv_bukrs | |
| COPAR | = lv_copar | |
| ERLOESE | = lv_erloese | |
| ERROR_OCCURRED | = lv_error_occurred | |
| GSBER | = lv_gsber | |
| I_AUFKV | = lv_i_aufkv | |
| EXCEPTIONS | ||
| NOT_ALLOWED = 1 | ||
| NOT_FOUND = 2 | ||
| NO_GSBER = 3 | ||
| WRONG_AUART = 4 | ||
| WRONG_AUTYP = 5 | ||
| WRONG_BUKRS = 6 | ||
| WRONG_GSBER = 7 | ||
| WRONG_KOKRS = 8 | ||
| . " K_ORDER_CHECK | ||
ABAP code using 7.40 inline data declarations to call FM K_ORDER_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 ASTNR FROM AUFK INTO @DATA(ld_astnr). | ||||
| "SELECT single AUFNR FROM AUFK INTO @DATA(ld_aufnr). | ||||
| "SELECT single KOKRS FROM AUFK INTO @DATA(ld_kokrs). | ||||
| "SELECT single BUKRS FROM AUFK INTO @DATA(ld_test_bukrs). | ||||
| DATA(ld_test_bukrs) | = ' '. | |||
| "SELECT single KOSTL FROM AUFK INTO @DATA(ld_kostl). | ||||
| "SELECT single GSBER FROM AUFK INTO @DATA(ld_test_gsber). | ||||
| DATA(ld_test_gsber) | = ' '. | |||
| "SELECT single KOKRS FROM AUFK INTO @DATA(ld_test_kokrs). | ||||
| DATA(ld_test_kokrs) | = ' '. | |||
| "SELECT single OBJNR FROM AUFK INTO @DATA(ld_objnr). | ||||
| "SELECT single ACTIVITY FROM TKAVG INTO @DATA(ld_test_vrgng_co). | ||||
| DATA(ld_test_vrgng_co) | = ' '. | |||
| "SELECT single OBLIGO FROM T003O INTO @DATA(ld_obligo). | ||||
| "SELECT single ACTIVITY FROM TKAVG INTO @DATA(ld_test_vrgng). | ||||
| DATA(ld_test_vrgng) | = ' '. | |||
| "SELECT single ACTVT FROM TACT INTO @DATA(ld_actvt). | ||||
| DATA(ld_actvt) | = '02'. | |||
| "SELECT single WAERS FROM AUFK INTO @DATA(ld_owaer). | ||||
| "SELECT single PRCTR FROM AUFK INTO @DATA(ld_prctr). | ||||
| "SELECT single SCOPE FROM AUFK INTO @DATA(ld_scope). | ||||
| "SELECT single ASTKZ FROM AUFK INTO @DATA(ld_stakz). | ||||
| "SELECT single AUART FROM AUFK INTO @DATA(ld_auart). | ||||
| DATA(ld_e_aufkv) | = ' '. | |||
| "SELECT single WERKS FROM AUFK INTO @DATA(ld_werks). | ||||
| "SELECT single LOGSYSTEM FROM AUFK INTO @DATA(ld_logsystem). | ||||
| "SELECT single AUTYP FROM AUFK INTO @DATA(ld_autyp). | ||||
| "SELECT single XGSBE FROM T001 INTO @DATA(ld_gbbil). | ||||
| DATA(ld_gbbil) | = ' '. | |||
| "SELECT single BUKRS FROM AUFK INTO @DATA(ld_bukrs). | ||||
| "SELECT single KATYP FROM CSKB INTO @DATA(ld_katyp). | ||||
| DATA(ld_katyp) | = ' '. | |||
| "SELECT single COPAR FROM T003O INTO @DATA(ld_copar). | ||||
| "SELECT single ZEILE FROM MESG INTO @DATA(ld_msg_zeile). | ||||
| "SELECT single ERLOESE FROM T003O INTO @DATA(ld_erloese). | ||||
| DATA(ld_no_buffer) | = ' '. | |||
| DATA(ld_no_read) | = ' '. | |||
| "SELECT single GSBER FROM AUFK INTO @DATA(ld_gsber). | ||||
| "SELECT single RKBUK FROM TKA00 INTO @DATA(ld_rkbuk). | ||||
| DATA(ld_rkbuk) | = ' '. | |||
| "SELECT single AUART FROM T003O INTO @DATA(ld_test_auart). | ||||
| DATA(ld_test_auart) | = ' '. | |||
Search for further information about these or an SAP related objects