FI : Finding last day of last accounting period

Hi,
In fi, I am trying to find out the last date od the last accounting period.
I.e, if december is my first accounting period, and i give 28.01.2009 , my current accounting period will be 02,so last date of last period(december 2008) would be 31.12.2008
Similalry, if December is the start of the accounting period,meaning december is accounting period 1, the, last day of the last accounting period would be: 30.11.2007.
Please let me know of function modules to:
1.Find the last period
2.find the last day of the last period
Thanks in advance..
sumita

Hi,
You can try using function module LAST_DAY_IN_PERIOD_GET to get the last day in a month/period.
You might have to check with the help of FI consultant what Fiscal Variant needs to be used.
Also uou can find out the previous month by subtracting 1 from the current month ( and if month - 1 = 0 previous period is 12 ).
Regards,
Ram

Similar Messages

  • How to get the last day of the payroll period

    Hi all,
    I need to get the last day of the payroll period e.g. last day of Jan 2007 is 31 Jan 2007. Can anyone suggest as to how to get it?
    Thanks,
    Madhu

    T549S contains the payroll periods with pay date.  T549Q contains the begin and end dates of the payroll period.
    You can select from the appropriate table (or from both depending on your given data) to get the end date of the period.
    Hope that helps.
    Mary

  • Variable for last day of last month....

    Hi,
    Can somebody let me know the code to find the last day of last month from the query variable.
    Is there any standard/business content  variable available for this?
    I have found one similar variable , but its for the posting date.
    Any help is appreciated.
    Regards...

    Check this code:
    l_date_from = sy-datum.
           l_date_from+6(2) = '01'.
           l_date_from = l_date_from - 1.
           l_s_range-sign = 'I'.
           l_s_range-opt  = 'EQ'.
           l_s_range-low = l_date_from.
           l_s_range-high = space.
           APPEND l_s_range TO e_t_range.
    You can modify based on your specific requirement.
    Regards,
    Kams

  • How to get the last day according to fiscal period input in selection scree

    Hello expert
    how to get the last day of fiscal period input.
    the fiscal period inculdes 1-16
    when fiscal period is greater than 12, only calculate the last day of 12nd month
    your solution will be apprecaited, FM existing?
    thank you
    Kevin

    Hi,
    when you give a particular date in any month
    the following fm will give you the last date of that month
    here you can give
    R_FDATE-HIGH  as 01 and month as the period you wnat and year for current year
    concatenates '01'  month year  into r_fdate-high separated by '.'.
    then it will give g_ltdt for that month and year which wil be the last date of that month
        CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'
          EXPORTING
            DAY_IN            = R_FDATE-HIGH
          IMPORTING
            LAST_DAY_OF_MONTH = G_LTDT
          EXCEPTIONS
            DAY_IN_NO_DATE    = 1
            OTHERS            = 2.
        IF SY-SUBRC <> 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
    thanks & regards,
    Venkatesh

  • How to find first and last day of last month?.

    Hello,
    I am using Crystal Report XI.
    Reports will be generated on first of every month for
    previous month. I want to find start and end date of previous month
    dynamic.
    For august, Start date is July 1st and End date July 31st.
    For September, start date is Aug 1st and Aug 31st.
    How can i get first of previous month as start date and last
    day of the previous month as end date?.
    Same kind of thing I want to do for future report ..find next
    month start date and end date.
    Thanks

    Adomacro,
    you could do a function, like this
    <cffunction name="getReportdates" returntype="struct"
    hint="Given an arbitrary month and year, the function returns a
    structure containing the first and last day of the previous
    month">
    <!--- Take current month and current year as the default
    --->
    <cfargument name="mnth" type="string" required="No"
    default="#monthAsString(month(now()))#">
    <cfargument name="yr" type="numeric" required="No"
    default="#year(now())#">
    <cfset firstDayOfGivenMonth = parseDateTime("1 " &
    arguments.mnth & " #arguments.yr#")>
    <cfset lastDayOfPreviousMonth =
    dateAdd("d",-1,firstDayOfGivenMonth)>
    <cfset numberOfDaysOfPreviousMonth =
    daysInMonth(lastDayOfPreviousMonth)>
    <cfset firstDayOfPreviousMonth =
    dateAdd("d",-#numberOfDaysOfPreviousMonth#,firstDayOfGivenMonth)>
    <cfset reportDates = structNew()>
    <cfset reportDates.firstDayOfPreviousMonth =
    firstDayOfPreviousMonth>
    <cfset reportDates.lastDayOfPreviousMonth =
    lastDayOfPreviousMonth>
    <cfreturn reportDates>
    </cffunction>
    <!--- Example usage --->
    <p>
    Given month: <strong>March
    2004</strong><br>
    begin date:
    <cfoutput>#dateFormat(getReportdates('March',2004).firstDayOfPreviousMonth,"d
    mmm yyyy")#</cfoutput><br>
    end date:
    <cfoutput>#dateFormat(getReportdates('March',2004).lastDayOfPreviousMonth,"d
    mmm yyyy")#</cfoutput><br>
    </p>
    <p>
    Given month: <strong>August
    2007</strong><br>
    begin date:
    <cfoutput>#dateFormat(getReportdates('August',2007).firstDayOfPreviousMonth,"d
    mmm yyyy")#</cfoutput><br>
    end date:
    <cfoutput>#dateFormat(getReportdates('August',2007).lastDayOfPreviousMonth,"d
    mmm yyyy")#</cfoutput><br>
    </p>

  • Find first day of open posting period

    Hi all experts,
    my problem:
    I neded to find the first day of the open posting period in my report.
    You know any FM or other?
    thank you all, points for all.

    Hi..
    Try the FM
    <b>G_POSTING_DATE_OF_PERIOD_GET</b>
    If not:
    Check the Function modules in the Same Function group GUPD.
    <b>Reward if Helpful</b>

  • Unable to find the months in Inventory Accounting Periods

    Hi All,
    1) Created a new calendar.
    2) Created a new organization "ABC".
    3) Attached calendar to it.
    Now i am trying to open period for the new org "ABC".
    But i am unable to find any month?
    Also it gives message "no list of values" for "ABC" org.
    Is there any setup missing for this?
    Regards,
    SYR

    Hi All,
    1) Created a new calendar.
    2) Created a new organization "ABC".
    3) Attached calendar to it.
    Now i am trying to open period for the new org "ABC".
    But i am unable to find any month?
    Also it gives message "no list of values" for "ABC" org.
    Is there any setup missing for this?
    Regards,
    SYR

  • 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

  • Customer Exit to get last day of month from Year/month

    Hi Experts,
    I need to create a customer exit to get the last day of month from Cal Year month input variable.
    Examples
    1)
    User input period: 12.2008
    I need from the customer exit: 31.12.2008
    2)
    User input period: 02.2009
    I need from the customer exit: 28.02.2009
    Can someone help me with the ABAP code to achieve this with a customer exit?
    Help will be appreciated.

    Hi,
    Please use the following code,
    Second one is the suitable solution for you, I can understand that, if it leafe year then you have the problem so use the secon one.
    First one is using Period i.e. 010.2008 (December 2008).
    Secodn one is based on Date/Month.
    Note: Insted of SY-DATUm, you give your variable name
    *******To get the Last day of the Fy Period entered by User in ZFYP***
        WHEN 'ZLDAY_FI'.
          LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'ZFYP'.
            zbdatj = loc_var_range-low+0(4).
            zbuper = loc_var_range-low+4(3).
            CALL FUNCTION 'LAST_DAY_IN_PERIOD_GET'
              EXPORTING
                i_gjahr = zbdatj
                i_periv = 'V3'
                i_poper = zbuper
              IMPORTING
                e_date  = zzdate.
            CLEAR: l_s_range.
            l_s_range-low = zzdate.
            l_s_range-sign = 'I'.
            l_s_range-opt = 'EQ'.
            APPEND l_s_range TO e_t_range.
          ENDLOOP.
    Note: in the below code I given SY-DATUM, so you change to your Month Variable like using  
    LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'XXXX'.
    ** Last Day of Current Calendar month
          zzdate = sy-datum.
          CALL FUNCTION '/OSP/GET_DAYS_IN_MONTH'
            EXPORTING
              iv_date = zzdate
            IMPORTING
              ev_days = znum.
          CLEAR: l_s_range.
          l_s_range-low+6(2) = znum.
          l_s_range-low+0(4) = sy-datum+0(4).
          l_s_range-low+4(2) = sy-datum+4(2).
          l_s_range-sign = 'I'.
          l_s_range-opt = 'EQ'.
          APPEND l_s_range TO e_t_range.
    Thanks
    Reddy
    Edited by: Surendra Reddy on Jan 27, 2009 2:47 PM
    Edited by: Surendra Reddy on Jan 28, 2009 6:12 AM

  • Query for back 2nd motnh first day and last day

    Any body please provide me the query for back 2nd month first day to back 2nd month last day?
    last month first day
    TIMESTAMPADD(SQL_TSI_MONTH,-1, TIMESTAMPADD(SQL_TSI_DAY, -(DAY(CURRENT_DATE)-1), CURRENT_DATE))
    last month last day
    TIMESTAMPADD(SQL_TSI_DAY, -(DAY(CURRENT_DATE)), CURRENT_DATE)
    anyone please provide me the queries for previous months like above queries?
    2nd back month first day --?
    2nd back month last day--?
    3rd back month first day --?
    3rd back month last day --?

    Hi,
    Check with this...
    Previous month last day -
    TIMESTAMPADD(SQL_TSI_DAY, DAYOFMONTH(CURRENT_DATE)*-1, CURRENT_DATE)
    Last day of 2nd month -
    TIMESTAMPADD(SQL_TSI_MONTH,-1,TIMESTAMPADD(SQL_TSI_DAY, DAYOFMONTH(CURRENT_DATE)*-1, CURRENT_DATE))
    Last day of 3rd month -
    TIMESTAMPADD(SQL_TSI_MONTH,-2,TIMESTAMPADD(SQL_TSI_DAY, DAYOFMONTH(CURRENT_DATE)*-1, CURRENT_DATE))
    (OR)
    Previous month last day -
    TIMESTAMPADD(SQL_TSI_DAY, DAYOFMONTH(CURRENT_DATE)*-1, CURRENT_DATE)
    Last day of 2nd month -
    TIMESTAMPADD(SQL_TSI_DAY,DAYOFMONTH(TIMESTAMPADD(SQL_TSI_DAY, DAYOFMONTH(CURRENT_DATE)*-1, CURRENT_DATE))*-1,TIMESTAMPADD(SQL_TSI_DAY, DAYOFMONTH(CURRENT_DATE)*-1, CURRENT_DATE))
    Last day of 3rd month -
    TIMESTAMPADD(SQL_TSI_DAY, DAYOFMONTH(TIMESTAMPADD(SQL_TSI_DAY,DAYOFMONTH(TIMESTAMPADD(SQL_TSI_DAY, DAYOFMONTH(CURRENT_DATE)*-1, CURRENT_DATE))*-1,TIMESTAMPADD(SQL_TSI_DAY, DAYOFMONTH(CURRENT_DATE)*-1, CURRENT_DATE)))*-1,TIMESTAMPADD(SQL_TSI_DAY,DAYOFMONTH(TIMESTAMPADD(SQL_TSI_DAY, DAYOFMONTH(CURRENT_DATE)*-1, CURRENT_DATE))*-1,TIMESTAMPADD(SQL_TSI_DAY, DAYOFMONTH(CURRENT_DATE)*-1, CURRENT_DATE)))
    Regards,
    Srikanth

  • For the previous month first day and last day

    i want to schedule my reports from the last month first date to last month last date.
    any body have queries for the while scheduling to uuse it.
    Ex:sysdate() - today's date
    first_day_of_month()- first day of current month
    first day of last month ---?
    last day of the last month ---?

    In the parameter, put this
    {$FIRST_DAY_OF_MONTH()$}other values you can use in default parameter values are
    {$SYSDATE()$} - to get current date
    {$FIRST_DAY_OF_MONTH()$} - to get first day of the current month
    {$FIRST_DAY_OF_YEAR()$} - to get first day of the current year
    {$LAST_DAY_OF_MONTH()$} - to get last day of the current month
    {$LAST_DAY_OF_YEAR()$} - to get last day of the current year
    Re: Default date as first of month
    TO get last day of last month
    {$FIRST_DAY_OF_MONTH()-1$}You can add/subtract number with these functions and no other functions are available.

  • I have iphone 3gs and last days i made upgrade 5.01, but i dont know that this version is not avaliable in brasil yet. than my iphone 3gs 32 gb no more find the wide and it be seaching the sinal. what i need to do to back to before situation. thanks a lo

    i have iphone 3gs and last days i made upgrade 5.01, but i dont know that this version is not avaliable in brasil yet. than my iphone 3gs 32 gb no more find the wide and it be seaching the sinal. what i need to do to back to before situation. thanks a lot

    iOS 5.0.1 has been out for a couple months, if not longer. 
    There was no delay in releasing it in any country.
    So what is your issue? 

  • How to find first and last day of previous month?.

    Based on current month, I want to find start and end day of
    previous month.
    For example,
    For august, Start date is July 1st and End date July 31st.
    How can i get first of previous month as start date and last
    day of the previous month as end date?.
    Same way,
    i want to find start date of current month and end date of
    next month.
    Example:
    For august,
    i want to get start date, august 1st and end date : september
    30.
    How can i do this from current date or now().
    I am looking for best and easy way to find start and end
    dates..
    Thanks

    <cfset today = now()>
    <cfset firstOfThisMonth = createDate(year(today),
    month(today), 1)>
    <cfset lastOfNextMonth = dateAdd("d", -1, dateAdd("m", 2,
    firstOfThisMonth))>
    <cfoutput>
    today = #today#<br>
    firstOfThisMonth = #firstOfThisMonth#<br>
    lastOfNextMonth = #lastOfNextMonth#<br>
    </cfoutput>
    Edit - To find the start and end day of previous month, get
    the first of THIS month. Use Subtract 1 month ("m") to get the
    start date. Subtract 1 day ("d") to get the end date.

  • Query with the days of a period and the same days of last year

    I need a help.
    We have a sales cube with daily values.
    We have a query that restricts a month (0CALMONTH) and shows the daily values for this month.
    No problem, we have only to put 0CALDAY on the line and the value on the columns.
    But we need also to show the values of the same days from last year.
    Example:
    The restricted month is july/2011.
    0CALDAY is on the line, so the query shows the values for
    01.07.2011   110,00
    02.07.2011   108,00
    31.07.2011   109,00
    How can we show in the same line the values for july/2011 and july/2010?
    Example:
             July/2010    July/2011
    01     95,00            110,00
    02     96,00            108,00
    31    94,00             109,00.
    Thanks in advance
    César Menezes

    Thanks for the answers until now.
    Surely a Day characteristic (ex. CA_DAY, derived from 0CALDAY) would work.
    But we have this requirement in many other cubes (I posted only an example) and it's not feasible to create this characteristic now.
    I understood the other suggestions, but the problem is not on selecting the values.
    We have two restricted key figures, one for a period (filled by the users) and another one for this period - 12.
    They work OK and bring the correct results.
    The problem is on presenting the results, because as we have 0CALDAY in the line the results appear on two different lines.
    Example:
    15.07.2010    950,00
    15.07.2011    980,00.
    Is ther any way to present the results in the same line?
    Example:
    15.07.2011    950,00 (last year)     980,00 (today)
    or
    15.07             950,00 (last year)     980,00 (today)
    or any other way?
    César

  • Someone puts iTunes Store purchases on my credit card !!! I took the last purchase from my account in 2009, is it possible to find out which account abuses my credit card?

    Someone puts iTunes Store purchases on my credit card !!! I took the last purchase from my account in 2009, is it possible to find out which account abuses my credit card?

    Follow the instructions here > How to report an issue with Your iTunes Store purchase
    And if you have not already done so, change your Apple ID password ASAP >  Apple - Support - Apple ID

