Last day of each month in a year based on a Input date?

Hi all,
I have a request from a customer who wants to have a yearly report created in BEx Query Designer which starts in January up to December and they want to have a Month To Date (MDT) and Year to Date (YTD) calculation of a key figure. This report will only show one year at the time based on the date the user give as input at the Variable Screen.
This key figure should be calculated by using the last date of each month for input when performing the MTD and YTD calculation and summarizations.
Example:
January: 31.01.2008  Key Figure = 1000. MTD = 1000 and YTD = 1000
February: 29.02.2008  Key Figure = 2500. MTD = (2500-1000) 1500 and YTD = 2500
March: 31.03.2008  Key Figure = 6000. MTD =(6000-2500)=3500 and YTD = 6000
Etcu2026.
This means that I have to have a lot of hidden Key figures which gets restricted on the different month end dates and formulas to calculate the different MTD and YTD results for the months as the year progresses.
The way I have solved it now is that I have a Customer Exit which gives me the Last day of last year (Exp: 31.12.2007) based on input date and use a Offset on the last day of last year date to get the different last dates of each month.
Since we have a leap year (one extra day in February) this year, the offset to calculate the end month dates will be different for 2007 and next year (2009). This solution is not very flexible, and it will not give the correct MTD and YTD if the customer wants to go back to 2007 and off course next year (2009).
One solution is to create 12 Customer Exits that gives me the different month end dates (January-December), and also takes in account leap year for February for the different years. These Exits will be based on the Input date the Customers put in at the variable screen.
I would rather want to avoid making 12 new customer exits and want your advice and expertise to find out if this is possible in any other way (maybe with only 1 customer exit) to get the last date of each month based on an input date.
Thanks for all your advices on beforehand.
Regards
Oddmar Lid

Hi,
Thanks for you replay and documentation, but it doesn't give me excatly the functionality I'm after. The only MTD calculation code the document provides is the calculation of the following functionality:
"Month to Date (MTD) u2013 From the 1st of month to u201CKey Dateu201D - for current year." This doesn't give the the functionality I want, which is to retrieve a given vaule for a Key Figure for the last dates of the months in a year to calculate MTD and YTD.
This way I have created the query is to have multiple hidden Key Figures that calculates the MTD and YTD.
In Columns in Query Designer it will look something like this:
Selection: MTD January--> Date = 31.01.2008, Key Figure (Always Show)
Selection: YTD January --> Date= 31.01.2008, Key Figure (Always Show)
Selection: MTD February --> Date= 29.02.2008, Key Figure (Always Hide)
Formula: MTD February --> MTD February - MTD January (Always Show)
Selection YTD February --> Date = 29.02.2008, Key Figure (Always Show)
And so on....
This is off course a simplified version, but it shows the core of the solution. What I want to achive here is that the dates used to get the Key Figures (last date of a month) is calculated as flexible as possible, so that the users can go back and forth in time without worrying about the leap year problem and so on. I have now used an offset from the last date of last year and this is good for all the normal years, but when it is a leap year the query will use wrong dates to get the key figure vaule for the last date of each month.
Any ideas on how to achieve this without creating 12 different Customer Exit variables (one for each end date of each month)?
Thanks
Regards
Oddmar Lid

