FM for week in a year

is there any FM for
how many weeks in a year and
how to find the whether the year is leap year or not? and
how many weeks are in the month ?
i want the FM

Hi there. You can use function module hr_99s_interval_between_dates.  Just pass a begin date and an end date, and then you can get the number of days, weeks, months, or years between the two dates.  So you can pass the begin date and end date of a month to get the number of weeks in the month, or the begin date and end date of a year to get the number of days and weeks in the year.  If the number of days is 366 then it is a leap year.  I hope this helps.
- April King
Message was edited by:
        April King

Similar Messages

  • Week of the year.

    Hi,
    I need a query for week of the year. i.e. if we pass the date as parameter which week the date belong.
    for ex. 31-AUG-2008 then 35th week, 01-SEP-2008 then 36th week.
    please help to solvel

    Yes, many ways! :-)
    In general built-in functionality such as the IW format on date conversion is the efficient way to do things - why reinvent the wheel? But, if your week numbers are not the standard ones (and lots of organisations run their own calendars) perhaps you could use a join to a look-up table that maps dates to week numbers.

  • Want to create analysis for this year week vs last year week

    All,
    My requirement is to create an analysis for the passed week number of this year vs same last year week no.
    So basically user will pass the week no. and report should display the passed week no. this year sales number plus same week no. last year sales number.
    How can I achieve this?
    Thanks

    If you ask like this ..I would say like using presentation variable for week
    use measure with exp like
    CASE WHEN WEEK=@{WK} AND Time.year=VALUEOF("PREVIOUS_YEAR") THEN #sales END.
    In this case week is from your subject area and PREVIOUS_YEAR is rep variable you might have it.
    there are other options to get output, need details about your rpd and value of week.

  • Java.util.Formatter format string for week of year?

    What is strange in the Formatter API, regarding dates, is that there is no format string to display week of year. To display day of year e.g. you can use:
    String.format(�%tj�),Calendar.getInstance())but what is the string for week of year?
    String.format(�%tw�),Calendar.getInstance())doesn�t work.
    Any ideas, or did I overlooked the API?

    I �m using
    String.format(�%tx�),Calendar.getInstance())everywhere in my code where x is any of the other (e.g. j, d etc.). Why use different way for this? How come Sun did�t add e.g. a w in the API to display the week of year as it does for day of year?

  • How to get week of a year in American Standard

    Hi,
    I know it might be a repetitive question, but did not find a convincing solution to it in any of the previous threads. I am looking for a function (user defined, if someone has already written it) to return me the week of the year, in American Standard. i.e,the week should start on Sunday and end on Saturday (and NOT from Monday to Sunday)
    01/03/2010 - Should be the start of 1st week of 2010...... 01/10/2010 will be the start of second week and so on
    01/04/2009 - Should be the start of 1st week of 2009...... 01/11/2009 will be the start of second week and so on.
    Does any one have a function that takes a date as input and returns back the week of the year in this above format? Any help is greatly appreciated.
    Thanks

    It's a bit trickier because the ISO rule has some fine prints.
    Take a look at the example below:
    SQL> with t as (
      2  select to_date('01/02/2010', 'MM/DD/YYYY') dt from dual union all
      3  select to_date('01/03/2010', 'MM/DD/YYYY') dt from dual union all
      4  select to_date('01/03/2009', 'MM/DD/YYYY') dt from dual union all
      5  select to_date('01/04/2009', 'MM/DD/YYYY') from dual)
      6  --
      7  select dt,
      8         to_char(dt+1, 'iw') tweaked_week,
      9         to_char(dt, 'ww') nls_week
    10    from t
    11   order by dt;
    DT          TWEAKED_WEEK NLS_WEEK
    3/1/2009    01           01
    4/1/2009    02           01
    2/1/2010    53           01
    3/1/2010    01           01
    SQL> If may notice that 02/01/2010 is week 53 and and that at the same time 03/01/2009 is already week 1, being 04/01/2009 week 2.
    The reason is in the docs:
    An ISO week always starts on a Monday and ends on a Sunday.
    * If January 1 falls on a Friday, Saturday, or Sunday, then the ISO week that includes January 1 is the last week of the previous year, because most of the days in the week belong to the previous year.
    * If January 1 falls on a Monday, Tuesday, Wednesday, or Thursday, then the ISO week is the first week of the new year, because most of the days in the week belong to the new year.It depends on what your requirement asks.
    If you need to prevent any January 1st that fall on Monday to Thursday from becoming your week 1 you'd probably have to adjust that implementation and fine tune it further.
    Let us know if that will do or what your rule would be otherwise.

  • Can't get WRT54G to work for close to a year now.

    I've been having major problems with my WRT54G router to work properly, for close to a year now. I have a: Westell 2200 Modem, connected to DSL (Verizon, connected through PPPoE) WRT54G Modem (Linksys) Laptop with Wireless Card (XP) Desktop with Wireless Card (VISTA) Desktop hooked directly to router (XP) The problems are: Connecting directly to modem (ethernet), internet works fine. All my wireless computers SEE the router, and have 5 bars, but I cannot connect to the internet regularly. I've tried everything. Configuring it manually, using the LELA, etc. etc. I've tried every mode on the router. PPPoE, Bridge, Automatic Config, Static IP I've tried replacing the router, 3 times. I've tried upgrading/rolling back the Router software versions I've tried Linksys Custom Support line dozens of times (Useless, and now they wont let me call without taking more of my money) On my Vista, to even connect to the wireless network, I have to reboot 3 times, repair my connection, make 4 failed attempts to connect, finally connect (limited connectivity) I've called Verizon (they blamed Linksys) and I've called Linksys (they've blamed Verizon) On My laptop, I can connect sometimes, successfully, but I have to reset my router about 4-5 times a day. On our Desktop XP (wired to router) the connection resets alot as well. Everyone I know just plugs their router in, and it works fine. I've had to mess around with the options and menus for weeks to even get some internet. Is something wrong here??

    These are the Windows requirements according to the iTunes dpownload site http://www.apple.com/uk/itunes/download/http://:
    Windows XP Service Pack 2 or later; 32-bit editions of Windows Vista, Windows 7 or Windows 8
    64-bit editions of Windows Vista, Windows 7 or Windows 8 require the iTunes 64-bit installer
    xp 64 bit is not mentioned but it doesn't seem to be supported for the latest ITunes so it seems that you're out of luck.

  • FM to find the number of fiscal weeks in a year

    Hi All,
    Can anyone pls give me the  function module to find the number of fiscal weeks in the given year.
    Thanks,
    Rajani.

    Eric Cartman wrote:
    Ámit Güjärgoüd wrote:
    > > Eric,
    > >
    > > Did you actually enjoy 2004 ?
    wasn't bad...
    do you mean, there were 53 weeks in that year? because I have concern, how it is actually counted...
    wasn't bad... :)
    Thats sounds Sweet
    do you mean, there were 53 weeks in that year?
    Yes
    because I have concern, how it is actually counted...
    If in a leap year fabruary falls in 5 weeks then that is the only possibility for 53 weeks
    Cheers
    PS:But No logic would be applied in this case

  • How to display the week of the year in a report

    Hi,
    I am doing a report, that needs to break down the information, according to month and then week.
    The week of the year isn't stored anywhere in the database, so i guess it would have to be calculated.
    How would i go about doing this in report?

    hi, yes thats what i mean.
    So if i run my report for 01-feb-2008 to 30-march-2008
    it needs to group the data according to weeks.
    eg. week5 (data)
    week6 (data)
    etc....
    i got this code: select to_char(sysdate, 'IW') from dual;
    will it allow me to do this?

  • Output error in Query for Weekly report

    Hello friens,
    I want to create a report in which the user want the output of data as foloow
    net amount----
    week1 week2 week3............. and so on.
    pack1
    pack2
    pack3
    Now there are 52 weeks in a year, and in system the data is stored since 2003 till date.
    So user will want to enter the range of weeks that they want to see for e.g.
    010/2005 -- -12/2007
    Time characteristics available are
    calendar day, calendar year/month, calendar year/week, calendar year,fiscal year, fiscal year/period,posting period
    What i did is in columns for NET AMOUNT , i restricted kf with Fiscal Week and, restricted Fiscal week with Interval variable.
    Now user wants that they want to see the
    Start date of a week for monday.
    So they dont want to see
    week1 week2 week3 week4...........
    But they wanted to see
    01/01/2006   01/08/2006  01/15/2006 and so on.......
    So Please advise what needs to be done!

    Well i didnot able to do that.
    If i restrict in Calday it gives me oppurtunity to restrict with Day not monday, but monday with date..
    so for e.g. in single value restriction.
    i can restrict for Monday 8th october to Friday 12th october.
    So what can u suggest.
    If i create Interval for calday than what user will input is date.
    Plus i think what i mean to say previously is,
    User want to see the Start date of particular weeks
    Start date means date of Start Day , which is Monday.
    So for e..g. Date of monday for week 1 is 01/01/2007 then for next week monday will be 01/08/2007..
    So instead of displaying the Week as 01/2007 .to  050/2007,
    The user want to see the start date of PArticular week.
    so as follow
    01/01/2007  01/08/2007  01/15/2007  01/22/2007  01/29/2007 
    I hope u understand.
    So user want to see the aggregate sales of Week 1 and in description they want to see the Start date of that week.
    They do not want to see date by date sales.
    Please advise.

  • No of weeks in a year

    hi experts,
    i want to calculate the no of weeks in any year entered by user .But the week calculation is the the form of technical weeks(TW).
    1) Technical week starts from monday  or first day of the month
    2) Technical week ends on sunday or last day of the month
    example For year 2007
    From      |                   To           |              Technical_week      | ActualWeek
    JAN 
    01/01/2007       |  07/01/2007       |               1TW         |            1
    08/01/2007       |  14/01/2007       |                2TW        |            2
    15/01/2007       | 21/01/2007        |              3TW          |            3
    22/01/2007       |   28/01/2007      |               4TW         |            4
    29/01/2007       |     31/01/2007    |               5TW         |            5
    FEB
    01/02/2007      |     04/02/2007      |                6TW        |            5
    05/02/2007      |    11/02/2007       |              7TW          |            6
    12/02/2007      |    18/02/2007       |              8TW          |            7
    19/02/2007      |     25/02/2007      |              9TW          |            8
    26/02/2007      |     28/02/2007      |             10TW         |            9
    LIKE wise TW will be more than actual weeks in year 2007...
    So in 2007 there are 52 actual weeks and 63 TW...
    I want to calculate TWs for ANY year given by user on selection screen....
    is there any function module for this... or can we create it... Need some logic
    thanks in advance
    Bijal

    Hi Bijal,
    Logic is as follows.
    CONSTANTS: gc_days_in_week  TYPE i VALUE 7.
    DATA: gf_days               TYPE i,
          gf_techwks            TYPE i,
          gf_month(2)           TYPE n,
          gf_begda              TYPE d,
          gf_endda              TYPE d,
          gf_monday             TYPE d,
          gf_sunday             TYPE d.
    PARAMETERS: p_year(4)       TYPE n.
    gf_month = 1.
    gf_techwks = 0.
    DO 12 TIMES.
      CONCATENATE p_year gf_month '01'
                  INTO gf_begda.
      CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
        EXPORTING
          iv_date             = gf_begda
        IMPORTING
          ev_month_begin_date = gf_begda
          ev_month_end_date   = gf_endda.
    * Check Begin Date start of the week
      CALL FUNCTION 'GET_WEEK_INFO_BASED_ON_DATE'
        EXPORTING
          date   = gf_begda
        IMPORTING
          monday = gf_monday
          sunday = gf_sunday.
      IF gf_begda <> gf_monday.
        gf_begda = gf_sunday + 1.
        ADD 1 TO gf_techwks.
      ENDIF.
    * Check End Date end of the week
      CALL FUNCTION 'GET_WEEK_INFO_BASED_ON_DATE'
        EXPORTING
          date   = gf_endda
        IMPORTING
          monday = gf_monday
          sunday = gf_sunday.
      IF gf_endda <> gf_sunday.
        gf_endda = gf_monday - 1.
        ADD 1 TO gf_techwks.
      ENDIF.
    * Rest of the weeks
      gf_days = gf_endda - gf_begda.
      gf_techwks = gf_techwks + ( gf_days / gc_days_in_week ).
      ADD 1 TO gf_month.
    ENDDO.
    WRITE:/ 'Technical Weeks : '(001), gf_techwks.
    I know you can still optimize it in terms of variables' usage : )
    Regards,
    Manish Joshi
    I hope you know what to do now.
    Message was edited by:
            Manish Joshi

  • Regarding Date data in the format of WEEKLY , MONTHLY , QUARTERLY , YEARLY

    hai
    i have one Infoobject(ZDATE) which is created based on the Reference Characteristic(ocalday) and contains data in the YYYYMMDD format.
    I want same date data in weekly , monthly , quarterly and yearly.
    So for this one i need to created ZWEEK , ZMONTH, ZQUARTER and ZYEAR infoobjects by using Reference Characteristics 0calweek , 0calmonth , 0calquarter , 0calyear and i need to write the formula for these InfoObjects for converting & getting data from the ZDATE.
    So please give the formulas for each InfoObject.
    I will assign the points
    bye
    rizwan

    Hi ,
    Try this for month and year in Transfer structure .
    zyear = zdate+0(4).
    zmonth = zdate+4(2).
    For quarter since it will be depend of what kind of fiscal period you are using.. say for ex april - march.
    For Week... whether you want find it based on calender year or fiscal period.
    Regards
    Balaji

  • Fm - how many weeks in a year

    is there any FM for
    how many weeks in a year and
    how to find the whether the year is leap year or not? and
    how many weeks are in the month ?
    i want the FM

    Hi Priya,
    There is a function module 'TIME_GET_LAST_WEEK'.
    In this FM, export the Year & you will get(Import) a value in a parameter
    EF_WEEK. This will be the Concatenated String of Year&Number_of_weeks in that year
    For Example If you run this FM for the Year 2004, the Parameter EF_WEEK will
    be '200453'. That means last two digits gives the number of weeks in that year.
    From this value you can easily get number of weeks (i.e,EF_WEEK+4(2)).
    If this value is 53, then it is a leap year, else not a leap year
    Regards,
    Sreenivas Reddy Maddi

  • Variable Offsets for Weeks

    We have a custom created infoobject for fiscal week, which is basically week number within fiscal variant, fiscal year, and fiscal period. So fiscal period 1 contains weeks 1-4, period 2 contains weeks 5-8, etc.
    Our problem is in the use of variable offsets in query definitions. If we use 0FISCPER, BEx knows that the "-1 offset" for 2005001 is 2004012, not 2004999. Similarly, for 0CALWEEK, the week before 200501 is 200452, not 200499. So for our custom infoobject, how do tell BEx that the fiscal week before 200501 is 200452? Anyone know how we can set this up?
    Thanks in advance for any info you can provide.
    Rachel McGregor

    Yes, we figured we would probably need to do something in the user exit. We did not create the infoobject with reference to anything else since we added some custom attributes.
    What exactly should we do in the user exit? We want to create a structure with a whole bunch of selections for week number, week number-1, week number-2, week number-3, etc. all the way back to week number-104 (i.e. we want 2 years' worth), with a single prompt to the user for week number.
    Any suggestions?
    Rachel

  • I've been using iMovie '09 for more than a year and now .MTS files won't upload?

    I've been using iMovie '09 for more than a year and each time I would plug in my SD card (using a card reader) the import box would open and I could select the clips I wanted to work with. Now, suddenly, today the import box won't open. Why??? I literally just used the exact same method three weeks ago and it worked fine. I have not done anything differently. Also, when I go to "file > import from camera" it only shows the built-in camera. What am I doing wrong? And how do I get my files? I do not want to download a converter of any time. I know there has to be a way because it literally just worked three weeks ago so I'm just trying to figure out why it won't work now.

    Unfortunately, you cannot upgrade to Safari 5 or 6 on Mac OSX 10.4.11 and that is what you need to access iCloud (http://support.apple.com/kb/ht4759). I am not sure, but maybe you can install another and newer browser version of Firefox or Chrome to access iCloud.

  • Week of the year number appears out of sync with the day of week the week #

    Using the querry below on on a table where the pdate value is a sequential list of dates on an Oracle 11 database the results show the week of the year number changes on the day of the week number 7 not the day of the week number 1. Is there a patch to fix this?
    select
    pdate,
    to_char(pdate,'D') dow,
    to_char(pdate,'Day') Day_name,
    to_char(pdate,'WW') week_of_the_Year
    from daily_period_tab
    where pdate >= '07-jan-11'
    and pdate <= '09-jan-11'
    07-JAN-11     6     Friday      01
    08-JAN-11     7     Saturday      02
    09-JAN-11     1     Sunday      02

    Hi,
    Independent of you NLS settings, you can do this:
    SELECT     TRUNC ( dt + 1
               , 'IW'
               ) - 1     AS sunday
    FROM     table_x;The output in the sunday column will be the Sunday on or before dt. The "magic number" 1 indicates that your week starts 1 day before the ISO week, which starts on Monday.
    Or if you want to use your NLS settings:
    ALTER SESSION     SET NLS_TERRITORY= 'AMERICA';
    SELECT     TRUNC ( dt
               , 'DY'
               )          AS sunday
    FROM    table_x; 
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using.

Maybe you are looking for

  • If you format on a Mac can you still use on a PC?

    I know it used to be if you formated you iPod to a pc you could use it on both pc and Mac. But if you formated to a Mac you cant ever use it on a PC. Is that still true?

  • Widget support for a dynamic 'URL'

    There is a website http://planefinder.net that displays the current location of aircraft in real time. This web page is programmed to refresh in timed intervals and display the last real time location of each aircraft. [I hope that makes sense]. This

  • Apple Flags in Full Screen Mode?

    I'm probably missing this somehow.... but can one apply a flag or color label when in full screen mode?

  • Getting EM incident Service ID in email template

    Hi Guys, We have monitoring for OSB and when a proxy service is down, an incident is created. Is it possible to get the "Service ID" in the email template? If yes, what is the attribute/label for this? Given below is the Incident Details from Inciden

  • Setting up a Role to Restrict SQVI by user (on field BUKRS table KNC3)

    Hi Everyone! I am trying to get my basis team to give me access to SQVI - but they want to restrict the financial data I have access to by company code (9000 in our company). The authorisation checking for SQVI is not straightforward apparently. It d