SAP K_ORDER_SELECT Function Module for Select Orders
K_ORDER_SELECT is a standard k order select SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Select Orders 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 select FM, simply by entering the name K_ORDER_SELECT into the relevant SAP transaction such as SE37 or SE38.
Function Group: KOSM
Program Name: SAPLKOSM
Main Program: SAPLKOSM
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function K_ORDER_SELECT 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_SELECT'"Select Orders.
EXPORTING
* I_AUTYP_ERL = '01,02' "Permitted order types (Format: 'xx,xx,xx')
* I_KOKRS = "Controlling Area
* I_FILL_T_AUFK = ' ' "Flag 'Aufträge in T_AUFK zurückgeben'
* I_VARIANT = ' ' "Selection Variant
* I_SEND_WARNING = 'X' "Flag 'Warnung bei uneingeschränkter Selektion'
IMPORTING
E_KOKRS = "Controlling area
E_TABIX = "No. of Selected Orders
TABLES
* T_COSEL = "Selection Criteria
* T_AUFK = "Tabelle der selektierten Aufträge
IMPORTING Parameters details for K_ORDER_SELECT
I_AUTYP_ERL - Permitted order types (Format: 'xx,xx,xx')
Data type:Default: '01,02'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_KOKRS - Controlling Area
Data type: TKA01-KOKRSOptional: Yes
Call by Reference: No ( called with pass by value option)
I_FILL_T_AUFK - Flag 'Aufträge in T_AUFK zurückgeben'
Data type: BOOLE-BOOLEDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_VARIANT - Selection Variant
Data type: CODIA-VARIANTDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_SEND_WARNING - Flag 'Warnung bei uneingeschränkter Selektion'
Data type: SY-CALLDDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for K_ORDER_SELECT
E_KOKRS - Controlling area
Data type: TKA01-KOKRSOptional: No
Call by Reference: No ( called with pass by value option)
E_TABIX - No. of Selected Orders
Data type: SY-TABIXOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for K_ORDER_SELECT
T_COSEL - Selection Criteria
Data type: COSELOptional: Yes
Call by Reference: No ( called with pass by value option)
T_AUFK - Tabelle der selektierten Aufträge
Data type: AUFKOptional: Yes
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for K_ORDER_SELECT 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_e_kokrs | TYPE TKA01-KOKRS, " | |||
| lt_t_cosel | TYPE STANDARD TABLE OF COSEL, " | |||
| lv_i_autyp_erl | TYPE COSEL, " '01,02' | |||
| lt_t_aufk | TYPE STANDARD TABLE OF AUFK, " | |||
| lv_e_tabix | TYPE SY-TABIX, " | |||
| lv_i_kokrs | TYPE TKA01-KOKRS, " | |||
| lv_i_fill_t_aufk | TYPE BOOLE-BOOLE, " SPACE | |||
| lv_i_variant | TYPE CODIA-VARIANT, " SPACE | |||
| lv_i_send_warning | TYPE SY-CALLD. " 'X' |
|   CALL FUNCTION 'K_ORDER_SELECT' "Select Orders |
| EXPORTING | ||
| I_AUTYP_ERL | = lv_i_autyp_erl | |
| I_KOKRS | = lv_i_kokrs | |
| I_FILL_T_AUFK | = lv_i_fill_t_aufk | |
| I_VARIANT | = lv_i_variant | |
| I_SEND_WARNING | = lv_i_send_warning | |
| IMPORTING | ||
| E_KOKRS | = lv_e_kokrs | |
| E_TABIX | = lv_e_tabix | |
| TABLES | ||
| T_COSEL | = lt_t_cosel | |
| T_AUFK | = lt_t_aufk | |
| . " K_ORDER_SELECT | ||
ABAP code using 7.40 inline data declarations to call FM K_ORDER_SELECT
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 KOKRS FROM TKA01 INTO @DATA(ld_e_kokrs). | ||||
| DATA(ld_i_autyp_erl) | = '01,02'. | |||
| "SELECT single TABIX FROM SY INTO @DATA(ld_e_tabix). | ||||
| "SELECT single KOKRS FROM TKA01 INTO @DATA(ld_i_kokrs). | ||||
| "SELECT single BOOLE FROM BOOLE INTO @DATA(ld_i_fill_t_aufk). | ||||
| DATA(ld_i_fill_t_aufk) | = ' '. | |||
| "SELECT single VARIANT FROM CODIA INTO @DATA(ld_i_variant). | ||||
| DATA(ld_i_variant) | = ' '. | |||
| "SELECT single CALLD FROM SY INTO @DATA(ld_i_send_warning). | ||||
| DATA(ld_i_send_warning) | = 'X'. | |||
Search for further information about these or an SAP related objects