Skip to Content
author's profile photo Former Member
Former Member

how to get current month accoring to input Calenday for query

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.

Add a comment
10|10000 characters needed characters exceeded

Related questions

6 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 24, 2011 at 11:52 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 24, 2011 at 03:04 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 24, 2011 at 03:32 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 24, 2011 at 06:40 AM

    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-fcac7890585f?QuickLink=index&overridelayout=true

    -


    Thanks

    BVR

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 24, 2011 at 07:02 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.

  • author's profile photo Former Member
    Former Member
    Posted on Aug 24, 2011 at 09:49 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.