GET First date in a year

How to get a first day for a year like  if i have year as 2006 ...the date should be 1.1.2006 and i need to add 5 years and display should be 1.1.2011.

check this ..
execute the code.
data : v_date like sy-datum.
data :next_Date like sy-datum.
v_date = sy-datum.
v_date+4(4) = 0101.
write:/ v_date.      "first date in a yr
*to get the next date after 5 yrs
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
  EXPORTING
    date            = v_date
    days            = 00
    months          = 00
   SIGNUM           = '+'
    years           = 05
IMPORTING
   CALC_DATE       = next_date.
   write:/ 'date 5 yrs aftr',  next_date.
regards,
vijay
Message was edited by:
        Vijay

Similar Messages

  • To get first date and end date after entering any month and year

    Hi,
    I need to to get first date and end date of a month and year in yyyyMMdd format. I am reading month and year from a properties file. But I don't know how to get the first date and End date in given format. The properties file gives me just text. But I don't know how to get the date format using this. I need this urgently. Can anyone help me to get code for this?
    I am reading the fields as,
    Properties props = new Properties();
    props.load(new FileInputStream("AnyMonthVolume.properties"));
    String date_month = props.getProperty("date_month");
    String date_year = props.getProperty("date_year");
    Thanks.

    I know this has been posted a while ago but incase someone looking for it, here is the code to get the end of current month date.
    Calendar cal = Calendar.getInstance();
         cal.setTime(new java.util.Date());
         cal.set(Calendar.DATE, 1); //set the date to start of month
         cal.add(Calendar.MONTH,1);
         cal.add(Calendar.DATE,-1);
    System.out.println(cal.getTime());

  • Function module to get the dates from the year and the period

    Is there a function Module to get the dates from the year and the period

    Check with :
    To get last day of period use .
    LAST_DAY_IN_PERIOD_GET.
    To get last of month Use :
    RE_LAST_DAY_OF_MONTH
    HRVE_LAST_DAY_OF_MONTH
    LAST_DAY_OF_MONTHS
    ISB_PREVIOUS_PERIOD_DATE_GET
    Thanks
    Seshu

  • Function to get starting date of financial year ??

    Hi,
       what is the Function to get starting date of financial year. I am developing a inventory report, for that i need; start of the factory opening date. Is that factory n financial year are in the same date.
    Thanks,
    Senthil

    SEE THIS FMS.
    TSTR_PERIODS_FACTORYCALENDAR
    FACTORY_CALENDAR_GET
    RH_READ_CALENDAR

  • How to get start date of fiscal year?

    hi all,
    how to get the start date of fiscal year by passing fiscal year variant and fiscal year?
    please let me know.

    hi,
    See this FM
    FIRST_AND_LAST_DAY_IN_YEAR_GET  " Provides the first and last calendar date for a fiscal year
    Regards

  • Sql query to get Thursday (Date) for the year 2014

    Hello All,
    I want to get the date for all the Thursdays in the year 2014. How can I achieve this using SQL query? Can anybody give me a hand with this? Thanks.
    Amol

    Hi,
    Check if this can help you
    DECLARE @counter INT
    DECLARE @Date Date
    SELECT @counter = 0
    Select @Date = '20131226'
    WHILE @counter <= 52
    BEGIN
    select Thursday = convert(varchar(10),DATEADD(WEEK,1, @Date),120)
    SELECT @counter = @counter + 1
    Select @Date = DATEADD(WEEK,1, @Date)
    END
    Regards
    Prasad Tandel
    Please dont forget to mark as answer if this helps you :)

  • URGENT - BI Publisher - Get Last Date of Month/Year

    Hello,
    I want to get the last date of a year/month through BI Publisher. We want to do it by creating a list of values containing the month/year name (i.e. January, February, March for month or 2004 2005 2006 for year) and when the user selects one of this values to get the last date of the month or year in order to select the correct number of records.

    Hi,
    try with a LOV like the following:
    select
    to_char(add_months(trunc(sysdate,'MONTH'),-level),'Month - YYYY') display_value,
    last_day(add_months(trunc(sysdate,'MONTH'),-level)) return_value
    from dual
    connect by level <=12
    which gives you the last 12 month from today.
    Regards
    Rainer

  • FM to get first date of the month

    hi,
    any FM to get first day of the month ,  lets say based on input 24.11.2008 , the FM would return 01.11.2008

    Do search in such case(Easy findings).
    https://www.sdn.sap.com/irj/scn/advancedsearch?query=fmtogetfirstdayofthemonth&cat=sdn_all

  • Function Module to get Last date of previous year

    Is there any function module to get the Last date of the previous year. e.g, if i give date as 03/02/2009 the output  should be 31/12/2008.

    pls use below 2 FM's
    CALL FUNCTION 'MONTH_PLUS_DETERMINE'
              EXPORTING
                months  = -1
                olddate = curent_date
              IMPORTING
                newdate = w_prevdate.
    CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'
              EXPORTING
                day_in            = w_prevdate
              IMPORTING
                last_day_of_month = w_lastdayprevmonth
              EXCEPTIONS
                day_in_no_date    = 1
                OTHERS            = 2.

  • Function module to get posting date from posting year and posting period

    Hi all,
    I need a function module which will return posting date when posting period and fiscal year is passed to it..
    Thanks and regards,
    Puja.

    Hi puja
    try this FM
    this will solve ur problem
    G_POSTING_DATE_OF_PERIOD_GET
    G_POSTING_DATE_OF_YEAR_GET
    FCJ_CHECK_POSTING_DATE
    Cheers
    Snehi Chouhan

  • How to calculate first date and end date of this year in Query

    Hi Expert
    I want to calculate following dates with inputted date in query.
    I have no knowledge on ABAP and I just can create a query with simple logic.
    Could you teach me how to calculate following date?
    (If inputted date is April 12 2009)
    - First date of this year (Ex January 1 2009)
    - End date  of this year (Ex December 31 2009)
    - First date of last year (Ex January 1 2008)
    - End date of last year  (Ex December 31 2008)
    - First date of this month (Ex April 1 2009)
    Thank you!
    Take

    HR_JP_MONTH_BEGIN_END_DATE   use this FM to get the begin and end date of the Date you are passing. eg when u give input as 04/12/2009, it will return
    04/01/2009 as begin date
    04/30/2009 as end date
    pass the Year in this FM HR_E_GET_FISC_YEAR_DATES, you will get the Fiscal year Begin and End Dates
    Abh

  • How to get fiscal period based on date and Fiscal year?

    Hi Guys,
               Can anybody tell me how to get Fiscal period based on date and Fiscal Year or fiscal year variant?
    Thanks,
    Gopi.

    Hi,
    Please refer the code below:
    *: Report:  ZFISCALYR                                                  :
    *: Date  :  2004                                                       :
    *: Description: Demonstrates how to return the corresponding fiscal    :
    *:              year and posting period for a company code and posting :
    *:              date or posting date and fiscal year variant.          :
    REPORT  zfiscalyr NO STANDARD PAGE HEADING.
    TABLES: ekko.
    PARAMETERS:     p_bukrs TYPE ekko-bukrs,
                    p_bedat TYPE ekko-bedat.
    DATA: gd_fiscalyr  TYPE bapi0002_4-fiscal_year,
          gd_fiscalp   TYPE bapi0002_4-fiscal_period.
    DATA: gd_fiscalyr2 TYPE T009B-BDATJ,
          gd_fiscalp2  TYPE bapi0002_4-fiscal_period.
    DATA: gd_periv     TYPE t009-periv.
    *START-OF-SELECTION.
    START-OF-SELECTION.
    * get fiscal year and period - (requires date and company code)
      CALL FUNCTION 'BAPI_COMPANYCODE_GET_PERIOD'
        EXPORTING
          companycodeid = p_bukrs
          posting_date  = p_bedat
        IMPORTING
          fiscal_year   = gd_fiscalyr
          fiscal_period = gd_fiscalp.
    * Alternative fiscal year function module
    * - (requires date and fiscal year variant code from T009 table)
    * gets first entry in fiscal year variant table (will need to choose
    * correct one from table rather than just using first entry)
      SELECT SINGLE periv
        FROM t009
        INTO gd_periv.
    * get fiscal year and period
      CALL FUNCTION 'DETERMINE_PERIOD'
        EXPORTING
          date                      = p_bedat
    *    PERIOD_IN                 = '000'
          version                   = gd_periv
       IMPORTING
          period                    = gd_fiscalp2
          year                      = gd_fiscalyr2
       EXCEPTIONS
          period_in_not_valid       = 1
          period_not_assigned       = 2
          version_undefined         = 3
          OTHERS                    = 4.
    *END-OF-SELECTION.
    END-OF-SELECTION.
      WRITE:/ 'From function module: BAPI_COMPANYCODE_GET_PERIOD',
            / 'Fiscal year is:', gd_fiscalyr,
            / 'Fiscal period is:', gd_fiscalp.
      SKIP.
      WRITE:/ 'From function module: DETERMINE_PERIOD',
            / 'Fiscal year is:', gd_fiscalyr2,
            / 'Fiscal period is:', gd_fiscalp2.
    Thanks,
    Sriram Ponna.
    Edited by: Sriram Ponna on Apr 17, 2008 8:59 PM

  • Sales order item First Date

    Hi all,
    when ever customer changes the first date they need a pop saying the date has been modified please check it.
    can any one tell me when ever SO item level first date is changed any user-exit available to POP-UP the message.
    Regards,
    Abdul gaffar.

    Hello Abdul,
    In the below sample coding we compare first date from VBEP in databse with the changed first date on screen.
    It is a better idea to put the below coding in a separate INCLUDE and include it inside the userexit_check_vbap form. That way MV45AFZB will have less coding clutter and also in future only the include needs to be changed without needing to lock MV45AFZB (so that more than one project can work on changes to MV45AFZB).
    Also remember that popups break BDC's and background jobs, so any popups that you show during sales order processing should also contain checks so that they only trigger in foreground mode with dialog users (sy-batch IS INITIAL - not background job AND sy-binpt IS INITIAL - not batch input  AND usr02-ustyp = 'A' - only dialog user AND rv45a-docnum IS INITIAL - order not created through IDoc)
      DATA: lv_edatu TYPE vbep-edatu,
            lv_ustyp TYPE usr02-ustyp.
    * Sales document is in change mode
      IF t180-trtyp = charv.
    * Get the user type
        SELECT SINGLE ustyp INTO lv_ustyp
          FROM usr02
            WHERE bname = sy-uname.
    * Trigger the popup for only dialog user during online processing
        IF sy-batch IS INITIAL AND sy-binpt IS INITIAL AND lv_ustyp = 'A' AND rv45a-docnum IS INITIAL.
    * Get first date from database
          SELECT SINGLE edatu INTO lv_edatu
          FROM vbep
             WHERE vbep~vbeln = vbap-vbeln AND
                   vbep~posnr = vbap-posnr AND
                   vbep~etenr = '0001'.
    * Retrieve the first schedule line from screen that is not deleted
          CLEAR ls_xvbep.
          LOOP AT xvbep INTO ls_xvbep
            WHERE vbeln = vbap-vbeln AND
                  posnr = vbap-posnr AND
                  etenr = '0001' AND
                  updkz NE chard.
            EXIT.
          ENDLOOP.
    * If screen first date different from first date in databse show popup
          IF lv_edatu NE ls_xvbep-edatu.
           "Show popup
          ENDIF.
        ENDIF.
      ENDIF.
    To the above poster, it is not better to user userexit_save_document_prepare as this is triggered only during save and many items may have changed. userexit_check_vbap on the other hand triggers for each item that is changed, then and there.
    Best regards,
    Vishnu Tallapragada

  • Function Module to get first day of the fiscal year on passing a date

    Hi Experts!!
    Can you please suggest a Function Module to get first day of the fiscal year on passing a date..?
    Example:  if a fiscal year starts from 30 November 2009 and ends at 28 november 2010.
    it should return 30 th nov 2009 (first day of the fiscal year)

    Moderator message - Welcome to SCN.
    I think you'll find that this question has been answered before. Please search the forum before posting.
    Also, Please read Please read "The Forum Rules of Engagement" before posting!  HOT NEWS!! and How to post code in SCN, and some things NOT to do... and [Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers] before posting again.
    Rob

  • Expression - First date and last date of current month, current year

    Hi
    I need to have 2 ssrs expression as I can use  as default parameters in my report where I can -  out from my Time dimension, get the
    first date of the current, current year - and one where I get last date, current month, current year.
    My data source is a SSAS cube and my timedimension is structured like this:
    [Time].[Days].&[2009-01-16T00:00:00]
    Any suggestions how to solve this ?

    Hi ,
    You can use below in Default Values in ssrs ;
    for first Day of current month and year
    ="[Time].[Days].&[" +Format(dateadd("m",0,dateserial(year(Today),month(Today),1)), "yyyy-MM-dd")+"T00:00:00]"
    output will be ;
    [Time].[Days].&[2014-09-01T00:00:00]
    For last day of current month and year
    ="[Time].[Days].&[" +Format(DateSerial(Year(Now()), Month(Now()), "1").AddMonths(1).AddDays(-1), "yyyy-MM-dd")+"T00:00:00]"
    output will be ;
    [Time].[Days].&[2014-09-30T00:00:00]
    Please correct me if I misunderstood your requirement.
    Thanks
    Please Mark This As Answer or vote for Helpful Post if this helps you to solve your question/problem.

