Introduction

To find the cost-optimal solution, the optimizer transforms the IBP for Supply model into a mathematical representation. This representation is called Mixed-Integer Linear Program (MILP, see also Linear programming – Wikipedia, the free encyclopedia). This MILP can be solved to a mathematical proven optimal solution. A basic understanding of these MILPs is required for the further explanations.

Continuous variables

The variables in the model resemble the decisions, material flows and inventory-situation in the Supply plan:

  • Production: each possible production gets its own variable, which equals the produced amount of the main output-product. For each period and production (P-rule) combination one variable is required.
  • Transport: each possible transport inside the network or to a customer requires an own variable. They equal the transported amount of a distinct product over a transport-lane. For each period and transport C- and T-rules) one variable is required.
  • External receipt/procurement: for each period and external receipt (U-rule) one variable is used to define the amount of procured material.
  • Demand: for each consensus demand a variable resembles the satisfied amount. A helper variable with the non-delivered amount (demand quantity minus the satisfied amount) is used to penalize the non-deliveries in the objective function.
  • Inventory: for each period, product and location-combination one variable reflects the current inventory level.

Binary variables

Currently two features of the model require binary decisions:

  1. Minimum lot-sizes on transport and production: the optimizer needs to decide to transport resp. produce 0 or at least the minimum lot-size amount. Therefore a binary variable is required for each period to represent this decision.
  2. Fix costs: similar to the minimum lot-sizes a decision variable is required for the fix costs in each period.

As binary (and integer) variables have a high impact on the MILP-solver runtime, it is recommended to avoid them as far as possible. By setting the discretization horizon in the optimizer profile it is possible to limit these binary decisions to the first periods in the planning horizon:

/wp-content/uploads/2015/04/sopopt_profile_discretization_686873.png

Constraints

The constraints in the mathematical model combine the variables with the business-logic of the Supply model:

  • Stock-Balance equation: this equation ensures the integrity of the inventory level. It also ensures the correct material-flow and satisfaction of the bill-of-material for the Production-rules, as the same variables are used in the different equations. For each period, product and location combination it looks like this:
    inventory-level in period n =
        inventory-level in period n-1 // carry-over of previous period
        + incoming transports         // all transport arriving in this period
        + production receipts         // production-receipts (as main product or co-product)
        + external receipt            // procured amount
        – outgoing transports         // all transport leaving in this period
        – production component usage  // used amount for production of other products
  • Resources: for all resources and periods a constraint ensures that the capacity of the resource is not exceeded:
    sum of resource-usages <= resource-capacity
  • Adjusted and minimum values: These values set resp. restrict some of the decision variables. But as they can’t be satisfied in all cases (e.g. due to missing material) they are modelled as semi-hard (often also called pseudo-hard) constraints. This avoids infeasibilities in the mathematical model. Due to very high costs for violations of these constraints they are usually all fulfilled.

Objective function

As our model is cost-based, the objective is of course to minimize these costs. Consequently the objective function contains all costs:

Objective function =

  all non-delivery variable costs

  + all transport variable costs

  + all transport fix costs

  + all production variable costs

  + all production fix costs

  + all external receipt variable costs

  + all external receipt fix costs

  + all inventory holding variable costs

  + all inventory target violation variable costs

  + all maximum inventory violation variable costs

Variable costs are based on the corresponding amount of the product. Sometimes they are also called rate costs.

Example: variable costs for transport of product P1 from location L1 to location L2 are 0.001 in period 3. If an amount of 100 is transported in this period, this results in 100 * 0.001 additional costs in the objective function.

Fix costs arise if an amount is greater than 0, but are independent of the amount itself.

Example: fix costs for transport of product P1 from location L1 to location L2 are 1.5 in period 2. If any amount greater than 0 is transported in this period, this results in additional costs of 1.5 in the objective function.

Note: The different cost-types can be multiplied with global cost-factors set in the optimizer profile:

/wp-content/uploads/2015/04/sopopt_profile_global_cost_factors_686874.png

