FM for get the week number

Hi experts..
I need a FM for get the week number...
for example today 14 april 2010 is the  15 week from the start of the year..
best regards
Marco

Hi,
Check this Fm : GET_WEEK_INFO_BASED_ON_DATE .
Just enter the date
the week parameter returns the year and week number. the last 2 digits give the week number.
Thanks.

Similar Messages

  • How to get the week number for a given date?

    hi guys,
    what is coding to get the week number for a given date?
    For example, 1/1/05 is week 1. then 8/1/05 is week 2.

    The second parameter to pass to the method is supposed to be one of the month constants JANUARY - DECEMBER. It happens to be that their numerical values are 0-11, not 1-12, so your "12" refers to the "13th" month of the year.
    givenDate = new GregorianCalendar(2003, Calendar.DECEMBER, 31);
    If you want to construct dates and times from strings like you seem to be, look into SimpleDateFormat http://javaalmanac.com/egs/java.text/ParseTime.html
    (even still I got WEEK_OF_YEAR as 1 which is true but not really what I expected, excuse my previous reply but I wanted to check the facts before posting this)

  • Userexits/BADI in ME31K for getting the contract number created.

    Dear Experts,
    Is there any userexits/BADI available in ME31K , for getting the contract number once it is created.
    Thanks&Regards,
    Anversha

    Hi
    find the BADI:
    1. Goto SE24
    2. Open the class "CL_EXITHANDLER"
    3. Open the Metnod "GET_INSTANCE"
    4. Put a Break point in the "  CASE sy-subrc."
    CALL METHOD cl_exithandler=>get_class_name_by_interface
        EXPORTING
          instance                      = instance
        IMPORTING
          class_name                    = class_name
        CHANGING
          exit_name                     = exit_name
        EXCEPTIONS
          no_reference                  = 1
          no_interface_reference        = 2
          no_exit_interface             = 3
          data_incons_in_exit_managem   = 4
          class_not_implement_interface = 5
          OTHERS                        = 6.
      CASE sy-subrc.
        WHEN 1.
          RAISE no_reference.
        WHEN 2.
          RAISE no_interface_reference.
        WHEN 3.
          RAISE no_exit_interface.
        WHEN 4.
          RAISE data_incons_in_exit_managem.
        WHEN 5.
          RAISE class_not_implement_interface.
      ENDCASE.
    5. Come Back and Execute the Transaction Code
    6. In the Debugging screen "exit_name" having the BADI Name for that Tcode.

  • UserExit/BADI for getting the contract number in ME31K

    Dear Experts,
    Is there any userexits/BADI available in ME31K , for getting the contract number once it is created.
    Thanks&Regards,
    Anversha

    Hi
    find the BADI:
    1. Goto SE24
    2. Open the class "CL_EXITHANDLER"
    3. Open the Metnod "GET_INSTANCE"
    4. Put a Break point in the "  CASE sy-subrc."
    CALL METHOD cl_exithandler=>get_class_name_by_interface
        EXPORTING
          instance                      = instance
        IMPORTING
          class_name                    = class_name
        CHANGING
          exit_name                     = exit_name
        EXCEPTIONS
          no_reference                  = 1
          no_interface_reference        = 2
          no_exit_interface             = 3
          data_incons_in_exit_managem   = 4
          class_not_implement_interface = 5
          OTHERS                        = 6.
      CASE sy-subrc.
        WHEN 1.
          RAISE no_reference.
        WHEN 2.
          RAISE no_interface_reference.
        WHEN 3.
          RAISE no_exit_interface.
        WHEN 4.
          RAISE data_incons_in_exit_managem.
        WHEN 5.
          RAISE class_not_implement_interface.
      ENDCASE.
    5. Come Back and Execute the Transaction Code
    6. In the Debugging screen "exit_name" having the BADI Name for that Tcode.

  • How to get the week number of year from a Date object?

    Hi!
    I would like to know the week number of the year from a specified Date.
    I dont know how to set the first day of week, and set the minimum days of a week.
    I want to use Monday for first day of week, and at least 4 days of month in a week.
    For example if its 1st, January is Friday, then the first week starts on 4th, Monday.
    Anyone can help?

    Sorry. I should think before I move.
         public static int getWeekOfYear(Date date) {
             Calendar calendar = Calendar.getInstance();
             calendar.setTime(date);
             calendar.setFirstDayOfWeek(Calendar.MONDAY);
             calendar.setMinimalDaysInFirstWeek(4);
             return calendar.get(Calendar.WEEK_OF_YEAR);
         }

  • Getting the week number for a given date

    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    PL/SQL Release 11.1.0.7.0 - Production
    CORE     11.1.0.7.0     Production
    TNS for 64-bit Windows: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - Production
    Hello all.
    I am currently migrating our product from SQL SERVER to ORACLE and have the following issue.
    Basically I'm just trying to get the year week number for a given date but I'm having trouble with Oracle as it seems to think that the weeks run from Thursday to Thursday?. I presume this is something to do with the fact that the first day of the year was Thursday?
    e.g.
    SQL SERVER:
    select DATEPART(wk, '2009-10-24') as Sat -- 43 - correct
    select DATEPART(wk, '2009-10-25') as Sun -- 44 - correct
    select DATEPART(wk, '2009-10-26') as Mon -- 44 - correct
    select DATEPART(wk, '2009-10-27') as Tue -- 44 - correct
    select DATEPART(wk, '2009-10-28') as Wed -- 44 - correct
    select DATEPART(wk, '2009-10-29') as Thu -- 44 - correct
    select DATEPART(wk, '2009-10-30') as Fri -- 44 - correct
    select DATEPART(wk, '2009-10-31') as Sat -- 44 - correct
    select DATEPART(wk, '2009-11-1') as Sun -- 45 - correct
    select DATEPART(wk, '2009-11-2') as Mon -- 45 - correct
    select DATEPART(wk, '2009-11-3') as Tue -- 45 - correct
    select DATEPART(wk, '2009-11-4') as Wed -- 45 - correct
    select DATEPART(wk, '2009-11-5') as Thu -- 45 - correct
    ORACLE:
    SELECT to_char(to_date('24-OCT-2009'), 'ww') as Sat from dual; -- 43 correct
    SELECT to_char(to_date('25-OCT-2009'), 'ww') as Sun from dual; -- 43 incorrect - should be 44
    SELECT to_char(to_date('26-OCT-2009'), 'ww') as Mon from dual; -- 43 incorrect - should be 44
    SELECT to_char(to_date('27-OCT-2009'), 'ww') as Tue from dual; -- 43 incorrect - should be 44
    SELECT to_char(to_date('28-OCT-2009'), 'ww') as Wed from dual; -- 43 incorrect - should be 44
    SELECT to_char(to_date('29-OCT-2009'), 'ww') as Thu from dual; -- 44 correct
    SELECT to_char(to_date('30-OCT-2009'), 'ww') as Fri from dual; -- 44 correct
    SELECT to_char(to_date('31-OCT-2009'), 'ww') as Sat from dual; -- 44 correct
    SELECT to_char(to_date('1-NOV-2009'), 'ww') as Sun from dual; -- 44 incorrect - should be 45
    SELECT to_char(to_date('2-NOV-2009'), 'ww') as Mon from dual; -- 44 incorrect - should be 45
    SELECT to_char(to_date('3-NOV-2009'), 'ww') as Tue from dual; -- 44 incorrect - should be 45
    SELECT to_char(to_date('4-NOV-2009'), 'ww') as Wed from dual; -- 44 incorrect - should be 45
    SELECT to_char(to_date('5-NOV-2009'), 'ww') as Thu from dual; -- 45 correct
    Now I don't want to get into a discussion with regard to locales etc.
    In my world (and is seems SQL SERVER's) the first day of the week is Sunday and the last Saturday.
    Is there some NLS_? setting or something that I'm missing?
    thanks for any help on this.
    Andy

    This is what you need.
    SELECT ceil(( 7+(trunc(to_date('25-OCT-2009'),'d')-trunc(to_date('25-OCT-2009'),'Y')) )/7) FROM dual
    HTH!!!
    --tested all these statements.
    Works as you wish!!
    SELECT ceil(( 7+(trunc(to_date('24-OCT-2009'),'d')-trunc(to_date('24-OCT-2009'),'Y')) )/7) as Sat from dual;
    SELECT ceil(( 7+(trunc(to_date('25-OCT-2009'),'d')-trunc(to_date('25-OCT-2009'),'Y')) )/7) as Sun from dual;
    SELECT ceil(( 7+(trunc(to_date('26-OCT-2009'),'d')-trunc(to_date('26-OCT-2009'),'Y')) )/7) as Mon from dual;
    SELECT ceil(( 7+(trunc(to_date('27-OCT-2009'),'d')-trunc(to_date('27-OCT-2009'),'Y')) )/7) as Tue from dual;
    SELECT ceil(( 7+(trunc(to_date('28-OCT-2009'),'d')-trunc(to_date('28-OCT-2009'),'Y')) )/7) as Wed from dual;
    SELECT ceil(( 7+(trunc(to_date('29-OCT-2009'),'d')-trunc(to_date('29-OCT-2009'),'Y')) )/7) as Thu from dual;
    SELECT ceil(( 7+(trunc(to_date('30-OCT-2009'),'d')-trunc(to_date('30-OCT-2009'),'Y')) )/7) as Fri from dual;
    SELECT ceil(( 7+(trunc(to_date('01-NOV-2009'),'d')-trunc(to_date('01-NOV-2009'),'Y')) )/7) as Sat from dual;
    SELECT ceil(( 7+(trunc(to_date('02-NOV-2009'),'d')-trunc(to_date('02-NOV-2009'),'Y')) )/7) as Sun from dual;
    SELECT ceil(( 7+(trunc(to_date('03-NOV-2009'),'d')-trunc(to_date('03-NOV-2009'),'Y')) )/7) as Mon from dual;
    SELECT ceil(( 7+(trunc(to_date('04-NOV-2009'),'d')-trunc(to_date('04-NOV-2009'),'Y')) )/7) as Tue from dual;
    SELECT ceil(( 7+(trunc(to_date('05-NOV-2009'),'d')-trunc(to_date('05-NOV-2009'),'Y')) )/7) as Wed from dual;
    SELECT ceil(( 7+(trunc(to_date('06-NOV-2009'),'d')-trunc(to_date('06-NOV-2009'),'Y')) )/7) as Thu from dual;
    Cheers!!!
    Bhushan
    Edited by: Buga on Oct 29, 2009 10:46 AM

  • IPCC 7 Determine the week number of a month

    Hello,
    I am working towards determine the week number of month and make appropriate routing changes only for that specific week. I have tried using the trunc(), getdate() and weekday(). But i fail to get the week number of a month, but I believe I have managed to the week number of a year.
    The example I have considered is: On Tuesday and Thursdays in second week of every month the calls to be routed to a different skillgroup.
    Please let me know if anyone has any suggestion for this.
    Thanks,
    FYI,
    CM 4.1, CRS 3.5, ICM 7.1

    Hi buddy,
    Great stuff!! Your link gave me another hint of the possible solution, I was working on ICM but not sure why i did not consider CRS for this requirement , The CRS has a builtin function, I have used this builtin Methods which provided me what i expected.
    The debug on the script resulted the week of the month for today which is "4".
    Please let me know your view.
    Thanks again!

  • How to get a week number  for the year using oracle sql query?

    hi everyone,
    i have the requirement to find the week number for the calender..
    so that week number should start with 01 when the year starts and it should end with week end date(that is first saturday of the january month).. so next week number starts with sunday and ends with saturday ,continously.. in the end date of the year it should not be 'saturday' but week number should end with last date of the year.. again in the next year it should start with '01'.
    for example:
    01-JAN-13 tuesday 01
    02-JAN-13 wednesday 01
    03-JAN-13 thursday 01
    04-JAN-13 friday 01
    05-JAN-13 saturday 01
    06-JAN-13 sunday 02
    07-JAN-13 monday 02
    26-DEC-13 thursday 52
    27-DEC-13 friday 52
    28-DEC-13 saturday 52
    29-DEC-13 sunday 53
    30-DEC-13 monday 53
    31-DEC-13 tuesday 53
    01-JAN-14 wednesday 01
    02-JAN-14 thursday 01
    how can i achieve this, can anyone please help me out on this..
    i have a query that starts with 01 when year starts but it gives problem in the end of the year .. described below with a query..
    select mydate,
    to_char(mydate,'day') as weekday,
    to_char(next_day(mydate,'sunday'),'iw') as week_num
    FROM ( SELECT TRUNC (SYSDATE, 'yy') - 1 + LEVEL AS mydate
    FROM dual
    CONNECT BY LEVEL <= (SELECT TRUNC (ADD_MONTHS (SYSDATE, 24), 'yy')
    - TRUNC (SYSDATE, 'yy')
    FROM DUAL))
    this query gives date, weekday and week_num for 2 years 2013 and 2014,
    when i run this query ,at the end of the 2013 it gives the result as,
    26-DEC-13     thursday      52
    27-DEC-13     friday      52
    28-DEC-13     saturday      52
    29-DEC-13     sunday      01
    30-DEC-13     monday      01
    31-DEC-13     tuesday      01
    01-JAN-14     wednesday     01
    02-JAN-14     thursday      01
    for dates 29 ,30,31st it should give 53 .. how can i achieve that using this this query .. can any one help me out on this please...
    thanks,
    pradeep

    I tried with the IW ...
    it is giving week_id for the year.
    select
    mydate,
    to_char(mydate,'day'),
    case when mydate between trunc(mydate,'yyyy') and next_day(trunc(mydate,'yyyy'),'saturday')
    then to_number(to_char(mydate,'yyyy')||to_char(trunc(mydate,'yyyy'),'iw'))
    when mydate between next_day(trunc(mydate,'yyyy'),'saturday') and trunc(add_months(trunc(mydate,'yyyy'),12)-1,'d')-1
    then to_number(to_char(mydate,'yyyy')||to_char(next_day(mydate,'sunday'),'iw'))
    when mydate between trunc(add_months(trunc(mydate,'yyyy'),12)-1,'d') and add_months(trunc(mydate,'yyyy'),12)-1
    then to_number(to_char(mydate,'yyyy')||to_char(trunc(add_months(trunc(mydate,'yyyy'),12)-1,'d')-1,'iw')+1) end as WEEK_ID
    FROM ( SELECT TRUNC (SYSDATE, 'yy') - 1 + LEVEL AS mydate
    FROM dual
    CONNECT BY LEVEL <= (SELECT TRUNC (ADD_MONTHS (SYSDATE, 24), 'yy')
    - TRUNC (SYSDATE, 'yy')
    FROM DUAL
    ))

  • How do I get the Serial Number for Adobe XI that purchased from Amazon over two weeks ago?

    I am trying to get the serial number so that I can have the permanent version of the Adobe XI that I purchased from Amazon.  Does anybody know how Adobe alerts a buyer to this info?  I purchased the software as a Download so do not have a box.

    Required Proof of Eligibility:
    STUDENTS:
    Your proof of eligibility must be a school issued email address OR a document issued by the institution with your name, institution name, and current date.**
    Types of proof of enrollment include:
    School ID card
    Report card
    Transcript
    Tuition bill or statement
    TEACHERS, FACULTY, STAFF:
    Your proof of eligibility must be a school issued email address OR a document issued by the institution with your name, school name, and current date.**
    Types of proof of employment include:
    Faculty or staff paycheck stub
    Dated ID card
    Official letter from the registrar of the educational institution indicating current employment
    Note: Any sensitive information such as pay amounts, grades, or social security numbers can be covered or crossed out.HOMESCHOOL STUDENTS & TEACHERS:
    Dated copy of a letter of intent to homeschool**
    Current membership ID to a homeschool association (for example, the Home School Legal Defense Association)**
    Dated proof of purchase of curriculum for the current academic school year**
    * Adobe does not provide a trial version of Adobe Acrobat XI Pro for Mac
    ** Documents dated within the last six months are considered current.

  • I recently subscribed to Acrobat XI after the trial expired but when I went to activate it I was asked for the serial number. I only have the order number on the invoice. How do I get the serial number for the trial software that is on my computer?

    I recently subscribed to Acrobat XI after the trial expired but when I went to activate it I was asked for the serial number. I only have the order number on the invoice. How do I get the serial number for the trial software that is on my computer?

    Please do not try to send attachments in mail responses to forum messages. Please return to the forum and click Reply. You can then use the CAMERA icon to add your pictures. Looking forward to seeing what is wrong with your license screens - the general advice is simply to sign in, and everything is done. Make sure you use the SAME Adobe ID that you used to purchase, and check your account details to be sure the subscription is active.

  • How to get the document number for a ware house order.

    Hello gurus,
    how to get the document number for a ware house order. [if GI is posted refering that WH order] .. is there any report?
    Thanks in advance

    There are several options.  When you post a Goods Movement, you can use LB12 -display Transfer Requirement for material document or LB11 Display TR for material.
    Depending on how your system is set up you may have gotten a Transfer Order automcatically.  In this case you can look at LT24 - Transfer Order for material.

  • How do I get the serial number they ask for in signing in , I bought the 19.99 a month program?

    how do I get the serial number they ask for at the sign in part, I paid for the 19.99 and cannot access it , thank you

    Start by using your web browser to go to creative.adobe.com. Log in there with your Adobe ID.
    There is no serial number for subscriptions. You use your Adobe ID. Then there are options to download applications.

  • How can I get the serial number for Premiere 11?

    In october 2012 I´ve bought a bundle pack with Photoshop Elements 11 and Premiere 11. After a hard disk crash i was about to reinstall them both but my wife has trown the envelope in the garbage... = No Serial number available!!
    I´ve registered the serial number for Photoshop Element 11 on Adobe, but not the key for Premiere (they are on the same dvd).
    How can I get the serial number for Premiere 11?

    I do not think there is any way for anyone here to help you (we are just other users) so you are going to have to contact Adobe
    Forum for Download & Install & Setup problems
    http://forums.adobe.com/community/download_install_setup
    Chat http://www.adobe.com/support/download-install/supportinfo/
    -or http://www.adobe.com/support/chat/ivrchat.html
    And tell your wife to be more careful about throwing things away

  • I have my redemption code but can't get the serial number for adobe photoshop elements 12 that I jus

    I'm trying to find out my serial number.  I have the redemption code but can't get the serial number for adobe photoshop elements 12 that I just purchased

    Hi KEsheppard
    Please refer the link below to get the help regarding redemption code and the serial number:
    http://helpx.adobe.com/x-productkb/global/redemption-code-help.html
    Let us know if it helps,
    Thanks!
    Gurleen Kaur

  • I need help getting the license number for Adobe Photoshop Elements. However, It doesn't recognize me as an authorized user. Can someone help?

    I need help getting the license number for Adobe Photoshop Elements. However, It doesn't recognize me as an authorized user. Can someone help?@

    I am having the same problem...did you ever fix it?

Maybe you are looking for

  • Deleting downloaded email from iphone but not web server

    I recently purchased an iphone 3gs. My wife has had an iphone 3g for over a year. I am having a problem deleting email on my 3gs. Whenever my wife downloads mail to her phone, she can delete if off her phone but leave it on the web server for our int

  • Is there an easy way to implement a confirm dialog?

    Hi All,     I'm wondering is there an easy way to show an confirm dialog to user with out create a new view manually?     Thanks, YiNing

  • Upgraded iCloud Storage not showing up in iCloud Drive

    Hi, I upgraded my iCloud storage to 500 GB a few weeks ago.  When I go into iCloud under system preferences I can see that 460GB of that is still available.  However, when I try to store things in iCloud Drive on my computer it tells me there is only

  • .tdms report generation with .pdf format

    Hi, My problem is a kind of report generation problem.My data logging format is .tdms format and i use tdm file viewer function to view my datas but i didnt use tdm data report generation function.How can i use this function with my code.Actually i w

  • Connecting to AS 400 via 5250 Emulator Session

    Hi, I am trying to connect to an as400 server via the sgd 5250 enhancement package. I created an testobject where i specified the hostname of the as 400 server and set the port to 23/tcp. Now I tried to start the application as webtop or independent