Maybe you are looking for

  • Archive Source Files with Errors is Missing

    Hi I don't have this option or "Handling of Empty Files" available in ID on my Live or QA Servers although I do have on my Dev. They are all on the same SP and Patch Level 7.0 SP 14. Any suggestions ? Thanks

  • Installing Issues???

    Hey Everyone.. I installed the new windows media player on my macbook, but after installation under which application do we run the file?? It came up as windows media.stix file and when i try to run it, my mac asks me under which application do we ru

  • Web Service deployment on Sun One 7

    Hi, I'm using Netbeans 5.5 and have built a web service that targets tomcat 5.5, J2EE 1.4 and source level 1.5. The Service runs very well in the IDE. Now, the company's Web Server is Sun One 7.0 and I'm trying to deploy to this server unsuccessfully

  • How to deal with hum/interference - 30in Cinema display?

    Hi, I hope someone can help with this! I have a 30inch Cinema display, which has started to create a hum through my powered speakers (Genelec 8040's). I have tried plugging the (mains powered) speakers into a separate mains socket, moving them about,

  • BEWARE OF ADOBES NEW COPY PROTECTION SOFTWARE  IT CAN SERIOUSLY HARM YOUR COMPUTER

    Beware of Adobes new copy protection software it can seriously harm your computer! The FlexNet licensing software that is installed on your computer along with CS3 and CS4, and possibly other, products has the capacity to seriously harm your system.