SAP CKML_F_CKML1_2_NECESSARY Function Module for
CKML_F_CKML1_2_NECESSARY is a standard ckml f ckml1 2 necessary SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, 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 ckml f ckml1 2 necessary FM, simply by entering the name CKML_F_CKML1_2_NECESSARY into the relevant SAP transaction such as SE37 or SE38.
Function Group: CKML
Program Name: SAPLCKML
Main Program: SAPLCKML
Appliation area: C
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function CKML_F_CKML1_2_NECESSARY 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 'CKML_F_CKML1_2_NECESSARY'".
EXPORTING
L_MATNR = "
L_BWTAR = "
L_BWKEY = "
L_BWTTY = "
* L_MTART = ' ' "
* S_WERTU_VALID = ' ' "S_WERTU filled by call program
* S_WERTU = ' ' "Value update for material type
IMPORTING
O_SPART = "Division (only filled if S_WERTU_VALID <> ' ')
EXCEPTIONS
NO_ML_RECORDS = 1 ONLY_CKMLPR = 2 INTERNAL_ERROR = 3
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_SAPLCKMLMVQUANT_001
IMPORTING Parameters details for CKML_F_CKML1_2_NECESSARY
L_MATNR -
Data type: MBEW-MATNROptional: No
Call by Reference: No ( called with pass by value option)
L_BWTAR -
Data type: MBEW-BWTAROptional: No
Call by Reference: No ( called with pass by value option)
L_BWKEY -
Data type: MBEW-BWKEYOptional: No
Call by Reference: No ( called with pass by value option)
L_BWTTY -
Data type: MBEW-BWTTYOptional: No
Call by Reference: No ( called with pass by value option)
L_MTART -
Data type: MARA-MTARTDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
S_WERTU_VALID - S_WERTU filled by call program
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
S_WERTU - Value update for material type
Data type: T134M-WERTUDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for CKML_F_CKML1_2_NECESSARY
O_SPART - Division (only filled if S_WERTU_VALID <> SPACE)
Data type: MARA-SPARTOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NO_ML_RECORDS - Do not create ML records
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ONLY_CKMLPR -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INTERNAL_ERROR - Only filled if S_WERTU_VALID <> SPACE
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for CKML_F_CKML1_2_NECESSARY 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_l_matnr | TYPE MBEW-MATNR, " | |||
| lv_o_spart | TYPE MARA-SPART, " | |||
| lv_no_ml_records | TYPE MARA, " | |||
| lv_l_bwtar | TYPE MBEW-BWTAR, " | |||
| lv_only_ckmlpr | TYPE MBEW, " | |||
| lv_l_bwkey | TYPE MBEW-BWKEY, " | |||
| lv_internal_error | TYPE MBEW, " | |||
| lv_l_bwtty | TYPE MBEW-BWTTY, " | |||
| lv_l_mtart | TYPE MARA-MTART, " SPACE | |||
| lv_s_wertu_valid | TYPE MARA, " SPACE | |||
| lv_s_wertu | TYPE T134M-WERTU. " SPACE |
|   CALL FUNCTION 'CKML_F_CKML1_2_NECESSARY' " |
| EXPORTING | ||
| L_MATNR | = lv_l_matnr | |
| L_BWTAR | = lv_l_bwtar | |
| L_BWKEY | = lv_l_bwkey | |
| L_BWTTY | = lv_l_bwtty | |
| L_MTART | = lv_l_mtart | |
| S_WERTU_VALID | = lv_s_wertu_valid | |
| S_WERTU | = lv_s_wertu | |
| IMPORTING | ||
| O_SPART | = lv_o_spart | |
| EXCEPTIONS | ||
| NO_ML_RECORDS = 1 | ||
| ONLY_CKMLPR = 2 | ||
| INTERNAL_ERROR = 3 | ||
| . " CKML_F_CKML1_2_NECESSARY | ||
ABAP code using 7.40 inline data declarations to call FM CKML_F_CKML1_2_NECESSARY
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 MBEW INTO @DATA(ld_l_matnr). | ||||
| "SELECT single SPART FROM MARA INTO @DATA(ld_o_spart). | ||||
| "SELECT single BWTAR FROM MBEW INTO @DATA(ld_l_bwtar). | ||||
| "SELECT single BWKEY FROM MBEW INTO @DATA(ld_l_bwkey). | ||||
| "SELECT single BWTTY FROM MBEW INTO @DATA(ld_l_bwtty). | ||||
| "SELECT single MTART FROM MARA INTO @DATA(ld_l_mtart). | ||||
| DATA(ld_l_mtart) | = ' '. | |||
| DATA(ld_s_wertu_valid) | = ' '. | |||
| "SELECT single WERTU FROM T134M INTO @DATA(ld_s_wertu). | ||||
| DATA(ld_s_wertu) | = ' '. | |||
Search for further information about these or an SAP related objects