Mixing Ratios Update in SAP
Mixing Ratios Change
Various options for procuring a Material exists in SAP, price production that differs according to the manufacturing process or the source of supply adopted. For Mixed price calculation of a Material we must create the procurement alternatives for the individual manufacturing process and procurement options. The Mixed price calculation is carried out by weighting the Procurement alternatives using equivalence numbers.
The mixing ratio contains information as to which procurement alternative is involved with which portion of the mixed cost estimate. A procurement alternative can be assigned to several mixing ratios, or to no mixing ratios. A mixing ratio is clearly identified by the material number, plant, quantity structure type, fiscal year, and period.
You can execute a mixed cost estimate as soon as you have created the mixing ratios for the material. You can transfer the resultant mixed price to the material master. For example, if you have created a standard cost estimate, you can update the costing results as the standard price in the material master.
So the Pre requisite for updating Mixing ratios is existence of Procurement Alternatives which is created using SAP transaction CK91n.
We Can Change the mixing Ratios using two approaches below:
1. Make a Report program in SE38 and Call the desired function Modules one after the other to meet the requirement
Use LSMW for the same.
The Legacy System Migration Workbench (LSMW) is a tool recommended by SAP using which one can use to transfer data once only or periodically from legacy systems into an R/3 System. It is required for data migration.In this tool the data mapping is done and the data is loaded in the SAP tables. . Effort is required to map the data into the structure according to the pre-determined format as specified by the pre-written ABAP upload program of the LSMW.
By using this Mixing Ratios LSMW we Maintain the Mixing Ratios for Materials .
SAP Reference path:
From Menu Path
- Choose AccountingàControlling à Product Cost Controllingà Product Cost PlanningàMaterial CostingàMaster Data for Mixed Cost Estimateà Mixing Ratiosà Create/change.
Change Mixing Ratios screen appears.
Or Goto Transaction CK94.
Enter the Details as below as an example in the first screen:
The following Screen Appears:
Enter The Mixing Ratio values so that the Total is not more than 100.00 %,Tick all check boxes under MR and then Click Save, The Mixing Ratios will be Updated.
NON FUNCTIONAL REQUIREMENTS
By using This LSMW or report program for Mixed Ratios Change we can save significant amount of Man hours since this will automate the process and update the Data directly in SAP Database tables and also can be reused again and again depending on the requirement.
This results in reduction of Manual work of Changing Mixing Ratios for each Material for a given plant.
As part of the mixed costing solution for Client firstly the procurement alternatives will be created using SAP Transaction CK91n, defining on which production line a certain product will be manufactured.
In a subsequent step the mixed ratios will be uploaded through LSMW or Report to Change Mixing Ratios for Material Using SAP transaction CK94.
, defining how much of the total demand is manufactured on certain equipment.
For this LSMW or report to work, the client needs to send the legacy Data in excel format according to SAP defined Format.
This LSMW or report once created can be reused for different sites or clusters based on client’s requirement.
The solution Approach could be achieved using both LSMW as well as Report program.
First Go to transaction LSMW
In step 1.Create a Dummy Recording as shown below as the LSMW will directly update the Data using Function Module called in the Step 5
Inside LSMW if we will adopt the below logic to build a program.
In load we require following Fields for mapping in LSMW:
MATNR: Material Number
MGTYP: Quantity Structure Type
PFA the sample file format :
In step “Maintain Field Mapping and Conversion rules”
we need to Call function module MIXRATIO_READ to Read the Mixing Ratios
It will give us all the Production Version lines for a Material in export parameters.
Sort the above table as per the requirements and set the value of MIXCOST_PC = ‘X’ (To allow Mixed Costing for Material)for all line and after sort change the value of MISCH_VERH = 100.000 for relevant Production versions.
Call Function module and pass the values as below:
CALL FUNCTION ‘MIXRATIO_READ’
I_PLANT = Iinput_structure(from file)- WERKS
I_MATNR = Iinput_structure(from file)-MATNR
I_FYEAR = Iinput_structure(from file)–BDATJ
* I_PERIO =
I_MGTYP = Iinput_structure(from file)–MGTYP
I_MIXRATIO_RESULT = ‘X’ “ To allow Mixed Costing”
* MIXRATIO_VALTYPE =
MIXRATIO_PROCALT = itab(internal table of type CKMV1_ALT_CRATIO_TBL)
INPUT_ERROR = 1
NO_MIXRATIO = 2
OTHERS = 3
To Update the Mixing ratios Call function module CKML_MGV_CROSS_RATIO_UPDATE and pass the values as described below
Along with all others export parameters pass IT_ALT_CRATIO = MIXRATIO_PROCALT
CALL FUNCTION ‘CKML_MGV_CROSS_RATIO_UPDATE’
IV_MGTYP = input_structure(from file )-MGTYP
IV_GJAHR = input_structure(from file )–BDATJ
IV_PERIO = 000
IT_ALT_CRATIO = itab(same as that of mix ratio procurement alternative)
1. To allow mix costing at plant level it is Mandatory to call The below FM in addition to above two:
The above Function Module Updates the Mixing Ratio at plant level.
After this specify the files from the system as per the Input structure format, Read Data and then Click on Convert Data,The Data will be Directly Updated in Tables in this step, No need to execute the remaining steps as it won’t create any session and will directly Update the Data in Convert Data step by calling relevant Function Modules.
· Checks to be performed
o Material exists in plant and is not blockedà Error message to be issued. No table update.
o Production Version exists for material and plantà Error message to be issued. No table update.
o MIXCOST_PC(Procurement Alternative provided for mixed costing): Equals “X”(To allow mixed Costing)
Note : If we set the 100% Check indicator while defining the quantity structure type in Customizing, the system checks whether the mixing ratios equal 100% when saving. We can then only save the mixing ratio if the ratios total 100%
In Report Program we can make a report in transaction SE 38 and call the relevant Function Modules as discussed above in order to achieve our goal
The Enhancements that can be done are as follows:
1. We can collect all the error messages and even text(from read data) in an internal table and download that in a file using function module ‘GUI_DOWNLOAD’. (To be used with LSMW)
2. To get the file path for step 1 we can use method ‘cl_gui_frontend_services=>file_save_dialog’.
3. We can provide a check box for test mode and Update Mixing Ratios only if this check box is unchecked.
Offcourse there can be a better way also but i have tried to write whatever i implemented.
Comments and suggestions to improve the same are most welcome as this is my first document.