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

How to aggregate KF1 at ZWKPRODLOCCUSTSO to KF2 at ZWKPRODLOC?

Former Member
0 Likes
841

Hello

I am trying to use key fig calculation to aggregate KF1 at ZWKPRODLOCCUSTSO to KF2 at ZWKPRODLOC?

I have added calculation in KF1 to sum at planning level ZWKPRODLOC. kf1.jpg

I then reference KF1 in KF2 calculation at level of ZWKPRODLOC. kf2.jpg

I have tried setting the input KF1 in the calculation to Stored and Calculated but in both cases I get errors I do not know how to resolve.

error1.jpg

error2.jpg

Thanks in advance for any help.

Adam

Accepted Solutions (1)

Accepted Solutions (1)

AyanBishnu
Active Contributor
0 Likes

Hello Adam

based on the screenshot that you shared your KF1 is a custom KF and KF2 in the standard KF where we update our stock in hand qty. This standard KF2 which is INITIALINVENTORY is used as input to supply plan. I could also see that you have marked the custom KF1 as input to supply planning. Any specific reason to mark that as input for supply ?

TS based heuristic & optimizer run on a predefined input and output KF which the algorithm recognize based on the KF ID. Any deviation to that will lead to errors and optimizer or heuristic will fail.

the standard input KF for SOH is a stored KF where you have used calculation logic to pull value of KF 1. So please edit the KF2 and mark it as both stored and calculated. I think most probably it will work. But if it don't then the only option is to use advanced copy operator and copy the value from KF1 to KF2.

Let me know which of the above works in your case

Regards

Ayan Bishnu

Former Member
0 Likes

Hi Ayan

There was no reason for flagging KF1 as input for supply planning. I was just trying to get past the errors and I have since removed this.

I followed your advice and changed KF2 to Stored and Calculated.

I get the error message: "INITIALINVENTORY key fig is specified as an input or output for supply planning. The calculation chain of the INITIALINVENTORY key fig includes a calculation where the input key fig is calculated at a different planning level".

As suggested by Revan I also tried to use an intermediate Helper Key Fig but I get the same error.

So maybe as you indicate, this calculation is not possible as KF2 is a input for supply planning?

I had already successfully set up a copy operator (thanks for the advaice) but I was really trying to do this directly with a calculation.

Please let me know if you have any other ideas.

Thanks alot

Adam

Answers (2)

Answers (2)

AyanBishnu
Active Contributor
0 Likes

Hi Adam

Please try the following

Make sure that both the PL WKPRODLOC and your custom PL are identical in terms of time period and all other non root attributes. The 2nd error that you shared is a normalization errror. So please do the following

Create a intermidiate KF which should be a calculated KF and have the Base PL as WKPRODLOC. Mark that KF as indirect input. Put calculation in the intermidiate KF to populate the data from the custom KF which is at a ZWKPRODLOCCUSTSO level using KF expression.

Then use that intermidiate KF as an input to the SOH standard KF and mark the SOH as both stored and calculated. I did a similar thing with the standard input KF MINTRANSPORT and that works fine.

Please keep me posted on your findings.

Ayan

Former Member
0 Likes

Thanks Ayan

I have tried to follow your advice but I cannot get it to work unfortunately: I always end up with error(s).

For now we will use the copy operator and I will maybe come back to this later.

Regards

Adam

revanchatraban
Participant
0 Likes

Hi Adam,

You can follow the steps explained below. Hopefully should work fine.

Define key figure KF2 with base planning level ZWKPRODLOCCUSTSO and is calculated.

Then add the below logic for calculation:

KF2@REQUEST = KF2@ZWKPRODLOC

KF2@ZWKPRODLOC = SUM(KF2@ZWKPRODLOCCUSTSO)

KF2@ZWKPRODLOCCUSTSO = SUM (KF1@ZWKPRODLOCCUSTSO)

Regards,

Revan C

Former Member
0 Likes

Thanks for your reply Revan

However KF2 must have base planning level ZWKPRODLOC as it is INITIALINVENTORY and is used in SOP Operator.

Knowing this do you see a way another way?

Thanks

Adam

revanchatraban
Participant
0 Likes

Hi Adam,

I think it should be possible with the use of Helper Key figure and Use the helper key figure at the aggregated level in Initial Inventory key figure. I don't have the exact calculation steps.

Regards,

Revan C

Former Member
0 Likes

Thanks Revan

I tried to add an intermediary key figure but I still get an error : see my below comment to Ayan.

So maybe it is not possible as my KF2 is an input for supply planning?

Thanks for you help

Adam

Ask a Question