cancel
Showing results for 
Search instead for 
Did you mean: 

APO-DP Macro using specific fiscal periods

Former Member
0 Kudos

I am needing to have a macro that will copy one key figure to another for specific fiscal periods (ex. P1-P6) and always use these periods.  I was thinking unchecking the 'Automatic Column Adjustment From-Column' would handle this but when the new period started the macro is pointing at P2-P7 now rather than P1-P6.  How can I get the macro to ALWAYS use P1-P6?

Accepted Solutions (1)

Accepted Solutions (1)

former_member187488
Active Contributor
0 Kudos

Hello, in the step's definition, please use 'Date-Dependent' instead of 'User-Defined', and defile the dates you want.

Former Member
0 Kudos

Thank you.  This will work great for one of my scenarios.

Former Member
0 Kudos

Ada, I was testing the macros with the date dependent and saw something strange.  When I prompt on the step and select Date dependant I choose dates of 08/28/2011 - 11/19/2011.  But when I return to the macro the interations shows as 08/28/2011; 10/23/2011 rather than 11/19/2011.  Do you know why this would be or what I need to do to get the correct dates to show on the macro screen?

former_member209769
Active Contributor
0 Kudos

Hi Stephen,

23.10.2011 corresponds to the beginning of your period 9.2012. Seems your planning view doesn't have dates till 19.11.2011.

3 iterations till 23.10.2011? How is that possible? You should have 3 iterations till 11.09.2011.

Can you please share a complete screenshot of your planning view? I think there is some confusion somewhere. I don't think your data display in planning week is in fiscal year periods, which match with the weeks (as per your maintenance in FYV).

Thanks - Pawan

Former Member
0 Kudos

Pawan, the 3 iterations corresponds to our fiscal years which equal 4 fiscal weeks each.  We have data views for fiscal period and one for fiscal weeks. I am running these macros in the fiscal period data view. 

What exactly do you want to see in the planning view?  Are you referring to sdp94 or some other screen?

Steve

Former Member
0 Kudos

Pawan, I believe I figured out the issue with the date dependent.  I had switched the view in the planning book to show current bucket begin date and I didn't realize this carried over to the macro development screen.  When I switched it back to show the formatted view it is showing correctly and calculating correcting. 

So now if we could figure out the 'bucket_bdate' and 'date' issue we have been discussing.

thanks

steve

Answers (1)

Answers (1)

former_member209769
Active Contributor
0 Kudos

Hello Stephen,

I am assuming that you have the periods as fiscal periods in your data view. The following should be a good option for you.

You could do a check for the column(s) that the beginning dates and the end dates for your buckets are >= "beginning date of P1" AND <= "end date of P6", and then only if your bucket lies within this range, do your copy calculations.

Write a macro step to do the following check for ALL the buckets in your view:

IF

BUCKET_BDATE(

Row: < Key Figure Name> ( Frm <First period of your view> )

)

>=    <beginning date of P1>

AND

BUCKET_EDATE(

Row: <Some Key Figure Name> ( Frm <First period of your view> )

)

<=   <end date of P6>

<Do your copy calculations>

ENDIF.

PS: For the rows in the macro which read "Row: <Some Key Figure Name> ( Frm <First period of your view> )", make sure that you doubleclick and select the option of 'row attributes' from the dropdown menu of the field "data" in the section "Data source: Value or Row/Column attributes".

Thanks - Pawan

Former Member
0 Kudos

Pawan, this sounds like what I need, but I am having trouble getting it to work.  I am getting some German error message.  Can you tell what I am doing wrong?  For this particular macro I want to process if the period is between P1 and current period.  So I am including periods from current period back one entire fiscal year, then check the bucket bdate to make sure it is at least P1.

former_member209769
Active Contributor
0 Kudos

Hi Stephen,

1) Do not have a bracket before the step of bucket_bdate, and also in the end of your IF check. They are not needed.

2) I guess you maintained a space between > and =. There shouldn't be a space.

3) For your above requirement, I hope you used 'processing area' as 'past'. You should do this check from the first period of your planning view onwards.

4) Format for date check would be (I think the below should work)

IF

Date check step

     BUCKET_BDATE(

     Row: Budget Forecast (3+10) ( Frm <First period> )

     )  >= DATE( 28082011 )

<Caclulation Step>

ENDIF

Thanks - Pawan

Former Member
0 Kudos

Pawan, thank you for your help.  I have gotten it closer now - at least able to generate and get some results.  I am not understanding the value I need to use to compare to.  I tried using the date as you stated (28082011) but  I get no results.  I did some research on the internet and it refers to a whole number in reference to 01.01.0001.  I have gotten results if I use the value 733482 starting at the beginning of my horizon (P8 / 2009) and not where I want it to start in P1 / 2012 (which is 08/28/2011).  If I change the number past 733482 I get no results, even just one past to 733483.  How do i determine what this value needs to be so that my calculation starts in P01 / 2011 or 08/28/2011?

