cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Cycles in the calculations while making custom PROJECTEDINVENTORY logic

614

Hi All,

We have a requirement where we have to make custom PROJECTEDINVENTORY keyfigure which uses custom adjusted projected receipts keyfigure (Not the standard ADJUSTEDTRANSPORT keyfigure).

To calculate the Custom PROJECTEDINVENTORY of the current week W, we need to take custom Projected inventory of previous week W-1 as an input.

The formula that we are using is:

Projected Stock = (Projected stock (W-1) + Stock On hand + Firmed Orders + Transport Receipts) – (Total Demand + Dependent Demand)

1. Projected Stock (W-1)

HCONSPROJSTOCK1@ZWKPRODLOC = IBP_PERIODSHIFT("HCONSPROJSTOCK2@ZWKPRODLOC",-1)

2. Projected stock (W-1) + Stock On hand + Firmed Orders

HCONSPROJSTOCK3@ZWKPRODLOC = "HCONSPROJSTOCK1@ZWKPRODLOC" + "INITIALINVENTORY@ZWKPRODLOC" + "INVENTORYCORRECTION@ZWKPRODLOC"

3. Total Demand + Dependent Demand

HCONSPROJSTOCK4@ZWKPRODLOC = "OUTPUTTOTALDEMAND@ZWKPRODLOC" + "DEPENDENTDEMAND@ZWKPRODLOC"

4. Final Custom Projected inventory

HCONSPROJSTOCK2@ZWKPRODLOC = "HCONSPROJSTOCK3@ZWKPRODLOC" + "ZPROCUREMENTQTYCALCULATED@ZWKPRODLOC" - "HCONSPROJSTOCK4@ZWKPRODLOC"

This is giving error during Planning Area activation, due to cycles in calculations, mainly because we are fetching Projected Stock (W-1) and using it in the calculation.

Error log:

Cycle contains the following edges of the calculation graph:

Calculation HCONSPROJSTOCK1@ZWKPRODLOC uses HCONSPROJSTOCK2@ZWKPRODLOC as input.

Calculation HCONSPROJSTOCK3@ZWKPRODLOC uses HCONSPROJSTOCK1@ZWKPRODLOC as input.

Calculation HCONSPROJSTOCK2@ZWKPRODLOC uses HCONSPROJSTOCK3@ZWKPRODLOC as input.

The business wants to view the projected stock values on the fly, without running any operators.

Please suggest what can be done in this case.

Regards,

Siddharth

Accepted Solutions (1)

Accepted Solutions (1)

piyush_parekh
Active Contributor

Hi Siddharth,

You can build a custom projected stock calculation using IBP_CAGGR. Please refer below section in model configuration guide which explains it in detail.

https://help.sap.com/viewer/bf99e931b8d44aafb4e306ec3602cbdd/2002/en-US/adbc9b3674544184936e4029f642...

Regards,

Piyush

Answers (2)

Answers (2)

0 Likes

Hi Piyush,

My bad. I was using PROJECTEDINVENTORY as one of the input for IBP_CAGGR. It should have been INITIALSTOCK.

Regards,

Siddharth

0 Likes

Hi Piyush,

Thank you for the answer.

I tried using IBP_CAGGR yesterday.

For the weeks, where Procurement plan and Net Demand was not available, IBP simply kept on adding the values of previous weeks.

Standard Projected Stock Qty(PROJECTEDINVENTORY) is 3 every week without any Receipts or Demand.

Whereas custom Constrained Projected Stock Qty is summing up previous weeks cumulatively (3,6,9 and so on).

Regards,

Siddharth