SAP STOCK_KEYS_SEL Function Module for NOTRANSL: Schlüsselselektion für Bestandsübertragung ins APO
STOCK_KEYS_SEL is a standard stock keys sel SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for NOTRANSL: Schlüsselselektion für Bestandsübertragung ins APO 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 stock keys sel FM, simply by entering the name STOCK_KEYS_SEL into the relevant SAP transaction such as SE37 or SE38.
Function Group: MBAP
Program Name: SAPLMBAP
Main Program: SAPLMBAP
Appliation area: M
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function STOCK_KEYS_SEL 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 'STOCK_KEYS_SEL'"NOTRANSL: Schlüsselselektion für Bestandsübertragung ins APO.
EXPORTING
I_CHARG = "DE-EN-LANG-SWITCH-NO-TRANSLATION
* I_MARD = "DE-EN-LANG-SWITCH-NO-TRANSLATION
* I_MSKU = "DE-EN-LANG-SWITCH-NO-TRANSLATION
* I_MSLB = "DE-EN-LANG-SWITCH-NO-TRANSLATION
* I_MSKA = "DE-EN-LANG-SWITCH-NO-TRANSLATION
* I_MSPR = "DE-EN-LANG-SWITCH-NO-TRANSLATION
* I_MARC = "
TABLES
MW_FIL = "Data Structure for MARC Selection for IM Generation
POS_SEL = "BCO: Ranges Structure for SD Document Item Selection
SOB_SEL = "BCO: Ranges Structure for Special Stock ID Selection
STOCK_KEYS = "List with Keys for APO Stock Selection
MAT_SEL = "INVCO: Range Structure for Material Number Selection
WRK_SEL = "INVCO: Ranges Structure for SalesOrg Selection
LGO_SEL = "INVCO: Ranges-structure for storage location selection
CHA_SEL = "BCO: Ranges Structure for Batch Selection
LIF_SEL = "BCO: Ranges Structure for Vendor Selection
CUS_SEL = "BCO: Ranges Structure for Customer Selection
PSP_SEL = "BCO: Ranges Structure for Project Selection
VBE_SEL = "BCO: Ranges Structure for SD Document Selection
IMPORTING Parameters details for STOCK_KEYS_SEL
I_CHARG - DE-EN-LANG-SWITCH-NO-TRANSLATION
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
I_MARD - DE-EN-LANG-SWITCH-NO-TRANSLATION
Data type:Optional: Yes
Call by Reference: No ( called with pass by value option)
I_MSKU - DE-EN-LANG-SWITCH-NO-TRANSLATION
Data type:Optional: Yes
Call by Reference: No ( called with pass by value option)
I_MSLB - DE-EN-LANG-SWITCH-NO-TRANSLATION
Data type:Optional: Yes
Call by Reference: No ( called with pass by value option)
I_MSKA - DE-EN-LANG-SWITCH-NO-TRANSLATION
Data type:Optional: Yes
Call by Reference: No ( called with pass by value option)
I_MSPR - DE-EN-LANG-SWITCH-NO-TRANSLATION
Data type:Optional: Yes
Call by Reference: No ( called with pass by value option)
I_MARC -
Data type:Optional: Yes
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for STOCK_KEYS_SEL
MW_FIL - Data Structure for MARC Selection for IM Generation
Data type: CIFMARCSOptional: No
Call by Reference: Yes
POS_SEL - BCO: Ranges Structure for SD Document Item Selection
Data type: MCBRPOSOptional: No
Call by Reference: No ( called with pass by value option)
SOB_SEL - BCO: Ranges Structure for Special Stock ID Selection
Data type: MCBRSOBOptional: No
Call by Reference: No ( called with pass by value option)
STOCK_KEYS - List with Keys for APO Stock Selection
Data type: MBSTOCKKEYOptional: No
Call by Reference: No ( called with pass by value option)
MAT_SEL - INVCO: Range Structure for Material Number Selection
Data type: MCBRMATOptional: No
Call by Reference: No ( called with pass by value option)
WRK_SEL - INVCO: Ranges Structure for SalesOrg Selection
Data type: MCBRWRKOptional: No
Call by Reference: No ( called with pass by value option)
LGO_SEL - INVCO: Ranges-structure for storage location selection
Data type: MCBRLAGOptional: No
Call by Reference: No ( called with pass by value option)
CHA_SEL - BCO: Ranges Structure for Batch Selection
Data type: MCBRCHAOptional: No
Call by Reference: No ( called with pass by value option)
LIF_SEL - BCO: Ranges Structure for Vendor Selection
Data type: MCBRLIFOptional: No
Call by Reference: No ( called with pass by value option)
CUS_SEL - BCO: Ranges Structure for Customer Selection
Data type: MCBRCUSOptional: No
Call by Reference: No ( called with pass by value option)
PSP_SEL - BCO: Ranges Structure for Project Selection
Data type: MCBRPSPOptional: No
Call by Reference: No ( called with pass by value option)
VBE_SEL - BCO: Ranges Structure for SD Document Selection
Data type: MCBRVBEOptional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for STOCK_KEYS_SEL 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: | ||||
| lt_mw_fil | TYPE STANDARD TABLE OF CIFMARCS, " | |||
| lv_i_charg | TYPE CIFMARCS, " | |||
| lt_pos_sel | TYPE STANDARD TABLE OF MCBRPOS, " | |||
| lt_sob_sel | TYPE STANDARD TABLE OF MCBRSOB, " | |||
| lt_stock_keys | TYPE STANDARD TABLE OF MBSTOCKKEY, " | |||
| lv_i_mard | TYPE MBSTOCKKEY, " | |||
| lt_mat_sel | TYPE STANDARD TABLE OF MCBRMAT, " | |||
| lv_i_msku | TYPE MCBRMAT, " | |||
| lt_wrk_sel | TYPE STANDARD TABLE OF MCBRWRK, " | |||
| lv_i_mslb | TYPE MCBRWRK, " | |||
| lt_lgo_sel | TYPE STANDARD TABLE OF MCBRLAG, " | |||
| lv_i_mska | TYPE MCBRLAG, " | |||
| lt_cha_sel | TYPE STANDARD TABLE OF MCBRCHA, " | |||
| lv_i_mspr | TYPE MCBRCHA, " | |||
| lt_lif_sel | TYPE STANDARD TABLE OF MCBRLIF, " | |||
| lv_i_marc | TYPE MCBRLIF, " | |||
| lt_cus_sel | TYPE STANDARD TABLE OF MCBRCUS, " | |||
| lt_psp_sel | TYPE STANDARD TABLE OF MCBRPSP, " | |||
| lt_vbe_sel | TYPE STANDARD TABLE OF MCBRVBE. " |
|   CALL FUNCTION 'STOCK_KEYS_SEL' "NOTRANSL: Schlüsselselektion für Bestandsübertragung ins APO |
| EXPORTING | ||
| I_CHARG | = lv_i_charg | |
| I_MARD | = lv_i_mard | |
| I_MSKU | = lv_i_msku | |
| I_MSLB | = lv_i_mslb | |
| I_MSKA | = lv_i_mska | |
| I_MSPR | = lv_i_mspr | |
| I_MARC | = lv_i_marc | |
| TABLES | ||
| MW_FIL | = lt_mw_fil | |
| POS_SEL | = lt_pos_sel | |
| SOB_SEL | = lt_sob_sel | |
| STOCK_KEYS | = lt_stock_keys | |
| MAT_SEL | = lt_mat_sel | |
| WRK_SEL | = lt_wrk_sel | |
| LGO_SEL | = lt_lgo_sel | |
| CHA_SEL | = lt_cha_sel | |
| LIF_SEL | = lt_lif_sel | |
| CUS_SEL | = lt_cus_sel | |
| PSP_SEL | = lt_psp_sel | |
| VBE_SEL | = lt_vbe_sel | |
| . " STOCK_KEYS_SEL | ||
ABAP code using 7.40 inline data declarations to call FM STOCK_KEYS_SEL
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.Search for further information about these or an SAP related objects