cancel
Showing results for 
Search instead for 
Did you mean: 

how to get current month accoring to input Calenday for query

Former Member
0 Kudos

Hi guys,

Now I want to calculate the summation of key figure KF1 during current month according to the input calenday.

For example, when inputing 20/01/2011, i want to get the summation of KF1 from 01/01/2011 to 31/01/2011.

If don't make enhancement for variable, How can i get the correctly result?

Look forward to your reply!

thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I guess you have 0CALMONTH in your infoprovider. Add it to the query.

Remove the global variable on calendar day. Create a selection in the columns and add calendar day and the input variable. User enters date to this variable. Create selections for the other key figures and add 0CALMONTH. Create a variable (single value, replacement path) on calmonth. In the replacemnet path tab, give replace by variable and give the name of calendar day variable. in the offset section below, put 0 for offset start and length as 6. This variable returns the calendar month of the date that is input by the user. If he enters 15/06/2011 he would get summation for June.

Former Member
0 Kudos

Hi Murali Krishna K

According to your advise, removed the global variable, it can get the summation of month with user entry the calenday.

Thanks very much.

Dragon.

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi all,

Yes,As your advise said that if we make an enhancement for Variable in CMOD, it can be done.

I just wonder whether there is a solution without do any enhancement in CMOD!

Thanks your reponse!

Best Regards,

zhenfu.

Former Member
0 Kudos

Hi Dragon Cao,

No need to create any customer exit variable for this ..

You have standard variable CMONTH this displays current month summation. Just restrict your Key figure with this variable.

And in properities of Key figure goto Calculations> Local Calculations> select Summation.

If you want to assign some calday at run time sure you need to create customer exit variable using Step_2 value in enhancements(CMOD).

Regards,

Rajeswari.

Edited by: mrajeswari on Aug 24, 2011 12:35 PM

Former Member
0 Kudos

Hi Rajeswari,

The standard variable CMONTH is only get the current month. And my requirement is how to get the summation for any month according to the input calenday. For example, current month is Aug, when query execting, user inputing calenday 15/06/2011, i want to get the summation of June.

Thanks.

Best Regards,

zhenfu.

Former Member
0 Kudos

HI,

Write a customer Exit variable to find the fist day of the month and last day of the month, Restrict your KF with variable value from and To Date.

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b0b25093-b548-2e10-0cba-fcac78905...

-


Thanks

BVR

Former Member
0 Kudos

Hi,

Based on the input date if you want to give the range as complete month then you will have to create customer exit variable. I don't think dynamic range specification using formula will be possible.

After creating the customer exit variable you can use it in RKF.

Regards,

Durgesh.

Former Member
0 Kudos

Create a Restricted Key figure (Restrict the KF1 using the Calday characteristic) and then go to the properties of the Restricted key figure>calculations>Local calculation-->Select Calculate result as: Total.

Former Member
0 Kudos

Hi YJV,

I can not get the correct result according your advise. Anyway thanks your reply.

srikanthbwbw
Active Participant
0 Kudos

Hi,

the only way i see this is thru customer exit variable. or

Create two variables

1. on date

2. On calmonth.

User needs to enter both the variables when he runs the report.

Variable 1: 20.08.2011

variable 2: 008.2011

thanks

Srikanth