cancel
Showing results for 
Search instead for 
Did you mean: 

Macro calculation

0 Kudos

Hi Gurus,

Thanks for all your support till date...

Here is another new requirement which I am facing bit difficult to address the client, experts please help me in resolving.

According to the client requirement, they want the forecast values at a product group level(aggregarted level) to be divided into product level(dis-aggregated level) in percentage basis and this percentage value we will be getting from historical key figure( average of last 6 months history data)

UOMJan'14Feb'14Mar'14Apr'14May'14Jun'14Jul'14Aug'14TotalAvg.% of his.Sep'14
HistoryTotal(A+B)PC54293818791112671810055034961826.8333
Mat APC301566855249004866243583577596.16670.721023
Mat BPC241371332672262323811451384230.66670.278976
ForecastTotalPC625
Mat APC450.64
Mat BPC174.36

Total - total of six month history data

Avg - avarage of 6 month history

% of his - percentage of each material history data

here 625 forecast value should be disaggregated on percentage bases.

Mat A    450.64= 0.721023*625             Mat B    174.36= 0.278976*625

Please help me is creating MACRO and work in sap interactive planning book.

Thanking you in advance.

Thanks & Regards

Smitha Naidu.

Accepted Solutions (0)

Answers (4)

Answers (4)

0 Kudos

Hi Gurus,

Please give a solution on this issue.

Thanking you in advance.

Regards

SmithaN

jagannadhb
Active Participant
0 Kudos

Hi Smitha,

You can execute as a start or a default macro.

Let me explain you the macros.

Macro 1

Average History KF will be calculated based on the past 6 buckets, so if you have a start macro, even if it is the current bucket, it will take the last 6 buckets and give you the average.

When you give the disaggregation type for Forecast as P, based on Avg history, it will drill down accordingly.

Macro 2

This macro is only for drill down at detailed level (Product) which comes into picture if you are loading a group of Products at a time,

Hope this helps

Regards,

JB

0 Kudos

Hi JB,

I have exected the above described two macros but still not getting correct answers.

I will once again explain what I am trying to do as suggested by JB and Arno....

Step 1: In planning area 3 key figures a. History -"S" 

                                                            b. Average History -"S" 

                                                            c. Forecast -"P"

Also check the Manual Proportion Maintancence in Planning book

Step 2: In /n/sapapo/mc8v - calculate proportional factor...... and executed.

Step 3: Created two macros as specified above

Step 4: Tried to load the data at material level and here are the results:

I am not seeing the results which I want. Please help whether can we meet this requirement in SAP or not.  If yes, kindly help me with answer.

Thank in advance!

SmithaN

jagannadhb
Active Participant
0 Kudos

Hi Smitha,

By the way why did you use Proportional factors. You could have given, the dependent KF as Avg KF.

Regards,

JB

0 Kudos

Hi JB,

Please suggest me if I have to use the proportional factor or not. If not directely executing the above two macros will help me to get the results which I am looking for.

Thank you.

SmithaN

jagannadhb
Active Participant
0 Kudos

Hi Smitha,

For the Forecast key figure properties, give the calculation type as P and the reference KF as the average KF

Regards

JB

jagannadhb
Active Participant
0 Kudos

Hi Smitha,

Did it work as expected?

Regards

JB

0 Kudos

Hi JB,

Still I am not getting expected results.

Changed the above setting in /n/sapapo/msdp_admin and then tried to load the data which executed the macro automatically after loading data.

But no change in results.

Regards

SmithaN

0 Kudos

Hi Smitha,

Proportional factors is the way to go. I suppose you have properly maintained your KF settings in your planning area for disaggregation.


You need to initialize your Forecast KF, then enter the forecast again in order for the engine to perform your new disaggregation rules. Please follow the steps below:

1. Calculate your proportional factors

2. Check your results from the APODPDANT KF in your planning book in percentages values. They should match your expected results. If not, it means you have not properly calculated the proportional factors.

3. Backup the data from FORECAST KF to an infocube or to another planning version

4. Delete/initialize the single key figure FORECAST using a macro

5. Restore the data at product group level from infocube or planning version so that the system can disaggregate at product level using the new proportions.

This should work, that's a very standard functionality.

Regards,

jagannadhb
Active Participant
0 Kudos

Hi Smitha,

Here is a probable solution:

Create a KF ("Average History") and give the Disaggregation type as "S"

For "Forecast" KF, use disaggregation type as "P" and give the reference KF as "Average History".

You might also probably need to drill down internally using a similar macro as follows

If you want both the macros in one single macro (to avoid confusion), you can use a collaborative macro

Hope this helps.

Regards

JB

0 Kudos

Hi JB,

As specified above my forecast key figure values should disaggegate based on past 6 month history percentage.

Step 1: I have planning area with these 3 following key figure and respected calculation type...

               1. History - "S"

               2. Forecast - "P"

               3. Avarage history - "S"

