Skip to Content
Author's profile photo Former Member

Mixing Ratios Update in SAP

Mixing Ratios Change

OVERVIEW

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.

FUNCTIONALITY:

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

  1. 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.

BUSINESS CONTEXTS

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.

      IMPLEMENTATION APPROACH:

The solution Approach could be achieved using both LSMW as well as Report program.

Design Steps

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:

WERKS:Plant,

MATNR: Material Number

FYEAR:Fiscal Year

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’

  EXPORTING

    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”

IMPORTING

*   MIXRATIO_VALTYPE        =

   MIXRATIO_PROCALT        = itab(internal table of type CKMV1_ALT_CRATIO_TBL)

EXCEPTIONS

   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’

  EXPORTING

    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)

IT_MAT_CRATIO       =

IV_VB_UPDATE        =

1.      To allow mix costing at plant level  it is Mandatory to call The below FM in addition to above two:

CKML_MGV_PLANT_DATA_UPDATE

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

IMPROVEMENTS:

            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.

Regards

Rahul

         

Assigned Tags

      2 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Process flow is as follows:

      Maintaining recipees,production Versions(Production)>Maintain Procurement alternatives(transaction CK91n)(Costing)>Maintain Mix ratios.

      Author's profile photo KAPIL MEHTA
      KAPIL MEHTA

      Hi

      I read your article and it is very informative. I just have one query - Can you please suggest standard SAP report which gives standard cost breakup along with procurement alternative level information, if product involved Mixed costing.

      I have checked S_ALR_87099930 & S_P99_41000111, but they do not show name/description/identification of Procurement alternative.

      Regards

      Kapil