Question:
I have a Macro written that performs some logic (Validate that data input into an override Key Figure and ensure that the sum of a specific editable area (Current Week"Sunday - Saturday": 3/4 - 3/10) = 100 and other good stuff!).
My Issue/Concern/Question?
I wrote this Macro yesterday 3/5/2007 and as mentioned above intentional calculation area = 3/4 - 3/10. This morning (today 3/6, the dates were 3/5 - 3/11, I manually changed it back to 3/4 - 3/10, but would assume tomorrow, dates on the macro will move again to 3/5-3/11. I would like to have the macro calculate for the fiscal week "Sunday - Saturday" and continues to use this calculation area till the start of the next week, when the calculation will shift to 3/11 - 3/17 and so on.
I am seeking your help in terms of what is needed to make this happen?
Do I have to do something alongside "date functions" lines to control the macro calculation dates? I appreciate your Help.
Regards,
Ihab Hassan
[/img]
Answer:
I can only think of a UserExit macro for this purpose.
Because, we cannot achieve this requirement using the number of iterations of the Macro step; Because, as you specified, the iterations cannot consider your fiscal calender.
Answer:
you can try to use WEEK_BDATE( TODAY ) and WEEK_EDATE( TODAY )
SAP normally takes monday as day 1. So you might need to alter this
Answer:
Hi ihab hassan,
You are making a basic mistake. I can answer part of your question.
1. For the calculation to be in fixed days 3/4 - 3/10, you should not define in "User defined" processing area in your step. If you do, as per the definition, the start and end dates are always placed at the same place relative to the period. That’s the reason why your start and end dates are rolling along with your periods. For achieving your dates, you should actually use "Date Dependent" and give your exact dates.
Thanks.