Step 2: Created the macro to calculate avarage history

Step 3: Create the macro for drill down product characteristics

But I am not clean on when to executing this macro and what will be the result.

Please help me in understanding on this macro.

Thank you

SmithaN.

Former Member
0 Kudos

Hi Smitha

Bellow an axample taking 12M history and generating APODPDANT for the 24 next Months

In case of doubt, save the variant and reload it again to check the data

KR

Arno

0 Kudos

Hi Arno,

I am very much thank full for the reply.

I have tried with above details and execute proportional factors and want to share my anaysis...

Manually calculated values are not matching with proportional values calculated.

Thank you

Regards

SmithaN

Former Member
0 Kudos

Hi Smitha

What I can understand, you were waiting a split from 359.8/166.1 and you found in the system 356/170 after entering the value 526 on the top level.

the same with the value 581, but the gap is higher.

1/ Which calculation type are you using in your planning area for the Forecast KFig (P or I)?

On my opinion P should be better if you want to make sure that you're always using the APODPDANT value for the disaggregation.

If you are using I, try to set the value "blank" first (not 0),type enter and set again 526 .

2/ One thing to check too, is the rounding impact at lowest level because dividing your total value in many CvCs (lowest level) can differ from the theoretical split at SKU level.

KR

Arno

0 Kudos

Hi Arno,

I am sorry last time I have inserted wrong attachment.

I am using P as disaggregated factor for forecasting key figure. But results are odd to see.

Thanks you

SmithaN

Former Member
0 Kudos

Hi Smitha

That's a very strange result. Did you check the value set into the proportional factor KFig (APODPDANT).

You can check it in unit or %

KR

Arno

Former Member
0 Kudos

Hi Smitha

Did you tried before using a macro to set the APODPDANT as disagg KFig for the Forecats KFig and running the proportional factor with 6 Month history / fixed proportion ?

KR

Arno

0 Kudos

Hi Arno,

Can you please help me in creating the propogation factor.

Thanking you in advance.

Thanks & Regards

SmithaN

Former Member
0 Kudos

Hi Smitha

You have many steps to do and it's not easy to explain in 2 words

First you have to check the planning area settings

"TA: /SAPAPO/MSDP_ADMIN - SNP and DP Administration",

select your planning area and go into "change KFig settings" --> If you never did it before, be careful this transaction is quite powerful and with old APO release like 4.1 you can't always change settings

You should have as settings for your Forecast KFig something like I or P for the calculation type and APODPDANT for the Disagg KFig.

Then you have to set into the "TA: /SAPAPO/MC8V - Calculate Proportional Factors"

the information needed to generate the proportional factor (APODPDANT) and schedule it (once a Month)

Please check the SAP Help pages to have more information about these 2 TA

KR

Arno

0 Kudos

Arno,

I need help specific to proportion factor calculation based on 6 months history data, rest all I have made the settings along with /n/sapapo/msdp_admin settings.

Or please provide me with link for SAP help on proportional factor.

Thank you.

SmithaN

Former Member
0 Kudos

Hi Smitha

Starting from /SAPAPO/MC8V - Calculate Proportional Factors

  1. On the Calculate proportional factors screen, make the following entries:

Field name

Comment

Planning area

Planning Area

Your planning area

Basis for proportion calc.

Choose Planning Area

Choose the radio button

Name

Your planning area

  1. Choose Execute (F8).

  1. On the /SAPAPO/RMDP_SHARE_MANAGER screen, choose the Basic Settings tab page, make the following entries:

Field name

Comment

Basis for proportion calc.

Planning version

000

Key figure

Base key figure used to calculate the proportion factor. (History)

Period from

Mar 14 

To

Aug 14

  1. Calc. proportions for

Planning version

000

Transfer proportions to horizon

From

Sept 14

To

End of your horizon

Proportion calc. type

Fixed Proportions

Check the radio button.

In this case, the resulting proportional factors for a characteristic values combination are the same for all time buckets within the specified horizon.

  1. Choose Save. And create your variant
  • Nota you can set (Beginning of mth-6 months, end of mth-1 month with selection variable D for the from period) and ((Beginning of mth+0 months, end of mth+xx month for the to period

--> You have maybe to use May-Sep 14 and Oct-xx 14 now because current Month is October

You can use the “Other settings” Tab and set a specific selection profile for running the proportional factor


Hopping this functionality can help you and cover your business need


KR

Arno

0 Kudos

Hi Arno,

I am trying to configure the above setup, I have a doubt regarding rolling horizon.

As in this case I have consider last 6 months history to disaggregate forecast values in different percentages.

So how should I specify here -  ((Beginning of mth+0 months, end of mth+xx month for the to period)

What is xxx and yyy value to be entered.

Thanks for your kind reply.

Thanks & Regards

SmithaN