cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic dates in variants for proportion factor calculation

Former Member
0 Kudos

Hello all

As part of our demand planning we run calculation of proportional factors in a batchjob with a variant.

In the calculation transaction for proportional factors I'd like to calculate the Date from field at the top dynamically. I need it to be the first day of the current month 3 years in the past (like it's october now, so the field should contain 1st of october 2005).

However i can't seem to accomplish this with any of the dynamic date options in the variant. The closest is the (Beginning of mth-xx months, end of mth+yy months) one, but it requires two parameters and i only have one.

I can also hit the date by subtracting 761 workdays from the current date, but tha'ts not a very good solution since it will become inaccurate in the future.

Does anyone have any ideas how to accomplish this?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I need the From field to be the first day of current month, but 3 years in the past.

Further down in the screen i have a from and to field where i can use the (Beginning of mth-xx months, end of mth+yy months) calculation - that works great but it can only be used when you have both a from and a to field

I can get it to work by using the current date -xxx workdays, that also works but it will need to be maintained all the time if we do that.

Former Member
0 Kudos

Hi Simon.

Here's something that should work.

- Create a new factory calendar (trans SCAL).

- For the calendar select a holiday calendar with no holidays (or create one)

- Deselect all days of the week so that there are no workdays

- Save the new calendar

- Create special rules; 1 for each 1st of the month going back at least 3 years and going forward as much as you want to maintain, setting each one as a workday.

- Save the calendar

-


- Create the variant for the prop factor calculation

- For the 'From' field select Dynamic Date Calculation

- For the name of variable select "current date +/- ??? work days"

- Enter your newly created factory calendar

- for the number of workdays enter -36 (or is it 35, you'll have to test)

- Save variant

This should work.

Hope this helps, M

Edited by: percx on Oct 20, 2008 6:14 PM

Former Member
0 Kudos

Hi Simon.

Following a bit of testing, it will work with -37 (as long as you are not running it on the 1st of the month).

Beware however, that it could change on enter to the bucket begin date depending on how your storage bucket profile is set up.

Rgds, M

Former Member
0 Kudos

Thanks Percx, I think that will solve the problem nicely. It's a clever workaround, thanks!

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Simon.

What date are you looking to populate the 'To' field with?

Rgds, M

Former Member
0 Kudos

You can use screen varaint .

Use FM RS_VARIANT_CONTENTS

this will help you.

How to , see below threads.

/message/5080380#5080380 [original link is broken]

/message/5080380#5080380 [original link is broken]

Other option is using TVARVC table but you need to update value daily in this table through some Z program.

Manish

Edited by: Manish Kumar Rathi on Oct 14, 2008 12:30 PM