Thanks

Steve

Former Member
0 Kudos

I missed where you had the DATE function on the comparision line before.  I tried that as below but it is copying starting at beginning of horizon rather than date specificied.  I.E. I get values copied from P08/2009 forward.

Former Member
0 Kudos

Using the DATE function with date format of YYYYMMDD I get no values to copy.  I feel like this is really close but missing something.

former_member209769
Active Contributor
0 Kudos

Hi Smythe,

This last usage is actually looking fine.

Could you:

1) Do a check for the macro in ADVM, and see if that throws any error?

2) Could you pls share how you are maintaining your Fiscal Year variants strating from the year 2009 till 2011?

3) Go to 9AEXAMPLES view in macrobuilder, and see the usage of DATE and BUCKET_BDATE function. Try to add a POPUP step in your 28.08.2011 bucket to see if DATE and BUCKET_BDATE function are able to pick up the dates from your period beginning 28.08.2011 or not.

Thanks - Pawan

Former Member
0 Kudos

Pawan,

1) I am able to check / create without any errors in ADVM.

2) I have attached a document with the fiscal year variants.  Let me know if this isn't what you are looking for.

3) I have modified the macro to create popups for both bucket_bdate and date using the same date (2011-08-28) which is the beginning date of P1 of fiscal year 2012.  But for some reason I get different results.  For bucket_bdate of P1 / 2012 I get 733482 but for DATE ( 20110828 ) I get 734378.  I would expect these to be the same value. (I have also attached screen shots of the testing popups.)

former_member209769
Active Contributor
0 Kudos

Hi Stephen,

1) It seems you gave me a list of all the FYVs that you have in your system. We need to know which FYV is being used for your planning view, which means which FYV is maintained for your planning area. Go to your planning area in /sapapo/msdp_admin, and note the Storage Bucket profile (SBP). Then go to menu path Demand Planning-> Environment-> Current Settings->
/SAPAPO/TR32 - Periodicities for Planning Area. Give name of the Storage bucket profile and see which Fiscal year variant is maintained for the planning area.

2) Your fiscal variants are not very simple, but maintenance looked ok at a first glance. Your answer to point 1 would let us know which fiscal year variant is being used. Parallely, let's see what really are the start dates in your planning view's periods. Load some data in the planning
view. Right click where you see the cell containing period name e.g. the cell reading P 01.2012. You would see an option "Period information/description". Click on that. In the pop-up box, specify display type as "bucket start date". Now you would be seeing the bucket start dates. Let's see what start date you see for P 01.2012.

Thanks - Pawan

Former Member
0 Kudos
former_member209769
Active Contributor
0 Kudos

Hi Stephen,

This is quite confusing. I am not able to think the reason for your discrepancy in DATE & BUCKET_BDATE.

I also noticed that the bucket next to P01.2012 is showing starting date as 09/25. I would have expected it to show 09/04 as per your fiscal year variant ZW. By any chance, did you happen to change your FYV recently?

I think you could try running the Time series consistency check. Go to your planning area in /sapapo/msdp_admin. Click on extras-> Consistency checks-> time series. Run the consistency check with all the options ticked (apart from may be "SNP master data".) If you get any errors, correct them.

The solution from Ada would take care of your requirement of having calculation within specific dates, unless you have some special need which I am not aware of as of now. Did you already try it?

OR

There's another function "BUCKET_DESCRIPTION(): Period Description" that I think you could use if you really need to identify the bucket for some calculations. This would give a result like "P 01.2012".

Thanks - Pawan

former_member209769
Active Contributor
0 Kudos

Hi Stephen,

I would like to see the planning view that you are using for the "weekly" calculations. (I was assuming that you used the word "periods" for the weeks). I would like to see the period names (headers) that you see in the planning view, and also the bucket beginning date that you are seeing in planning view, when you switch the view to see the bucket beginning date.

Please give me screenshots from the planning view (as mentioned above), and also the planning view definition from /sapapo/sdp8b.

PS: As I understood from the definition of FYV, you are using only 52 periods, and not 53. I am not sure if there would be any side effect of defining the no. of posting periods as 53, and then using only 52 periods. But let's keep this on the backburner, as for making change to FYV, you would need to take many steps before the change would work properly.

Thanks - Pawan

Former Member
0 Kudos

I have attached screen shots of the planning view headers for both period (fiscal period) and fiscal week data views and also the sdp8b screen.