cancel
Showing results for 
Search instead for 
Did you mean: 

Macro for an Index number

Former Member
0 Kudos

Dear Macro Experts,

Here's a fairly straightforward macro. I wont comment on the crudeness of this macro but planner needs it

Row R2, bucket in Calendar year y1

=

Row R1 bucket of calendar year y1

Divided by

SUM of 12 calendar months of year y1, IF non-zero, ELSE, Multiply the SUM by

I couldnt land a function to find sum total of calendar year. I found quarter() but not sure what to do it.

I am a novice in everything. Please help.

Thanks

Guru

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

in these situations, if you can´t find the right function, just create a step that does the SUM calculation by building your final value bucket by bucket (checking year and those things with IF, ELSE etc...), store it in a variable and use it in a second step. If there are several years involved, you can use an auxiliary row where each bucket has the sum of that year, so your division is simpler. There is a point where you end with no other choice but step+step+step.... There are no nested loops in macros, so the step after step approach is usually the most likely to work unless you can jump to BAdI macros, which require some ABAP skills.

regards,

J.

Former Member
0 Kudos

Thanks James,

step + step + step with auxilary table is how I managed to make this work.. precisely because there are multiple years. But this is probably a big insult to macro workbench 🙂 and its creators.

Thanks anyways. Much appreciate

Guru

Former Member
0 Kudos

No other way in a single macro, I am afraid

Answers (0)