SAP MD_VERSION_SELECTION Function Module for NOTRANSL: Selektion einer Fertigungsversion nach Stichtag/Losgroesse
MD_VERSION_SELECTION is a standard md version selection 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: Selektion einer Fertigungsversion nach Stichtag/Losgroesse 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 md version selection FM, simply by entering the name MD_VERSION_SELECTION into the relevant SAP transaction such as SE37 or SE38.
Function Group: SAUF
Program Name: SAPLSAUF
Main Program: SAPLSAUF
Appliation area: M
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function MD_VERSION_SELECTION 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 'MD_VERSION_SELECTION'"NOTRANSL: Selektion einer Fertigungsversion nach Stichtag/Losgroesse.
EXPORTING
DATE = "Key date
LOTSIZE = "Lot size
MATNR = "Material number
PLANT = "Plant
SELECT_ID = "Selection ID according table TCS41
* VERID = "Production version set for phantom
IMPORTING
MKAL_E = "Production version
TABLES
* MKALX = "
EXCEPTIONS
NO_VERSION_SELECTED = 1 SELECTION_ID_NOT_FOUND = 2
IMPORTING Parameters details for MD_VERSION_SELECTION
DATE - Key date
Data type: MKAL-BDATUOptional: No
Call by Reference: No ( called with pass by value option)
LOTSIZE - Lot size
Data type: MKAL-BSTMIOptional: No
Call by Reference: No ( called with pass by value option)
MATNR - Material number
Data type: MKAL-MATNROptional: No
Call by Reference: No ( called with pass by value option)
PLANT - Plant
Data type: MKAL-WERKSOptional: No
Call by Reference: No ( called with pass by value option)
SELECT_ID - Selection ID according table TCS41
Data type: TCS41-CSLIDOptional: No
Call by Reference: No ( called with pass by value option)
VERID - Production version set for phantom
Data type: MKAL-VERIDOptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for MD_VERSION_SELECTION
MKAL_E - Production version
Data type: MKALOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for MD_VERSION_SELECTION
MKALX -
Data type: MKALOptional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NO_VERSION_SELECTED - No version matches the selection criteria
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
SELECTION_ID_NOT_FOUND - Selection ID is not available
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for MD_VERSION_SELECTION 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_date | TYPE MKAL-BDATU, " | |||
| lt_mkalx | TYPE STANDARD TABLE OF MKAL, " | |||
| lv_mkal_e | TYPE MKAL, " | |||
| lv_no_version_selected | TYPE MKAL, " | |||
| lv_lotsize | TYPE MKAL-BSTMI, " | |||
| lv_selection_id_not_found | TYPE MKAL, " | |||
| lv_matnr | TYPE MKAL-MATNR, " | |||
| lv_plant | TYPE MKAL-WERKS, " | |||
| lv_select_id | TYPE TCS41-CSLID, " | |||
| lv_verid | TYPE MKAL-VERID. " |
|   CALL FUNCTION 'MD_VERSION_SELECTION' "NOTRANSL: Selektion einer Fertigungsversion nach Stichtag/Losgroesse |
| EXPORTING | ||
| DATE | = lv_date | |
| LOTSIZE | = lv_lotsize | |
| MATNR | = lv_matnr | |
| PLANT | = lv_plant | |
| SELECT_ID | = lv_select_id | |
| VERID | = lv_verid | |
| IMPORTING | ||
| MKAL_E | = lv_mkal_e | |
| TABLES | ||
| MKALX | = lt_mkalx | |
| EXCEPTIONS | ||
| NO_VERSION_SELECTED = 1 | ||
| SELECTION_ID_NOT_FOUND = 2 | ||
| . " MD_VERSION_SELECTION | ||
ABAP code using 7.40 inline data declarations to call FM MD_VERSION_SELECTION
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 BDATU FROM MKAL INTO @DATA(ld_date). | ||||
| "SELECT single BSTMI FROM MKAL INTO @DATA(ld_lotsize). | ||||
| "SELECT single MATNR FROM MKAL INTO @DATA(ld_matnr). | ||||
| "SELECT single WERKS FROM MKAL INTO @DATA(ld_plant). | ||||
| "SELECT single CSLID FROM TCS41 INTO @DATA(ld_select_id). | ||||
| "SELECT single VERID FROM MKAL INTO @DATA(ld_verid). | ||||
Search for further information about these or an SAP related objects