Last month end date based on current date

Hi,
How to show last month end date based on the current date.
Eg:
Current date = "08/26/09"
Var- Last Month End Date = "07/31/09" etc...,
Please help me how to get it...
Thank You!

Good to hear that it worked for you. but not for me.
I tried like this:
1st::
1. var1= ToDate("06/30/09","MM/dd/yyyy")
2.Var2= RelativeDate([Var1];-DayNumberOfMonth([Var1]))
result: 5/30/09
2nd:
RelativeDate('6/30/2009';-DayNumberOfMonth('6/30/2009'))
result: 5/30/09
Am working on SAP OLAP cubes.
Please help me where am going wrong....
Thank You!

Similar Messages

  • FM to get previous sunday date based on current date(SY-DATUM)

    hi all,
    Is there any function module to get the previous sunday date based on current date(sy-datum)?
    Regards,
    Kapil Sharma

    Hi Kapil,
    You can follow the logic below:
    data:
    l_date like sy-datum, **TODAY
    l_date2 like sy-datum, **Previous Sunday
    data:
    l_daynr like HRVSCHED-DAYNR.
    *Get today's date
    l_date = sy-datum.
    *Gey today's day (Monday, Tuesday, etc.)
    CALL FUNCTION 'HRIQ_GET_DATE_DAYNAME'
    EXPORTING
    langu = 'EN'
    date = l_date
    IMPORTING
    daynr = l_daynr.
    CASE l_daynr.
    *If it is Monday
    WHEN 1.
    -Subtract 2 days for the previous Sunday
    CALL FUNCTION 'HR_SEN_CALE_DAYS_DATE'
    EXPORTING
    id_date = l_date
    id-operator = '-'
    is_duration = 2
    IMPORTING
    ed_date = l_date2.
    *If it is Tuesday
    WHEN 2.
    CALL FUNCTION 'HR_SEN_CALE_DAYS_DATE'
    EXPORTING
    id_date = l_date
    id-operator = '-'
    is_duration = 3
    IMPORTING
    ed_date = l_date2.
    *If it is Wednesday
    WHEN 3.
    CALL FUNCTION 'HR_SEN_CALE_DAYS_DATE'
    EXPORTING
    id_date = l_date
    id-operator = '-'
    is_duration = 4
    IMPORTING
    ed_date = l_date2.
    *If it is Thursday
    WHEN 4.
    CALL FUNCTION 'HR_SEN_CALE_DAYS_DATE'
    EXPORTING
    id_date = l_date
    id-operator = '-'
    is_duration = 5
    IMPORTING
    ed_date = l_date2.
    *If it is Friday
    WHEN 5.
    CALL FUNCTION 'HR_SEN_CALE_DAYS_DATE'
    EXPORTING
    id_date = l_date
    id-operator = '-'
    is_duration = 6
    IMPORTING
    ed_date = l_date2.
    *If it is Saturday
    WHEN 6.
    CALL FUNCTION 'HR_SEN_CALE_DAYS_DATE'
    EXPORTING
    id_date = l_date
    id-operator = '-'
    is_duration = 7
    IMPORTING
    ed_date = l_date2.
    *If it is Sunday
    WHEN 7.
    CALL FUNCTION 'HR_SEN_CALE_DAYS_DATE'
    EXPORTING
    id_date = l_date
    id-operator = '-'
    is_duration = 8
    IMPORTING
    ed_date = l_date2.
    ENDCASE.
    Regards,
    Dilek

  • FM to get the previous sunday date based on current date(sy-datum)

    hi all,
    Is there any function module to get the previous sunday date based on current date(sy-datum)?
    Regards,
    Kapil Sharma
    Moderator Message: Basic date related questions are not allowed
    Edited by: Suhas Saha on Sep 19, 2011 11:39 AM

    Hi,
    There are function modules to find out the current day of the week depending on sy-datum. These are as below:
    1. DATE_COMPUTE_DAY - Returns a number indicating what day of the week the date falls on. e.g. Monday is returned as a 1, Tuesday as 2,...., Sunday as 7.
    2. RH_GET_DATE_DAYNAME  - Returns the day based on the date provided, e.g. Monday, Tuesday,..., Sunday.
    Using any of the above, if you can find out the current day, then you can calculate and compute the date of the previous Sunday.
    My observation is that using the first FM might make the calculation simpler.
    Hope this is of help to you.
    Regards,
    Shayeree

  • Calendar with preselected dates based on current date

    Can we get the calendar to be prepopulated with todays' date and today-7 date as the default before it starts running the initial queries when I log into dashboard.
    I have a calendar date range based on which my chart displays metrics. If I dont choose anything its picking up all the data first before I choose something
    Your help is always appreciated.

    I apologize I read your post too quickly and misunderstood your question. Unfortunately, I thought you were referring to a dashboard you had created and asking about setting up default dates for your bind variables/parameters.
    Well I'll have to leave this one to someone else. Sorry I couldn't be more help.
    David

  • Getting Last Month End date

    Dear Experts,
    I want the following result. I have a date parameter. I want to
    get the last / end date of the previous month
    for any given date which the user inputs.
    For ex:
    If user puts the date 15.06.2008
    then i want to get the previous month end date i.e. 31.05.2008.
    The reason being i am creating a program for updating Opening and Closing Stocks of every month in a ZTABLE. The user will put the date in the parameter and system will bring the closing stock of previous month and then calculate for the current month.
    I hope i am not complicating matters too much....
    Basic funda is to arrive at the end date of the previous month for any date which the user puts.
    Please help me... it is mission critical..
    Thanks & Regards,
    Jitesh M Nair

    hi,
    use this to get last month end date.
    ex:
    data: d2 like sy-datum.
    d2 = sy-datum.
    d2+6(2) = '01'.
    d2 = d2 - 1. "prev mnth last date
    write:/ d2.

  • Need to get data till last month end by using Calday

    Hello SAPiens,
    Could anybody please guide me how to get the data till last month end date.
    Example: If i m executing a report in 05 November 2009 then i should get all the details of last month till last date of the Calmonth. thanks in advance.
    Regards,
    Sandy.S

    Hi,
    you can do the following:
    Create a Customer Variable for Calday
    EXIT_SAPLRSOO_001 ---> Include ZXRSRUO1 write the code for the variable created above
    DATA : date TYPE sy-datum.
    date = sy-datum. "Today
    date+6(2) = '01'. "First day of this month
    date = date - 1. "Previous day before first day of this month = last day of last month
    Or
    you can you many function Modules
    CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS
    FKK_LAST_DAY_OF_MONTH
    OIL_LAST_DAY_OF_PREVIOUS_MONTH
    Santosh

  • How to suppress a row based on current date -  at query level?

    In an Bex query report i have suppress rows based on current date.
    There is no current date available in query.
    there is a date field in the query.
    If by chance the date in that field is lesser than current date, I have to suppress that row.
    How can this be achieved?

    What is the code ofr creating a variable to get values >= to current date?
    I have implemented the following code which is not working.
    data L_S_range like line of E_T_range[].
    CLEAR L_S_RANGE.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'GE'.
    L_S_RANGE-LOW = SY-DATUM.
    APPEND L_S_RANGE TO E_T_RANGE[].
    Actually i have written in class, which will be inherited in superclass.
    Edited by: akshara20 on Feb 2, 2011 1:21 PM

  • Error In Backdated Reservation Creation  Base date earlier than current dat

    Dear Experts,
    Error while creating Reservation for back date.
    Base date earlier than Current date.
    Can we create backdated reservation ? and post goods issue to the same ?
    if it need configuration please explain the steps for allowing creation of backdated reservations.
    Thanks in Advance

    What is the error message nos.?

  • Date rule for current date

    Hi.
    I have a date type for which I would like to fill DATE FROM field with current date, but the field DATE TO should stay empty for manual entry.
    I defined the following rule which I assigned to my date type but the problem with this rule is that it fills both fields (date from and date to) with current date.
    <?xml version="1.0"?>
    <TimeRule>
       <TimeRuleSource>
          <ruleline>
             <AssignTimeExp displaytype="AssignTime">
                <VarTimeExp displayType="VarTime"
                            name="RESULT"
                            position="F">
                </VarTimeExp>
                <ConstLocTimeExp displaytype="ConstLocTime"
                              date="now"
                              time="000000"
                              timeunit="DAY">
                   <VarObjectExp displaytype="VarObject" name="SYSTEM"/>
                </ConstLocTimeExp>
             </AssignTimeExp>
          </ruleline>
       </TimeRuleSource>
    </TimeRule>

    solved by other way

  • Is there any way we can set default value for a Date Attribute to current date in Master Data Services

    Is there any way we can set default value for a Date Attribute to current date in Master Data Services.
    I as well wants to know that is there any posibility to show Calendar control while input data into respective date attributes.
    Thanks.

    Hi Anagha,
    So far i havent found any way to set todays date by default from MMI, but i guess this flow should work as workaroud
    1. Add buisness rule which can set a default value when Date = NULL/Blank
    2.get the entity table ,use -select EntityTable from mdm.tblEntity where Name = '<enter entity name>'
    3.Go to that table and add a after update trigger like
    if uda_<entityid>_<attributeid(Date attribute)> = default value
    update uda_<entityid>_<attributeid(Date attribute)> =getdate() where id = <LastUpdatedRow>
    I will check on this too from my side.
    By the way AFAIK i dont think so calendar control integration is possible .

  • Can't get access in Time Machine to certain folders for any date earlier than current date/time.

    Can't get access in Time Machine to certain folders for any date earlier than current date/time, even when entering as Admin. Why do certain folders have small red "-" badge in lower right corner of folder icon?  Here's a picture of the dilemma:
    I've tried monkeying with priveleges using Command I, and changing users, but to no avail.  Can anyone help?

    Right.  Here's what the permissions look like from the Finder Command I:
    I'm not sure what "Custom" means, but when I then try to change it to "Read & Write", it doesn't take.... just comes back as Custom. Interesting to note that not only am I logged into Joan's account where the data folder and file lives) to do this, but when I do it from my own account  as Admin (dunc...mpster) I get the same result.

  • After updating new MIC in QP02 in Back date not showing current date ?

    Hi Guru,
    I have updated some new MIC and some Changes are made in existing MIC in QP02 on back date. It is showing on same back date with all correction and new MIC but on today's date i.e. current date it is not showing in the system.
    any can help me how to get in current date ?
    There are some dump error , for these correction i have updated SNOTE 1467234 and 1471534 in Quality server, but no more effect.
    Thanks,
    Piyush Patel

    hi,Premji,
    I have updated existing QP in back date i.e. same as when created original date ( expiration date is long i.e. 31.12.9999) , then same thing i wanted to see all updated MIC should be reflect in current date, but it is not coming, so i have updated SNOTE- 1467234 and 1471534 then tried it.It is working fine some how but not as i want.Hence i thing it is solved my problem.
    Thanks to you and Mr. Craig for your more suggestion/guidance.
    Piyush Patel

  • Data changed based on current date  in Bex

    Hi Gurus,
       Hope you are all doing good ! I have a scenario in queries in Bex. When the query is executed the current system date must be captured and the data must be divided by the count of the previous months.
       For instance if the query is executed today the data must be divided by 1 ( for  jan)
       if it is executed next month, then the data muset be divided by 2 ( jan + feb ).
       Is there any COUNT variable in Bex ? Any idea how this could be done?
      Points would be assigned for sure.
    Regards,
    Sunitha.R

    Sunitha,
        You should create a variable which is not user entry and user exit as processing type. Based upon the date entered you should write code in CMOD to derive the figure with which you can divide the amount.
    The logic can be something like this:...
    If the user enters     period like 02.2207(feb 2007), then you can pass value as 2 for the variable newly created. This is a simple code which can be written easily if you have ABAP knowledge.
    Try it out.....

  • Fixed report period based on current date

    I want to create a report containing records over a fixed period without using a date parameter. As a example I would like the report to continually draw on data that is no more than say ten years from the current date.
    E.g. Current date (xx/xx/2008) to (Current date - 10 years) or xx/xx/1998 then next year the formula would automatically adjust to current date (xx/xx/2009) to (Current date - 10 years) or xx/xx/1999.
    I am only a novice when it comes to designing reports so please bear that in mind.

    Hi,
    Create a RecordSelectionFormula and subtract 10 years from the current date with the DateAdd formula.
    E.g.
    //DateAdd (intervalType, nIntervals, startDateTime)
    {Table.Date} > DateAdd ("yyyy", -10, CurrentDate)
    The DateAdd function has more interval types, so you can subtract months, days, hours as well. Check the CR help file and search for DateAdd for details.
    Cheers,
    Fritz

  • Month Year values based on Posting Date

    In my super huge extra large InfoCube (0CFM_C10) I got a lot of data. I take Posting Date, some KFG and CalMonth/Year. Unfortinally CalMonth/Year duplicates records, if I drop it off the columns/rows I get valid data by Posting Date.
    My question is this - is it possible to create some MonthYear Calculated KFG/field/formula or smthng. based on Posting Date? In other words I need Month/Year in rows/ columns or free characteristics...
    Edited by: Gediminas Berzanskis on Mar 18, 2008 10:18 AM

    Dear,
    When canceling a payment which was created in previous posting periods,
    we  get system message "Date deviates from permissible range",so
    the workaround is changing back the posting period to the previous one
    and try to cancel the payment.
    However,another system message pops up when we try to cancel payment
    after changing back the posting period,which is the "creation date" or
    "posting date".
    In this scenario, you should select the second option from the
    cancellation options window, which is the 'Creation date'. I would like
    to explain more below.
    Posting Date- means the posting date of the cancellation document, it's
    not the posting date of the incoming payment that you wanna perform the
    cancellation. In your case, selecting this 'posting date' option, system
    deems that you want to post this cancellation document on its own
    posting date.
    Creating Date- means the posting date/creation date of the incoming
    payment, it makes sense that the system works fine if you select this
    option. If you cancel the incoming payment and check the JE generated,
    you will find that the posting date of this cancellation document is
    actually recorded as the posting date of the incoming payment.
    Wish it helps you.If you have any problems,please kindly let me know.
    Thanks and best regards,
    Apple