Similar Messages

  • Define event to repeat on the last day of each month?

    (I've searched the forum and can't find this question addressed)
    I want to create a repeating event for the last day of each month. Is this possible?

    Unfortunately Apple does not have an option available that allows you to add an event repeating on the last day of the month. An "OK" way around this would be to repeat on the 1st of every month and send a reminder a day earlier. I know this is less then perfect but the only option currently available. If you happen to find a 3rd party program that allows such integration please don't hesitate to mention it here as I have been looking for this sort of option for quite some time now!

  • How to create appointment occurs last day of each month

    Hi Preston,
    I am trying to create a monthly recurring appointment occurs on last day of every month in .Net. E.g. start at May 31, 2010 end at May 31 2011 every month.
    I specified the frequency as monthly, byMonthDay[0] = (sbyte)31. But this only generates the instances on those months contain the 31th day. My question is how to also create instances on 30th day for those months don't contain the 31th day.
    Thanks,
    John

    The recurrence rule logic is patterned after the recurrence
    logic in iCalendar (http://www.ietf.org/rfc/rfc2445.txt)
    If you have questions, first look there. Then look at the
    schema itself.
    In the schema the definition of DayOfMonth will handle
    negative numbers:
    <xs:simpleType name="DayOfMonth">
    <xs:restriction base="xs:byte">
    <xs:minInclusive value="-31"/>
    <xs:maxInclusive value="31"/>
    </xs:restriction>
    </xs:simpleType>
    <xs:complexType name="DayOfMonthList">
    <xs:sequence>
    <xs:element name="day" type="tns:DayOfMonth" minOccurs="0"
    maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    So, the last day of the month would be -1. The second
    to last day would be -2 and so on.
    >>> On Wednesday, May 26, 2010 at 11:56 AM, Johnny
    77<[email protected]> wrote:
    > Hi Preston,
    >
    > I am trying to create a monthly recurring appointment occurs on last
    > day of every month in .Net. E.g. start at May 31, 2010 end at May 31
    > 2011 every month.
    >
    > I specified the frequency as monthly, byMonthDay[0] = (sbyte)31. But
    > this only generates the instances on those months contain the 31th day.
    > My question is how to also create instances on 30th day for those months
    > don't contain the 31th day.
    >
    > Thanks,
    > John

  • How do I find the start day of each month

    Hi all,
    Hope someone can give a a hand here I've to do a calender project for college and I'm not allowed to use any built in Java classes so fun all the way so far :-)
    I've got one question that is bugging me at the moment. and that is how to find the start day for each month in a year and store them in an array.
    I'm starting my week at Monday (0) and stopping at Sunday (6) and I do have a formula for discovering the first day in Jan of the given year its
    ((y-1900)*365 + (y-1901)/4)%7
    I was just wondering how I could amend this to find the first day in Feb, March etc.
    Any suggestions greatly accepted.
    Thanks in advance.

    Irish-Student wrote:
    newark maybe I didnt make clear exactly what I want to do.
    I have each day of the week starting at 0 for Monday up to 6 for Sunday I want to map what the start day of a month as a number between 0 and 6.
    The formula I have discovering the first day of Jan of a given year will give you 1 i.e. Tuesday
    what I need to do is find out what number between 0 and 6 the start day of each other month of a given year is.
    For example the 1st of Feb is a Friday which is 4 on the weekday map.
    Your suggestion of 31%7 won't work for this, sorry more than likely my fault for not being clearer in what my requirements were.
    Cheers for the help so far and yep your right not being able to use the built in classes is a pain :-)
    Edited by: Irish-Student on 03-Mar-2008 20:01This doesn't really change much of my first suggestion. If you can already calculate the first day of the month of January for any given year, then there's no problem figuring out the other months. Say I want to know the first day April 1, 1978. You already know how to find January 1, 1978. So find that. Then find the number of days between January 1 and April 1 (remember to account for leap years). Once you have the number of days, you can figure out how many weeks and days that is, and thus what day of the week it is.

  • SQL select Statement -first day and last day of the month - 1 year from now

    Hi,
    I need to write a SQL to get the dates in between first day and last day of the month one year from now.
    SELECT last_day(add_months(sysdate,12)) as lastday from dual
    What could be the Query to get the first day of the month one year from now..
    ie ..Sysdate - 3-DEC-2009
    Result - 1-DEC-2010
    thank you

    Hi,
    You can use TRUNC with 2 arguments to get the first DATE in a month, year, quarter, week, hour, minute, ISO year, ...
    SELECT  TRUNC ( ADD_MONTHS ( SYSDATE
                               , 12
                  , 'MONTH'
                  )     AS first_of_month
    FROM    dual
    ;The DATE returned will be in the same month, year, quearter, ... as the first argument.
    \We convered the last day of the month in [your previous question|http://forums.oracle.com/forums/message.jspa?messageID=3942939#3942939].
    At that time, I warded about using LAST_DAY as a cutoff point; TRUNC is a much better way.
    For example, to find all appointment_dates in the current month next year:
    SELECT  *
    FROM    appointments
    WHERE   appointment_date >= TRUNC (ADD_MONTHS (SYSDATE, 12), 'MONTH')
    AND     appointment_date <  TRUNC (ADD_MONTHS (SYSDATE, 13), 'MONTH')Note that
    the first part of the WHERE clause calls for dates on or equal to the beginning of the 12th month in the future, but
    the second part of the WHERE clause calls for dates before, not equal to , the beginning of the 13th month in the future.

  • Date: Is it possible to get the last Friday of each month?

    Hello all, I am trying to create a column of dates which are a specific day in each month, e.g. the last Friday of every month, or the first Monday of every month. Is this possible, and if so could you please guide me on how to?
    Thanks
    James

    James,
    My thought was that you would create an array of dates with this table and Copy/Paste Values it into the range where you need it.
    What I did was build a table of controls, below, where I set the year and what day of the week you were interested in and the top table will compute the dates. I used direct entry for the year and a POP-UP menu for day of the week.
    The 4th 'Friday' formula is: =IF(Controls :: $C>$C, $B+Controls :: $C-$C+21, $B+Controls :: $C-$C+28)
    The Last 'Friday' formula is: =IF((G+7)>EOMONTH(B, 0), G, G+7)
    The formula in the Header Row is: ="4th "& Controls :: $B , etc.
    There is no reason you couldn't transpose the table to have your Last Fridays in a row rather than in a column. I don't think I noticed that requirement in your original post.
    And, there's no reason to have a fancy control panel if you don't think you'll ever need to create another series of dates. Just substitute values for the references to the control table.
    Jerry

  • How to get the last day of a month?

    HI,
    I want to know how to get the last day of a month.
    In my JClient form, I tried to get it by using oracle.sql.Date method, that is:
    lastday=oracle.sql.Date anydate.lastDayOfMonth();
    But it does not work. The result is lastday=anydate.
    Why?
    Stephen

    You can use the Calender class...
    Calendar c = Calendar.getInstance();
    and then something like...
    c.add(c.MONTH, 1);
    int dayOfMonth = c.get(Calender.MONTH);
    c.add(c.DAY_OF_MONTH, - (dayOfMonth-1) );
    other usefull functions are:
    System.out.println(" YEAR : " + c.get(Calendar.YEAR));
    System.out.println(" MONTH : " + c.get(Calendar.MONTH));
    System.out.println(" DAY_OF_MONTH : " + c.get(Calendar.DAY_OF_MONTH));
    System.out.println(" DAY_OF_WEEK : " + c.get(Calendar.DAY_OF_WEEK));
    System.out.println(" DAY_OF_YEAR : " + c.get(Calendar.DAY_OF_YEAR));
    System.out.println(" WEEK_OF_YEAR : " + c.get(Calendar.WEEK_OF_YEAR));
    System.out.println(" WEEK_OF_MONTH : " + c.get(Calendar.WEEK_OF_MONTH));
    System.out.println(" DAY_OF_WEEK_IN_MONTH : " + c.get(Calendar.DAY_OF_WEEK_IN_MONTH));
    System.out.println(" HOUR : " + c.get(Calendar.HOUR));
    System.out.println(" AM_PM : " + c.get(Calendar.AM_PM));
    System.out.println(" HOUR_OF_DAY (24-hour): " + c.get(Calendar.HOUR_OF_DAY));
    System.out.println(" MINUTE : " + c.get(Calendar.MINUTE));
    System.out.println(" SECOND : " + c.get(Calendar.SECOND));
    System.out.println();*/

  • How to get same day of a month in every year in the DB ( To update a flag )

    Hi,
    I am trying to formulate an update query for a flag table in our database which contains dates, and flag columns. Currently the system have dates for the next ten years. The flags are updated with values 0 or 1 if a particular date falls under the required criteria.
    I need to update flag column for the same day of the month in every year. e.g. 2nd Sunday of October. The value should be updated to all years in the table. Currently I am using the following query to update the current year.
    UPDATE FILTERCALENDAR SET YEAR_WINDOW=1 WHERE c_date = NEXT_DAY( TO_DATE('OCT-2013','MON-YYYY'), 'SUNDAY') + (2-1)*7;
    and for next year Like
    UPDATE FILTERCALENDAR SET YEAR_WINDOW=1 WHERE c_date = add_months(NEXT_DAY( TO_DATE('OCT-2013','MON-YYYY'), 'SUNDAY') + (2-1)*7,+12)-1;
    This is not an excellent way to do it as it does not take care of leap years and it does not scan and update values in the whole table for all years correctly.
    Can any one help me to resolve this please.

    Hi,
    user10903866 wrote:
    Hi,
    I am trying to formulate an update query for a flag table in our database which contains dates, and flag columns. Currently the system have dates for the next ten years. The flags are updated with values 0 or 1 if a particular date falls under the required criteria.
    I need to update flag column for the same day of the month in every year. e.g. 2nd Sunday of October. The value should be updated to all years in the table. Currently I am using the following query to update the current year.
    UPDATE FILTERCALENDAR SET YEAR_WINDOW=1 WHERE c_date = NEXT_DAY( TO_DATE('OCT-2013','MON-YYYY'), 'SUNDAY') + (2-1)*7;That's the 2nd Sunday after October 1; the 2nd Sunday of October is the 2nd Sunday after September 30, so you need to subtract 1 more day before calling NEXT_DAY.
    I'd do it this way:
    WHERE   c_date = NEXT_DAY ( TO_DATE ( '01-OCT-2013', 'DD-MON-YYYY') - 8
                             , 'SUNDAY'
                     ) + (7 * 2)     -- Last number is week numberRemember, calling NEXT_DAY like this depends on your NLS_DATE_LANGUAGE.
    and for next year Like
    UPDATE FILTERCALENDAR SET YEAR_WINDOW=1 WHERE c_date = add_months(NEXT_DAY( TO_DATE('OCT-2013','MON-YYYY'), 'SUNDAY') + (2-1)*7,+12)-1;If you want the 2nd Sunday in October, 2014, then take the previous expression, and just change 2013 to 2014:
    WHERE   c_date = NEXT_DAY ( TO_DATE ( '01-OCT-2014'     -- or any month and year you want
                                        , 'DD-MON-YYYY'
                            ) - 8
                             , 'SUNDAY'
                     ) + (7 * 2)     -- Last number is week number
    This is not an excellent way to do it as it does not take care of leap years and it does not scan and update values in the whole table for all years correctly.
    Can any one help me to resolve this please. 
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
    In the case of a DML operation (such as UPDATE) the sample data should show what the tables are like before the DML, and the results will be the contents of the changed table(s) after the DML.
    Explain, using specific examples, how you get those results from that data.
    See the forum FAQ {message:id=9360002}

  • How to get last day of a month

    using pl/sql
    What i need is that all members whose birthdate is in the curren month will be included as having had their birthdate regardless of the date of the month. The code i have is:
    Select me607.subscriber_id
    me607.mbr_dob,
    ** trunc(months_between (*end of current month*,me607.mbr_dob) / 12) as age
    from odw.mbr607_member_expanded me607
    The asterixed line is what I need to change. If I put the end of the current month (where I put 'end of current month') then all those whose birthday month is in Feb will show as having had their birthdate. So if run today, folks whose birthdate is 26-feb-2005 will show an age of 5.
    When grabbing the last day of the month using visual basic I just use the first day of the subsequent month minus 1. Any assistance is appreciated..

    Hi,
    This does what you requested:
    Select  me607.subscriber_id,     -- Don't you need a comma here?
         me607.mbr_dob,
         ROUND ( MONTHS_BETWEEN ( SYSDATE
                                , me607.mbr_dob
               / 12
    from    odw.mbr607_member_expanded     me607
    WHERE     TO_CHAR (me607.mbr_dob, 'MONTH') =
         TO_CHAR (SYSDATE,      'MONTH')
    ;If this is run sometime in February, 2010, and mbr_dob is sometime in Febrary, 2005, then the result of MONTHS_BETWEEN will be between 59 and 61. When we divide by 12 convert that to years, that difference of up to one month becomes so small that it will be lost in the rounding.
    If this isn't exactly what you need, tthen post a little sample data (CREATE TABLE and INSERT statements) and the results you want from that data.
    Edited by: Frank Kulash on Feb 17, 2010 1:32 PM
    Added explanation.

  • ICal 3.0: Last day of the month repeating event

    I am migrating back to iCal after a few years using Entourage. I am trying to set up calendar events and reminders for the last day of every month, but I can't figure out how to do it. In Entourage this was easy. Any advice? Thank you.

    I would like this to be an easy feature included in iCal as I get paid on the 16 and second to last day of the month. I want iCal to show the event in the calendar, not for me to set the event and have an alarm for 24 hours before. I tried the trick found at http://www.macworld.com/article/47872/2005/11/trickical.html but that does not work with iCal 3.0.
    Any help would be appreciated or maybe Apple adding this in the repeating section of the ical event seeing it is apart of the icalendar specification.
    tim

  • Last day of previous month for data load

    Hi,
    I have to load data from the previous month into the psa and then into an infocube. I was wondering as to how to get the last of the previous month to write a code in ABAP. I will be writing the code at the infopackage level in the data selection. I could load data from the 1st of the previous month to the 1st of the current month. This will be an additional load of 30,000 records for the 1st of every month, since I will be loading 30,000 records everyday, I was wondering if I could limit the load from the 1st of every previous month to the last day of that month. This will be a repetitive loading.
    DATA: CURR_MM(2) TYPE N,
    CURR_YYYY(4) TYPE N,
    CURR_DD(2) TYPE N,
    PREV_MM(2) TYPE N,
    PREV_YYYY(4) TYPE N,
    PREV_DD(2) TYPE N,
    YYYY_MM(6),
    YYYY_MM1(6),
    DATE LIKE SY-DATUM.
    DATE = SY-DATUM.
    CURR_YYYY = DATE+0(4).
    CURR_MM = DATE+4(2).
    CURR_DD = DATE+6(2).
    PREV_DD = 1.
    IF CURR_MM = '01'.
    PREV_MM = '12'.
    PREV_YYYY = CURR_YYYY - 1.
    ELSE.
    PREV_MM = CURR_MM - 1.
    PREV_YYYY = CURR_YYYY.
    ENDIF.
    concatenate PREV_YYYY PREV_MM PREV_DD into YYYY_MM.
    concatenate CURR_YYYY PREV_MM PREV_DD into YYYY_MM1.
    read table l_t_range with key
    fieldname = 'BLDAT'.
    l_idx = sy-tabix.
    l_t_range-low = YYYY_MM.
    l_t_range-high = YYYY_MM1.
    l_t_range-sign = 'I'.
    l_t_range-option = 'BT'.
    modify l_t_range index l_idx.
    p_subrc = 0.
    Mind you this code will load data from 1st of the previous month to the 1st of current month. I just don't want to load that extra "1st day" of current month data as I have 30,000 records everyday.
    Say for example, I want to load data from 1st Mar to 31st Mar or 1st Feb to 28thFeb. How should I modify the above code.
    Is there a formula to get the last date of the previous month. That's all I need. This would solve the problem.

    try this routine. it will return a range from 1st day to end of the month.
    DATA: l_s_range TYPE rsr_s_rangesid,
              E_T_RANGE TYPE  RSR_T_RANGESID.
    DATA: year(4) TYPE n,
          month(2) TYPE n,
          day(2) TYPE n,
        ld_keydate  TYPE sydatum,
          ld_lastday  TYPE sydatum.
      REFRESH e_t_range.
      CLEAR l_s_range.
      year  = sy-datum(4).
      month = sy-datum+4(2).
    *Months with 31 days in year
      IF month = '01' OR
         month = '03' OR
         month = '05' OR
         month = '07' OR
         month = '08' OR
         month = '10' OR
         month ='12'.
        day = '31'.
      ENDIF.
    *check for leap year: provoking sy-sybrc <> 0
      IF month = '02'.
        day = '29'.
        MOVE:   '02'        TO ld_keydate+4(2),
                year        TO ld_keydate(4),
                day         TO ld_keydate+6(2).
        CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'
          EXPORTING
            date   = ld_keydate
          EXCEPTIONS
            OTHERS = 1.
        IF sy-subrc <> 0.
          day = '28'.
        ENDIF.
      ENDIF.
    *months with 31 days in year
      IF month = '04' OR
         month = '06' OR
         month = '09' OR
         month = '11'.
        day = '30'.
      ENDIF.
      MOVE: year              TO ld_lastday(4),
            month             TO ld_lastday+4(2),
            day               TO ld_lastday+6(2).
      l_s_range-low  = sy-datum.
      l_s_range-high = ld_lastday.
      l_s_range-sign = 'I'.
      l_s_range-opt  = 'BT'.
      APPEND l_s_range TO e_t_range.

  • Printing Last Day of previous month

    I need to print Last day of previous month, and the date value is relative to the system date.
    In my previous post i have got the answer to print last day of current month. To print last date in previous month do i need to use RelativeDate? and I am not sure whether I can use RelativeDate for months.
    Raghu

    Right now I have written below formula, and it works fine in all cases like if the current month equals to 01, 03, 05,07,08,10 and 12 and months other than mentioned in above including 02.
    for First day of previous month
    =If (FormatDate(CurrentDate();"MM"))InList("07";"08";"10";"12";"05";"01";"03") Then
    (If(FormatDate(CurrentDate();"dd"))="01" Then
    FormatDate(LastDayOfMonth(RelativeDate(CurrentDate();-1));"MM")"/01/"FormatNumber(Year(LastDayOfMonth(RelativeDate(CurrentDate();-1)));"####")Else
    FormatDate(LastDayOfMonth(RelativeDate(CurrentDate();-31));"MM")"/01/"FormatNumber(Year(LastDayOfMonth(RelativeDate(CurrentDate();-31)));"####"))Else
    FormatDate(LastDayOfMonth(RelativeDate(CurrentDate();-30));"MM")"/01/"FormatNumber(Year(LastDayOfMonth(RelativeDate(CurrentDate();-30)));"####")
    For Last day of previous month
    =If (FormatDate(CurrentDate();"MM"))InList("07";"08";"10";"12";"05";"03";"01") Then
    (If(FormatDate(CurrentDate();"dd"))="01" Then LastDayOfMonth(RelativeDate(CurrentDate();-1))Else
    LastDayOfMonth(RelativeDate(CurrentDate();-31)))Else LastDayOfMonth(RelativeDate(CurrentDate();-30))
    Please let me know any other suggestions.
    -Raghu

  • Amount of days in each month

    Post Author: mike7510uk
    CA Forum: Formula
    i have a report where i have the days of the month along the top. I use this formula to get the day number
    ... int(day(DateAdd ("D",0,cdate({Command_1.startdate} )))) ...
    where the 0 is incremented along the report up to 30. The startdate bit of the formula is a pre-defined date such as 01-04-2007 (1st april)
    The fields then all work up to the point of 30th, i need it to end there and not go into the next month (1st)
    Obviously this is fine if the month has 31 days as it will just display 1-31. I need some IF statements maybe that looks at which month is selected and displays the correct amount of days.
    Any ideas?

    Post Author: SKodidine
    CA Forum: Formula
    The easiest way to get the last day of the month (and hence the number of days in a month) is to use the custom function that comes with CR.  I have only worked with CR XI so not sure about other versions.
    1. Open the formula workshop.
    2. From the Repository Custom Functions, under Crystal and then Date, RIGHT click on cdlastdayofmonth, click on ADD TO REPORT.
    3. Create a new formula, in the formula workshop, under FUNCTIONS, go down the list till you see "CUSTOM FUNCTIONS", expand that till you see cdlastdayofmonth.
    4.  In your formula, type cdlastdayofmonth(currentdate)
    5. Save and close and display the formula in your report, you should see 04/26/2007, depending on your date format.
    You can customize the formula to suit your needs, and this way you do not have to worry about leap years..

  • Object date - how to get the last day of the month?

    hi all,
    I have a date object in which I would like to get the last day of the month. any idea?
    eg AUG=31
    Feb = 28 (depends if a leap year)
    thanks

    Use java.util.Calendar
    Add 1 month to the day.
    Set the day of month to be 1.
    Subtract 1 day.
    Now you are on the last day of the month you wanted.

  • Getting last days of several months - Bex Analyzer

    Hello, BW experts~
    I need to calculate with last days of several months.
    For example,
    - The sales in July: $100
       -> sales per day in July = $100 / <b>31</b>
    - The sales in last month(June): $100
       -> sales per day in last month(June) = $100 / <b>30</b>
    - The sales in 2 month ago(May): $100
       -> sales per day in 2 month ago = $100 / <b>31</b>
    I used to calculate a last day on a month with a customer exit variable. It works well when executing  the BEx query with one month. But, when executing the query with 3 months, it doesn't work well.
    For example, when executing the query in July, all last days, which are calculated via customer exit variable, become 31. Only one month.
    - Last day -
    July: <b>31</b>
    Last month(June): <b>31</b>
    2 month ago(May): <b>31</b>
    They have to be each 31(July), 30(June), 31(May).
    I want to get fit last days of several months at a time and one BEx query.
    Is it possible? (I wish it's possible.)
    Can I do something in CMOD?
    Thank you~
    Sihyoung Jurn

    Hi,
    You can get it by creating 3 formula variables with 'customer ext' as processing.
    Let us assume user enters the First month by a 'user entry' variable.
    In the code of user exit for 1st formula variable you will calculate the last day of the user entered month.
    In the code of user exit for 2nd formula variable you will calculate the last day of the (prevoius month to user entered month).
    Similarly for 3rd Formula Variable also.
    there will be 3 Restricted key figures.
    one for sales of user entered month.
    2nd one for sales of prevoius month to user entered month.
    3nd one for sales of two month to user entered month.
    you will have 3 calculated kfs.
    in first one you do 1st RKF/Formula variable1.
    in second one you do 2nd RKF/Formula variable2.
    in third one you do 3rd RKF/Formula variable3.
    Hope, you understood my explanation.
    With rgds,
    Anil Kuamr Sharma .P

Maybe you are looking for

  • Schedule lines are not getting generated during MRP Run

    Schedule lines are not getting generated during MRP Run. I have maiantained source list for the material with proper validity date and also maintained scheduling agreement . MRP relevvant Indicator , I have marked - 2 which means -Record relevant to

  • Need a procedure to make minus query as output for 2 tables

    Can anybody help me to create a procedure so that I could get minus query of 2 table as a result. Requirement: I have two table 1- src_table_list ,2- tgt_table_list both tables have 2 columns : serial_no,table_name and 100 records each. and details m

  • Contacts don't sync on iPod Touch (not using mobileme)

    They used to sync, now they don't. Since 10.5.5? So the contacts are on the ipod, but changes are not synced. I do not have mobileme. Just syncing via usb.

  • Optical audio output specs

    What sample rates and frequencies can the optical audio output handle? Is 96kHz/24bit available?

  • LabVIEW 5.0 for sale and closing today on eBay

    I just came across this newsgroup today. I though some of you would like to know about the new and unregistered copy of LabVIEW I am auctioning off. To bid on the item, go to: http://cgi.ebay.com/aw-cgi/eBayISAPI.dll?ViewItem&​item=130133583