Maybe you are looking for

  • Error in starting application server SAP Netweaver ABAP Trial version

    After starting the application server on my Windows Vista system, i'm getting next error : =================================================== ============== Starting System NSP ================ =================================================== ===

  • Problems with flash photo-gallery xml

    Hello, I need help. I have bought your photogallery template and i am having problems with it. When i test the gallery on my portfolio website (html) all it comes up is the background, the pictures and thumbnail pictures wont load. I am putting the f

  • EPub support for full-bleed images

    Hi, I'm creating an ePub version of a Pages document, and I want to include the full-page image for the cover. Pages tells me that it can't support floating images, but in-line images need to respect the margins set for the rest of the document. I wa

  • Windows 10 TP build 9926 Enterprise English UK x64 iso SHA1 value

    I am getting the media driver missing error during installation.I cannot find the sha1 value for the iso.what is it? 9926.0.150119-1648.FBL_AWESOME1501_CLIENTENTERPRISE_VOL_X64FRE_EN-GB.ISO mine is F204C1DBDDA7F7653B24F51D845F823FF2858338 I want to c

  • ITEM_TYPE 'WFSTD' is protected, no changes were saved.

    Dear friends, When I use "WFLOAD $fndunpw 0 Y UPGRADE ./xxcub/import/FAAPPROV.wft |tee -a $LOGFILE" to upload a customization.The error message as follows: Should the Access level is too low.Need I change the access level using Oracle Workflow Builde