Maybe you are looking for

  • Mail Acting Strange

    Upgraded to Leopard the otehr day, and that's the only thing I've changed recently, but it's worked fine since installing and syncing it. My iPhone has worked beautifully since I got it. Today I was checking my mail (AOL IMAP account) and it download

  • .wbmp pictures does not show up, why ?

    Hello, Problem: I have created a Java servlet which produces a WML card with text and an command to load .wbmp picture (see code below). I have tested the WML card without servlet (loaded it straight from hard disk), and it works fine. The problem oc

  • How to use this IsolatedStorageFile isoStore = IsolatedStorageFile.GetUserStoreForApplication(); in WP 8.1

     IsolatedStorageFile isoStore = IsolatedStorageFile.GetUserStoreForApplication(); I had modified this as StorageFile isoStore=StorageFile.____________________(); but i can't find a method like GetUserStoreForApplication in Windows Phone 8.1. How to g

  • Unable to paint (using paint() in JPanel) inside mouse listeners

    This is hard to explain but I'll do my best :) I've created a little game and at some point I needed to make images "move" on the JPanel (through paint()), on a checkers-based game board. The game works like so: it has a mouse listener for clicks and

  • Index not working fine

    hi, i am facing a problem that is i have a table with name PAP_WF_PATHDETAILS. i have created a index wf_step_ind on column WF_PD_STEPID IN THAT TABLE. i hane distinct WF_PD_STEPID values like this -1,1,2,3,4,5,6,7,8,9,10,11,12,13 when i am using drl