cancel
Showing results for 
Search instead for 
Did you mean: 

DP Macro with User Defined Horizon

Former Member
0 Kudos

Hi All,

I'm hoping this is a very simple request..

I have a requirement to sum 'x' months future demand into a separate key figure.. All very simple except 'X' is a variable value..

So for some customers they want X to be 5 months, others x is 3 months and so on..

I was thinking along the lines of a separate key figure to hold the value 'x' and is populated by the user.

similar to an excel mock up below:

(Requirement is the value 'x')

This mock up only shows one value of X per combination, but in reality X could change, eg example 1 could have an x of 6 in month 4. so should sum the next 6 months sales.

As you can see, its not too complex and I hope someone can help.



Accepted Solutions (0)

Answers (3)

Answers (3)

ruchi_das2
Active Participant
0 Kudos

Hi S SB,

There is a standard macro function available in SNP to perform a similar calculation. However, I assume you need it in DP. The link below gives you exactly what you need.

Regards

AK

Former Member
0 Kudos

Hi

Might be quick questions, where is this X values is maintained or stored for each CVC.

Once we have this information, I think I can give you solution for it.

Thanks

Amol

alok_jaiswal
Contributor
0 Kudos

Hi,

What would be the reference of the user input for the date horizon - will it be stored in any internal/Z table or maybe through TVARV setting?

For setting the custom horizon, you can use BADI Macro and write the logic inside that so that date horizon will be chosen accordingly for macro execution.

1119651 - Creating a BAdI macro


Hope it helps.

Regards,

Alok

Former Member
0 Kudos

I was simply thinking it is stored in a key figure.


So with that in mind is there any non-BAdl approach you can suggest.

We can get this working in excel using the 'OFFSET' function... is there anything similar in DP macros?