SAP CK31_PRODUCTION_VERSION_FIND Function Module for NOTRANSL: Finde eine passende Fert.version zu e. teilweise vorgegebenen Me
CK31_PRODUCTION_VERSION_FIND is a standard ck31 production version find 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: Finde eine passende Fert.version zu e. teilweise vorgegebenen Me 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 ck31 production version find FM, simply by entering the name CK31_PRODUCTION_VERSION_FIND into the relevant SAP transaction such as SE37 or SE38.
Function Group: CK31
Program Name: SAPLCK31
Main Program:
Appliation area: K
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function CK31_PRODUCTION_VERSION_FIND 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 'CK31_PRODUCTION_VERSION_FIND'"NOTRANSL: Finde eine passende Fert.version zu e. teilweise vorgegebenen Me.
EXPORTING
MATNR = "Material Number
CSLID = "CIM selection indicator for alternatives
WERKS = "Plant
LOSGR = "Planned lot size
ALDAT = "Quantity Structure Date for Costing
STLAN = "BOM Usage
STALT = "Alternative BOM
PLNTY = "Task List Type
PLNNR = "Key for Task List Group
PLNAL = "Group Counter
IMPORTING
MKAL_EXP = "Production Versions of Material
EXCEPTIONS
NO_SUITABLE_VERSION_FOUND = 1 NO_VERSION_FOUND = 2
IMPORTING Parameters details for CK31_PRODUCTION_VERSION_FIND
MATNR - Material Number
Data type: MKAL-MATNROptional: No
Call by Reference: No ( called with pass by value option)
CSLID - CIM selection indicator for alternatives
Data type: TC04-CSLIDOptional: No
Call by Reference: No ( called with pass by value option)
WERKS - Plant
Data type: MKAL-WERKSOptional: No
Call by Reference: No ( called with pass by value option)
LOSGR - Planned lot size
Data type: CKKVMK-LOSGROptional: No
Call by Reference: No ( called with pass by value option)
ALDAT - Quantity Structure Date for Costing
Data type: CKKVMK-ALDATOptional: No
Call by Reference: No ( called with pass by value option)
STLAN - BOM Usage
Data type: MKAL-STLANOptional: No
Call by Reference: No ( called with pass by value option)
STALT - Alternative BOM
Data type: MKAL-STLALOptional: No
Call by Reference: No ( called with pass by value option)
PLNTY - Task List Type
Data type: MKAL-PLNTYOptional: No
Call by Reference: No ( called with pass by value option)
PLNNR - Key for Task List Group
Data type: MKAL-PLNNROptional: No
Call by Reference: No ( called with pass by value option)
PLNAL - Group Counter
Data type: MKAL-ALNALOptional: No
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for CK31_PRODUCTION_VERSION_FIND
MKAL_EXP - Production Versions of Material
Data type: MKALOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NO_SUITABLE_VERSION_FOUND -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_VERSION_FOUND -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for CK31_PRODUCTION_VERSION_FIND 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_matnr | TYPE MKAL-MATNR, " | |||
| lv_mkal_exp | TYPE MKAL, " | |||
| lv_no_suitable_version_found | TYPE MKAL, " | |||
| lv_cslid | TYPE TC04-CSLID, " | |||
| lv_werks | TYPE MKAL-WERKS, " | |||
| lv_no_version_found | TYPE MKAL, " | |||
| lv_losgr | TYPE CKKVMK-LOSGR, " | |||
| lv_aldat | TYPE CKKVMK-ALDAT, " | |||
| lv_stlan | TYPE MKAL-STLAN, " | |||
| lv_stalt | TYPE MKAL-STLAL, " | |||
| lv_plnty | TYPE MKAL-PLNTY, " | |||
| lv_plnnr | TYPE MKAL-PLNNR, " | |||
| lv_plnal | TYPE MKAL-ALNAL. " |
|   CALL FUNCTION 'CK31_PRODUCTION_VERSION_FIND' "NOTRANSL: Finde eine passende Fert.version zu e. teilweise vorgegebenen Me |
| EXPORTING | ||
| MATNR | = lv_matnr | |
| CSLID | = lv_cslid | |
| WERKS | = lv_werks | |
| LOSGR | = lv_losgr | |
| ALDAT | = lv_aldat | |
| STLAN | = lv_stlan | |
| STALT | = lv_stalt | |
| PLNTY | = lv_plnty | |
| PLNNR | = lv_plnnr | |
| PLNAL | = lv_plnal | |
| IMPORTING | ||
| MKAL_EXP | = lv_mkal_exp | |
| EXCEPTIONS | ||
| NO_SUITABLE_VERSION_FOUND = 1 | ||
| NO_VERSION_FOUND = 2 | ||
| . " CK31_PRODUCTION_VERSION_FIND | ||
ABAP code using 7.40 inline data declarations to call FM CK31_PRODUCTION_VERSION_FIND
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 MATNR FROM MKAL INTO @DATA(ld_matnr). | ||||
| "SELECT single CSLID FROM TC04 INTO @DATA(ld_cslid). | ||||
| "SELECT single WERKS FROM MKAL INTO @DATA(ld_werks). | ||||
| "SELECT single LOSGR FROM CKKVMK INTO @DATA(ld_losgr). | ||||
| "SELECT single ALDAT FROM CKKVMK INTO @DATA(ld_aldat). | ||||
| "SELECT single STLAN FROM MKAL INTO @DATA(ld_stlan). | ||||
| "SELECT single STLAL FROM MKAL INTO @DATA(ld_stalt). | ||||
| "SELECT single PLNTY FROM MKAL INTO @DATA(ld_plnty). | ||||
| "SELECT single PLNNR FROM MKAL INTO @DATA(ld_plnnr). | ||||
| "SELECT single ALNAL FROM MKAL INTO @DATA(ld_plnal). | ||||
Search for further information about these or an SAP related objects