SAP K_ORDER_READ Function Module for Read Order
K_ORDER_READ is a standard k order 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 Read Order 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 read FM, simply by entering the name K_ORDER_READ 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_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 'K_ORDER_READ'"Read Order.
EXPORTING
AUFNR = "
* E_AUFKV = ' ' "View of AUFK
* NO_BUFFER = ' ' "Indicator: do not buffer orders
* NO_MESSAGE_STORE = ' ' "Flag 'Do not use message handler'
* READ_ONLY_BUFFER = ' ' "
* MATNR_WANTED = ' ' "Flag 'Enter material number if possible'
IMPORTING
ASTNR = "
KOKRS = "
KOSTL = "
KTEXT = "
OBJNR = "
OBLIGO = "
OWAER = "
PRCTR = "
SCOPE = "Controlling area
STAKZ = "
WERKS = "
AUART = "
LOGSYSTEM = "Logical system
MATNR = "
AUTYP = "
BUKRS = "
COPAR = "
ERLOESE = "
ERROR_OCCURRED = "Error occurred (error log)
GSBER = "
I_AUFKV = "
EXCEPTIONS
NOT_FOUND = 1
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_READ
AUFNR -
Data type: AUFK-AUFNROptional: No
Call by Reference: No ( called with pass by value option)
E_AUFKV - View of AUFK
Data type: AUFKVDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
NO_BUFFER - Indicator: do not buffer orders
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
NO_MESSAGE_STORE - Flag 'Do not use message handler'
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
READ_ONLY_BUFFER -
Data type: SY-CALLDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
MATNR_WANTED - Flag 'Enter material number if possible'
Data type: BOOLE-BOOLEDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for K_ORDER_READ
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)
WERKS -
Data type: AUFK-WERKSOptional: 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)
LOGSYSTEM - Logical system
Data type: AUFK-LOGSYSTEMOptional: No
Call by Reference: No ( called with pass by value option)
MATNR -
Data type: AFPO-MATNROptional: 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 (error log)
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_FOUND - Order not found
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for K_ORDER_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_astnr | TYPE AUFK-ASTNR, " | |||
lv_aufnr | TYPE AUFK-AUFNR, " | |||
lv_not_found | TYPE AUFK, " | |||
lv_kokrs | TYPE AUFK-KOKRS, " | |||
lv_kostl | TYPE AUFK-KOSTL, " | |||
lv_ktext | TYPE AUFK, " | |||
lv_objnr | TYPE AUFK-OBJNR, " | |||
lv_obligo | TYPE T003O-OBLIGO, " | |||
lv_owaer | TYPE AUFK-WAERS, " | |||
lv_prctr | TYPE AUFK-PRCTR, " | |||
lv_scope | TYPE AUFK-SCOPE, " | |||
lv_stakz | TYPE AUFK-ASTKZ, " | |||
lv_werks | TYPE AUFK-WERKS, " | |||
lv_auart | TYPE AUFK-AUART, " | |||
lv_e_aufkv | TYPE AUFKV, " SPACE | |||
lv_logsystem | TYPE AUFK-LOGSYSTEM, " | |||
lv_matnr | TYPE AFPO-MATNR, " | |||
lv_autyp | TYPE AUFK-AUTYP, " | |||
lv_no_buffer | TYPE AUFK, " SPACE | |||
lv_bukrs | TYPE AUFK-BUKRS, " | |||
lv_no_message_store | TYPE AUFK, " SPACE | |||
lv_copar | TYPE T003O-COPAR, " | |||
lv_read_only_buffer | TYPE SY-CALLD, " SPACE | |||
lv_erloese | TYPE T003O-ERLOESE, " | |||
lv_matnr_wanted | TYPE BOOLE-BOOLE, " SPACE | |||
lv_error_occurred | TYPE BOOLE, " | |||
lv_gsber | TYPE AUFK-GSBER, " | |||
lv_i_aufkv | TYPE AUFKV. " |
  CALL FUNCTION 'K_ORDER_READ' "Read Order |
EXPORTING | ||
AUFNR | = lv_aufnr | |
E_AUFKV | = lv_e_aufkv | |
NO_BUFFER | = lv_no_buffer | |
NO_MESSAGE_STORE | = lv_no_message_store | |
READ_ONLY_BUFFER | = lv_read_only_buffer | |
MATNR_WANTED | = lv_matnr_wanted | |
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 | |
WERKS | = lv_werks | |
AUART | = lv_auart | |
LOGSYSTEM | = lv_logsystem | |
MATNR | = lv_matnr | |
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_FOUND = 1 | ||
. " K_ORDER_READ |
ABAP code using 7.40 inline data declarations to call FM K_ORDER_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 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 KOSTL FROM AUFK INTO @DATA(ld_kostl). | ||||
"SELECT single OBJNR FROM AUFK INTO @DATA(ld_objnr). | ||||
"SELECT single OBLIGO FROM T003O INTO @DATA(ld_obligo). | ||||
"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 WERKS FROM AUFK INTO @DATA(ld_werks). | ||||
"SELECT single AUART FROM AUFK INTO @DATA(ld_auart). | ||||
DATA(ld_e_aufkv) | = ' '. | |||
"SELECT single LOGSYSTEM FROM AUFK INTO @DATA(ld_logsystem). | ||||
"SELECT single MATNR FROM AFPO INTO @DATA(ld_matnr). | ||||
"SELECT single AUTYP FROM AUFK INTO @DATA(ld_autyp). | ||||
DATA(ld_no_buffer) | = ' '. | |||
"SELECT single BUKRS FROM AUFK INTO @DATA(ld_bukrs). | ||||
DATA(ld_no_message_store) | = ' '. | |||
"SELECT single COPAR FROM T003O INTO @DATA(ld_copar). | ||||
"SELECT single CALLD FROM SY INTO @DATA(ld_read_only_buffer). | ||||
DATA(ld_read_only_buffer) | = ' '. | |||
"SELECT single ERLOESE FROM T003O INTO @DATA(ld_erloese). | ||||
"SELECT single BOOLE FROM BOOLE INTO @DATA(ld_matnr_wanted). | ||||
DATA(ld_matnr_wanted) | = ' '. | |||
"SELECT single GSBER FROM AUFK INTO @DATA(ld_gsber). | ||||
Search for further information about these or an SAP related objects