Example: by setting the global cost-factor for External Receipt Variable Cost to a small value (e.g. 0.001), it is possible to check if the procurement costs hinder demand-satisfaction.

In the message-protocol the different parts of the objective function in the solution can be seen:

/wp-content/uploads/2015/04/sopopt_profile_messagelog_686875.png

Additionally the objective function value and its bound are displayed. In some cases (e.g. decomposition used) the bound is not available.

Conclusion

This rough description hopefully eases the usage of the optimizer in IBP for Supply. Please let me know if further questions on this topic arise. Also please note that further blogs concerning the optimizer are planned during the next months.

To report this post you need to login first.

32 Comments

You must be Logged on to comment or reply to a post.

  1. Aditya Gupta

    Hi Carsten,

    Thanks for sharing the information.

    Question – Can we use global cost factors to prioritize one cost over the other? Example: if non-delivery is a critical requirement then we can assign factor 2 while keeping others 1.

    Regards,

    Aditya G

    (0) 
    1. Carsten Schumm Post author

      Hello Aditya,

      yes, you can use the global cost factor for such cases. Typically they are used to perform some tests on the impact of the costs, without the need to change each individual cost value.

      Another use-case is to check the impact of costs. Example:

      To check if procurement / external receipt costs are hindering demand satisfaction, set the global cost factors for external receipt variable and fix costs to 0 and re-run the optimizer. This will disable all external receipt costs => demand satisfaction will most probably rise.

      Cheers,

      Carsten

      (0) 
  2. Aditya Gupta

    Hi Carsten,

    I have been asked by SAP to use discretization for P-rule in order to enable PROUDNING functionality in optimizer. What value should I set there?

    Beyond this question, can you also mention more details about discretization values.

    Regards,

    Aditya G

    (0) 
    1. Carsten Schumm Post author

      Hello Aditya,

      rounding values (also known as incremental lot-sizes) require also discrete decisions. Hence the discretization horizons also control whether they are active or not.

      The discretization horizons define the portion of the complete planning horizon in which the optimizer enables discrete decisions. Typically these decisions are only relevant in the first periods. By reducing the discrete decisions to these periods the performance of the optimizer typically increases drastically.

      Example:

      planning horizon: 30 periods

      discretization horizon for production: 10 periods

      =>

      In periods 1 to 10 minimum lot-sizes, fix costs and rounding values are considered during optimization.

      In periods 11 to 30 they are not considered and are probably violated.

      I hope this helps. As a start you can try to disable the discretization horizons totally. But please set a runtime limit in that case to avoid very long runtimes until the optimal solution gets found.

      Kind regards,

      Carsten

      (0) 
  3. esther melendez

    Thanks for the information.

    I have some questions that maybe you can help me to solve:

    1. How is Net Demand calculated in Optimizer Run? I see it always equal to the receipts KF instead of being the real Net Demand

    2. When running Optimizer it produces as soon as possible, without taking into account the inventory cost, I think it should produce as nearer as possible to the demand, shouldn’t it?

    3. I work with IBP 6.2, and Key Figures for late delivery do not exist on standard PA SAPIBP1, so late delivery is not allowed. Is there any place where SAP explains how to create those KFs? Or have they decommited these KFs?

    Thanks in advance for your help.

    Best Regards,

    Esther

    (0) 
    1. Carsten Schumm Post author

      Hello Esther,

      1. The Optimizer computes a complete, feasible and cost-optimal plan. Thus the demands can be satisfied over multiple sources of supply and don’t follow a fixed schema like the heuristic. Therefore the net demand can’t be computed like for the heuristic.

      2. Yes, if you have inventory holding costs the optimizer should produce just in time, if no other costs, leadtime or resource availabilty requires a build ahead. Please open an according OSS message, if you experience otherwise.

      3. Late delivery is allowed in PA SAPIBP1, but the necessary key-figures need to be configured there manually.

      Kind regards, Carsten

      (0) 
      1. Dinesh Goyal

        Hello Carsten,

        Could you please tell which key figure needs to be created manually(any specific name) and how we can make system to use it.

        Regards,
        Dinesh Goyal

        (0) 
  4. Sanjay Sabhagani

    Hi Carsten

    How does the Optimizer Calculate the External Procurement Qty ?

    I am maintaining a Production ratio of 1 for Source type P, and 0 for Source type U for a component. so basically telling the Optimizer (via input) that do not procure and make inside

    It stills tells me (via output) to procure from outside. what drives this Optimizer behavior ?

    any inputs would help a lot to analyse my Supply Outputs.

    Thanks.

    Sanjay

    (0) 
    1. Ana-Maria Manole

      Hi Sanjay,

      As far as I know Optimizer is not working based on ratios, but only based on the costs. If the production cost is higher than the external receipt cost rate than that’s why optimizer is behaving like this.

      Best Regards,

      Ana

      (0) 
      1. Sanjay Sabhagani

        I tried input of a very high External Receipt Cost Rate (which is a lot more than the Production cost rate.) & even then it did give me an External procurement Qty,

        So I am wondering what is causing it to tell me to procure when i have capacity still remaining to be used ? Should’nt it use up the entire in-house capacity available & then look for external procurement ?

        Regards

        Sanjay

        (0) 
        1. Carsten Schumm Post author

          Hello Sanjay,

          maybe the production source items can’t be sourced or cause a higher total cost than the external receipt. To make the production work please ensure that all components can be sourced and that the total sum for the production (i.e. production itself + possible neccessary transports / procurements / … for the components) is lower than the external receipt cost.

          Additionally please note that the optimizer will never generate negative inventory levels to overcome missing sourcing options.

          Regards, Carsten

          (0) 
          1. Sanjay Sabhagani

            Thanks Carsten.

            Let me check on the points you mentioned, and i will come back with more insights on this.

            Meanwhile, can you suggest any other links / information which talks more about the Optimizer & its behavior in detail ?

            Thanks again.

            Sanjay

            (0) 
            1. Carsten Schumm Post author

              Hello Sanjay,

              please check the official documentation and the training contents. Currently I am not aware of more detailed information concerning the optimizer.
              If you have more questions, please create a new discussion instead of the comments here.

              Thanks and regards, Carsten

              (0) 
  5. esther melendez

    Hello again,

    I have one more question, regarding now Lot Sizes. As I unerstand from the post, it is possible to make the Optimizer to consider Lot Sizes but for that I understand you need to add a discretization horizon.

    First question:


    Which are the units of these horizons? days? weeks?

    Second question:


    Whenever I add a Horizon for Production in Discretizaton tab, Optimizer is going to error (Value of Key Figure PROJECTED INVENTORY too large, no external receipt can be planned for product XXX location XXX because required amount is too large…)

    But if in case this Horizon I increase Default Horizon, no error is returned, but also Lot Size is not considered.

    Is there any additional setting I need to perform?

    Thanks for your support.

    Best Regards,

    Esther Meléndez.

    (0) 
    1. Carsten Schumm Post author

      Hello Esther,

      the unit for the discretization horizons is periods. I.e. if you specify a horizon of 10, the corresponding discrete decisions will be respected in the first ten periods.

      The errors you experience are strange, please open an according incident, so that we can analyze that issue. Often these errors occur if some costs are missing (e.g. inventory holding costs and production costs) – without them the optimizer may decide to produce a very high amount, yielding in such errors.

      The Default Horizon in the optimizer profile is only relevant if some of the more specific discretization horizons are null (no value maintained).

      KInd regards,
      Carsten

      (0) 
  6. Vijay Baweja

    Hi Carsten,

    Thanks for a great article.

    I wanted to understand if there any key differences between SAP APO Optimizer and SAP IBP Optimizer ? One of companies I am working with, has had a very had time with getting results from SAP APO Optimizer and thus would like to understand if anything has changed in the algorithm , interpretation of results, overwriting of results etc. from SAP APO Optimizer.

    (0) 
    1. Carsten Schumm Post author

      Hello Vijay,

      which APO Optimizer are you referencing?
      APO SNP Optimizer is quite similar to the S&OP Optimizer from an algorithmic point of view. Data model and UIs are of course quite different.

      With suitable costs and a properly setup model (e.g. no missing sources) usually the result of the optimizer is quite understandable. On complex scenarios it is sometimes harder to see why the optimizer made a specific decision, but they can be usually explained quite well.

      The overwriting of results is in IBP very easy: just provide the relevant adjusted key-figures. The optimizer tries to respect them with highest priority. I.e. as long as they don’t forbid a valid plan, they are fulfilled.

      Kind regards,
      Carsten

      (1) 
      1. Vijay Baweja

        Thanks Carsten. That Helped.

        Also SAP told me that APO SNP optimizer had option to use COPT 10 Parameters but IBP optimizer does not have any such feature. Since I am not very familiar with SNP optimizer, can you please elaborate on what is the implication of not having this COPT10 parameters in IBP. Also some of the other differences I understood were No Cost Functions, Consideration for storage resources is different in APO vs IBP – multiple resources can be considered in IBP vs only single storage resources in APO, Only single transportation methods can be used inside IBP.

        Can you please comment on this.

        Also can you please confirm if the behavior of transportation costs, handling & storage resources is the same in both IBP and APO optimizers?

        Your inputs will be very helpful.

        Thanks
        Vijay

        (0) 
        1. Carsten Schumm Post author

          Hello Vijay,

          sorry for the late response.

          We have a similar option in IBP to pass special parameter like COPT10 in APO. So there is no disadvantage there. Nevertheless they are only needed in rare cases in conjunction with our Optimization Expert Consulting services.

          Cost-functions are mostly used to get an even distribution if similar costs are involved. As of IBP 1611 there is the ability to enable fair-share distribution in the optimization profile, which internally creates cost-functions. Please let us know if you have further requirements.

          The S&OP-optimizer currently only supports storage- and production-resources. No handling-resources.

          Transportation costs are similar to the SNP-optimizer. Multiple transportation resources are currently not possible, but can be modeled via additional locations.

          Hope this helped,
          Carsten

          (0) 
  7. Venkat deep Karipalli

    Hello Carsten Schumm
    Great write-up, really helpful. Read it a couple of times already 🙂

    Need your inputs on a scenario that we are working on for an utility industry

    We are facing tough times in introducing the below 2 constraints in to the Optimizer engine…

    Raw Material Constraint: Government draws a control line on how much we can consume from a source of supply(irrespective of its availability), and that control line varies dynamically from period to period and government decides it. So every time the optimizer runs, it should look in to that control line value first, and accordingly it should plan the production or if the supply is not sufficient, it should naturally opt for other sources of supply.

    Capacity Constraint: Capacity varies dynamically in the production facility. Accordingly the optimizer should consider a production facility, if the capacity is not sufficient it should opt for another production facility to meet the demand.

    Please help me on how can i configure these constraints in my optimizer profile ?

    (0) 
    1. Carsten Schumm Post author

      Hello Venkat,

      thanks for your comments 😉
      Sorry for the late reply.

      For your raw material constraint:
      I think this can be solved via a resource constraint: All production sources which use the raw-material consume a special resource with a consumption rate equal to the component consumption rate.
      => the total resource consumption equals the consumed raw-material.

      With an according capa-supply for this resource you can limit the material consumption to the wanted value.

      The alternate Source Of Supplies which doesn’t need that raw-material need higher costs than the productions with the raw-material. => The raw-material gets used up first.

      For your capacity constraint:
      You need to define all your resources in the system. This can’t be done in the optimizer profile.
      Then you need production sources for the different resources. Example:
      Production-Source 1 uses resource A to produce P.
      Production-Source 2 uses resource B to produce P.
      If you first want to fully utilize resource A the total production costs using production-source 1 needs to be lower than the ones from production-source 2.

      Hope this helped,
      Carsten

       

      (0) 
      1. Venkat deep Karipalli

        Hello Carsten,

        Though you replied late, you provided the latest solution 🙂

        2 more doubts popped up, please shed some light also on that..

        Usage of “CapaSupply” key figure for “Raw Material availability” constraint: One source of supply is mapped to multiple production facilities. We want to restrict the source of supply itself instead of the Production facility capacity, so can Stock on Hand or Projected Stock key figure would do for this scenario. Lets say the source of supply has 100 Uom material, but we want to restrict the usage to only 70 for a specific period. So if we manually maintain Stock on Hand or Projected stock key figures with 70 for that period in excel, before running the Optimizer engine, will it respect this 70 value for supply planning?

        Doubt 2: Where can i configure the Optimizer profile. Under which tile this transaction is in ?

         

        (0) 
        1. Carsten Schumm Post author

          Hello Venkat,

          Key figure Stock on Hand defines the initial inventory in the first planning period. The values in other periods are not used in any way during planning.

          Key figure Projected Stock is an output key figure and thus can’t be used too for such a purpose.

          The only direct ways to influence source of supply are the adjusted, minimum and maximum key-figures. For your use case the maximum production could be used – as it influences the produced amount of the output product you must consider the corresponding coefficients.

          The Optimizer Profile is available in the Web-UI:
          => Open App Configuration
          => Manage Planning Operators

          => select Planning Operator Type SCM in the left
          => open the Optimizer Profile for the wanted Planning Operator via column Optimizer Profile

          Cheers, Carsten

           

          (0) 
  8. Steve Rampton

    Hi Carsten

    Thanks for the article!

    I am seeing strange behaviour when running an optimiser problem in our system. The system doesn’t seem to be honouring the transport variable costs even though they have been set. It doesn’t even report them in the log!:

    Transport cost rates are generally set to 1.0 and global cost factors also 1.0. Transports are being created but are not responding to the high cost set on one non-preferred lane.

    Regards
    Steve

    (0) 
  9. Dinesh Goyal

    Hello Carsten,

    Nice blog and good information.

    Need your expert help on Optimizer behavior for safety stock. System is not considering safety stock(TARGETINVENTORY KF).

    1. System is not considering safety stock maintained in “Safety Stock”attribute of Product-location MDT. Not generating supply as well as not populating TARGETINVENTORY KF. How we can copy safety stock master data into target inventory and manually adjust the same.
    2. Even when I maintained SOPSAFETYSTOCK and get TARGETINVENTORY populated, system is still not considering TARGETINVENTORY and generating supply. if I have demand of 1000 and maintained safety stock 500. system should generate – 1500 but it is not behaving that way. TARGETINVENTORYVIOLATIONCOST is also maintained but in optimizer log, it shows no violation.

    Please help on safety stock, for some customer demo it is very critical functionality.

    Regards,

    Dinesh Goyal

     

    (0) 
    1. Carsten Schumm Post author

      Hello Dinesh,

      thanks for you comment.

      To your questions:

      1. S&OP planning algorithms only consider safety stocks in KF INVENTORYTARGET. The ‘safety stock’ in master data is used in IBP Inventory if I remember it correctly. Don’t know exactly how to populate the KF from the MDT – but this should be possible. Please ask for help in the community if you can’t figure it out yourself.
      2. Please check the name of your KF. It must be: INVENTORYTARGETVIOLATIONCOSTRATE.
        In some of the shipped SAP-models this one had unfortunately a wrong name.

      Cheers, Carsten

      (0) 
      1. Dinesh Goyal

        Thanks Carsten!!

        I was informed by  SAP support team about wrong KF name of COST, this solved my issue for now but I wanted to show case material master safety stock mapping in IBP and safety stock planning. I am still not able to find out how I can populate INVENTORYTARGET KF from from MDT. Please let me know if you get any information.

         

        Regards,

        Dinesh Goyal

         

         

        (0) 

Leave a Reply