Calendar getting current week

Hi,
Is there a way to get the current week for a ceratin date.
(e.g id i input today 17/06/2008, i must receive 15/06/2007 - 21/06/2007)
if sunday is my first week day or 16/06/2007 - 22/06/2007 if monday is my first day of week.
kindly advice how can this be done.
Thank you in advance

Thank you for your reply.
But if i do not use the af:choosedate or af:selectinputdate.
can this be done programatically, il will have on input to write the date and then i will display 2 output for the date of the first day of the week in question and the other for the last.
Please advice

Similar Messages

  • Get current week of calendar

    Hi there,
    I want do get the number of the current week into a integer.
    my code:
    <%@ page import="java.sql.*" %>
    <%@ page import="java.io.*" %>
    <%@ page import="java.util.*"%>
    Calendar calendar = Calendar.getInstance();
    int kw = calendar.WEEK_OF_YEAR;
    session.setAttribute( "show_kw", kw);
    session.setAttribute( "kw", kw); // please do not wonder...I need this, tooLater in my code I want to display this number:
    <p><%
              session.getAttribute("show_kw");
              %></p>But it displays...nothing. Not even a space.
    Any idea, why it isn't showing up the number?
    X--spYro--X

    You need to use the following :
    int kw = calendar.get(Calendar.WEEK_OF_YEAR);instead of
    int kw = calendar.WEEK_OF_YEAR;in your code.
    Hope this helps.
    Thanks

  • Beginner Question: Get current Week Number with Token API

    Is it possible to get the current week (1-52) with the token API?
    I searched the gwtokens.pdf for a suitable method, but haven't found
    something that fit my needs.
    Any idea/suggestion?
    Thank's in advance for your help.

    test wrote:
    > current week
    Use the windows api, or build in functions of the language you code in
    Tommy Mikkelsen
    IT Quality A/S, Denmark
    Novell Support Forums SYSOP / NKP
    Sorry, but no support through email
    Please join http://www.open-horizons.net

  • Get current week dates

    Hi I'm trying to put a query together that shows the dates, from monday to saturday for the current week. So for example if it's friday it has to show me monday / tuesday / wednesday / thursday and the current friday.
    Does anyone know how to accomplisch this with the use of sysdate?
    This is what I got now.
    select trunc(trunc(sysdate,'y') + (:fw * 7),'iw') "Monday",
    trunc(trunc(sysdate,'y') + (:fw * 7),'iw')+1 "Tuesday",
    trunc(trunc(sysdate,'y') + (:fw * 7),'iw')+2 "Wednesday",
    trunc(trunc(sysdate,'y') + (:fw * 7),'iw')+3 "Thursday",
    trunc(trunc(sysdate,'y') + (:fw * 7),'iw')+4 "Friday"
    from dual
    but I need to get this in one column and that it wil automaticly fill in the current week date
    Message was edited by:
    SilvertraX

    SQL> select to_char(next_day(sysdate,'sunday')-7+rn,'day')
      2  from
      3   (select rownum rn
      4    from dual
      5  connect by level <= (next_day(sysdate,'sunday') - sysdate)+1)
      6  /
    TO_CHAR(N                                                                      
    monday                                                                         
    tuesday                                                                        
    wednesday                                                                      
    thursday                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to get current week data only

    Dear All,
    I'm running a report from January 2014 till date.
    I want a variable that helps me to show only the current week data.
    Please help ASAP if anyone available now.
    Thanks In Advance

    Hi
    You should create a dynamic prompt @ universe level or @ Business layes with @Prompt.
    create a filter in universe with below code
    DATE BETWEEN
    case
    when @Prompt('Week Start Date:','A','<LOV>',,'Week Start Date')='Week Start Date' then getdate()-7
    else @Prompt('Week Start Date:','A','<LOV>',,) end
    AND
    case
    when @Prompt('Enter Date:','A','<LOV>',,'Current Date')='Current Date' then getdate()
    else @Prompt('Enter Date:','A','<LOV>',,) end
    PS: syntax will work for SQL server. Change syntax for other databases
    Now use the filter in the report and you will get the current date data
    Regards
    Anil

  • How to get Current week and No of Weeks for each quarter!!

    Hi,
    As a part of report development I have to derive Current week and No.of Weeks in Curreny Query. Based on these information I have to calculate Phased target (Calculated KYF).
    Phased target = (Target for Quarter / No of weeks in Current Quarter) X Current Week.
    We have to derive Current Quarter and Current week from  Customer Exit (From Invoice date, which is an entry by Users at report level).
    My questions are:
    1) We have to derive Two Restricted key figures (by Calweek)  for derving No of weeks for Currnet Quarter and Current week in Query level. Based on this info, we have to derive Calculated kef figure for Phased target.
    2) And the output is 6 (ex:- 132008) char length for Current week and we have to pick Week info only and we have to populate RKF created for Current week. How we can achieve this.
    3) Regarding the No of weeks per for current quarter, we are writing Customer exit to determine Quarter and no of weeks, but how to bring this info in query level.
    4) Is there any standard code available (SAP Exit) to find Current week and No of Weeks in Current quarter.
    Regards,
    Suresh Molli

    Hi Venkat Molli,
    Follow the below step for the doing the same:
    1. Create a customer exit variable on calweek.
    2. Restrict the created variable for respective info object.
    3. To Populate the data write code in CMOD.
         in enhancement function module: EXIT_SAPLRRS0_001 -> in Include ZXRSRU01 write the below code:
    WHEN '<variable name>'.
         IF i_step = 1.
          CLEAR l_s_range.
          CALL FUNCTION 'RSVAREXIT_0P_CWEEK'
            IMPORTING
              e_t_range = lt_week.
          READ TABLE lt_week INTO l_s_range1 INDEX 1.
          v_last_week = l_s_range1-low+4(2).
          v_last_week =  v_last_week - 1.
          l_s_range1-low+4(2) = v_last_week.
          l_s_range-low      =  l_s_range1-low.
          l_s_range-sign     = 'I'.
          l_s_range-opt      = 'EQ'.
          APPEND l_s_range TO e_t_range.
        ENDIF.
    4. Execute the report.
    I hope you can handle you issue now.
    Assign points if it is helpful.
    Regards,
    S P.

  • ADF: getting current week through sysdate

    hi,
    Im using Jdev 11G.
    i have a table with sysdate displaying.
    now i need to calculate week by this sysdate and display in another column of the table.
    for ex: if sysdate is 3/2/2012 then the week should be 09 (bcoz 2nd March 2012 is the 9th week for the year 2012).
    How can i achieve this.
    Thanks.

    Hi,
    Have you tried adding to_char(sysdate,'WW') as a new column (calculated) in your VO's query.
    Ex :
    select to_char(to_date('3/2/2012','mm/dd/yyyy'),'WW') from dual-Arun

  • Getting the exact date of current week and current month

    I would like to know is there any methods to know the exact date of the current week and current month?

    //use this function like this
    //String date = getNow();
    public static String getNow()
         Calendar cal = new GregorianCalendar();
         // Get the components of the time
         int hour24 = cal.get(Calendar.HOUR_OF_DAY); // 0..23
         int min = cal.get(Calendar.MINUTE); // 0..59
         int sec = cal.get(Calendar.SECOND); // 0..59
         // Get the components of the date
         int year = cal.get(Calendar.YEAR); // 2002
         int month = 1 + cal.get(Calendar.MONTH); // 0=Jan, 1=Feb, ...
         int day = cal.get(Calendar.DAY_OF_MONTH); // 1...
         String timeStamp = String.valueOf(year) + "-" + addZero(month)+ "-" + addZero(day)
              + " " + addZero(hour24)+ ":" + addZero(min) + ":"+ addZero(sec) + ".0";
         return timeStamp;
    public static String addZero(int num)//this function works with the getNow() function
    //all it does is adds a zero to an int if its less then ten
         String val = "";
         if(num < 10)
         val +="0"+num;
         }else{
         val = String.valueOf(num);
         return val;
    }

  • How to get data for current week and previous week using customer exit in Bex.

    Hi everyone,
    I have a scenario in which I need to display data for current week and previous week (based on "sy_datum" the program has to calculate current week and previous week) in Bex using  Customer exit. I have created one variable in Bex Query Designer and I have written code for the variable in CMOD. But it is not working fine, (I know that we can do the same by using offset value in Bex). Can some one guide me how to achieve my requirement using customer exit.
    Thanks in Advance,
    G S Ramanjaneyulu.

    Hi krishna,
    Thanks for your quick reply, can you have a look at my code,
    case i_vnam.
    WHEN 'ZPWK_CWK'.
    ranges : pre_week for sy-datum.
    data : start_date type DATS,
           end_date TYPE dats .
    ************FM TO GET FIRST DATE OF CURRENT WEEK ************************
    CALL FUNCTION 'BWSO_DATE_GET_FIRST_WEEKDAY'
      EXPORTING
        DATE_IN  = sy-datum
      IMPORTING
        DATE_OUT = start_date.   " WEEK FIRST DATE
    end_date = START_DATE + 6.   " WEEK LAST DATE
    END_DATE   = START_DATE - 1.   " PREVIOUS WEEK END DATE
    START_DATE = START_DATE - 7.   " PREVIOUS WEEK START  DATE
    **********PREVIOUS WEEK DATES IN PRE_WEEK******************
    pre_week-SIGN   = 'I'.
    pre_week-option = 'BT'.
    pre_week-LOW    = START_DATE.
    pre_week-HIGH   = END_DATE.
    APPEND  pre_week.
    CLEAR : START_DATE,END_DATE.
    endcase.
    Regards,
    G S Ramanjaneyulu.

  • How to get date range of Current week

    Hi Gurus,
    I need to create report of current(this) week manual bills created by one user. I have date Field called CREAT_DATE.Based on this date column i need to create report.
    Could anybody help to get this query.
    Example:
    select .....
    from ....
    where
    CREAT_DATE
    Thank You
    Vikram

    It kind of depends on your definition of "current week". If you mean something like the last 7 days, then
    SELECT columns
    FROM table
    WHERE creat_date BETWEEN TRUNC(sysdate - 7) and TRUNC(sysdate +1)would do it.
    If you mean Monday until today, then:
    SELECT columns
    FROM table
    WHERE creat_date BETWEEN NEXT_DAY(TRUNC(sysdate - 7), 'MONDAY') and TRUNC(sysdate +1)Read up on the various date functions for other possibilities.
    TTFN
    John

  • How to get the current week from sysdate?

    Hi sir,
    i want to know how to get the current week from sysdate?
    thanks

    Hi Nicolas
    It seems you like to check my post and also make commend ;) thanks for your attention
    Have you ever read the posts above and given solutions ?Yes, I did
    Have you read the docs ? Yes, I checked
    What's the added value here ?Did youYou shared doc with solution(long one), I shared short one which point same solution(Check what Joel posted)..So what is benefit, As you can guess oracle docs are sometimes become so complicated as specialy for beginner...(At least it was like that for me and Belive me somedocs are still sooo complicated even for oracle coworkers ) But for you I dont know ;)
    => Why writting the PS in bold ?Why.. Let me think... Ohh Maybe I am looking some questions(many) and even user get answer they should not changed status so I am reading some posts and try to get problem and loosing time..
    So I am putting that PS wiht BOLD because I dont wanna lose time my friend ;) Because While I am trying to help ppl here In same time I am trying to giving support to my customer prod systems. Which mean time is very important for me...
    Hope my answer could satisfy you..
    One important PS for you.. You may not like my posts (or someone) but my friend I become tired to read&answer and make commend to on your comment which is about my posts.
    I am not newbie in forum(At least I fell like that) and I belive I know how I should make post..
    Thank you
    Regards
    Helios

  • Get the Current Quarter  and Current Week from date

    Hi,
    I want to get the Current quarter and Current week from a given date, which function modules should i use?
    I tried using function module - 'HR_99S_GET_QUARTER' for getting the quarter but it is throwing an error while loading data. Moreover it doesnt exist in BI7.
    Similarly for current week.
    Please help. Sample code snippets would be appreciated.
    Thanks
    Jaya

    You can use FORM time_conversion wich is the one used by standard in Update Rules:
    You can select whether convert 0CALDAY to 0CALWEEK or whatever infobject formats you prefer...
      perform time_conversion
                using  '0CALDAY'
                       '0CALMONTH'
                        p_input_date
                        l_fscvtval
                changing RESULT
                         c_t_idocstate
                         c_subrc
                         c_abort.
      if c_subrc <> 0 or c_abort <> 0.
        exit.
      endif.
    form time_conversion
                   using i_timnm_from type rsiobjnm
                         i_timnm_to   type rsiobjnm
                         i_timvl
                         i_fiscvarnt  type t009b-periv
                   changing e_timvl
                            c_t_idocstate  type rsarr_t_idocstate
                            c_subrc   like sy-subrc
                            c_abort   like sy-subrc. "#EC *
    data: l_timvl  type rsd_chavl,
          l_result type rsd_chavl.
      IF i_timvl CO ' 0'.
        CLEAR e_timvl.
        EXIT.
      ENDIF.
      l_timvl = i_timvl.
      CALL FUNCTION 'RST_TOBJ_TO_DERIVED_TOBJ'
        EXPORTING
          i_timnm_from             = i_timnm_from
          i_timnm_to               = i_timnm_to
          i_timvl                  = l_timvl
          I_FISCVARNT              = i_fiscvarnt
          I_BUFFER                 = rs_c_true
        IMPORTING
          E_TIMVL                  = l_result
        EXCEPTIONS
          INCOMPATIBLE_TOBJS       = 1
          NO_INPUT_VALUE           = 2
          FISCVARNT_MISSING        = 3
          INPUT_NOT_NUMERIC        = 4
          WRONG_DATE               = 5
          WRONG_FISCPER            = 6
          X_MESSAGE                = 7
          OTHERS                   = 8
      e_timvl = l_result.
    ENDFORM.                  "TIME_CONVERSION

  • Filter the current week in Outlook Calendar with SQL DASL

    Hello!
    I'm trying to make a new view in Outlook Calendar that displays meetings with a specific subject. The problem is that I can't find anywhere how to show the meetings for the current week only.
    My SQL DASL syntax is so far:
    "http://schemas.microsoft.com/mapi/proptag/0x0037001f" LIKE '%21%'
    And the result is:
    I have tried to use the %thisweek% parameter without result as I don't know how this should be used (look here to see what I mean
    http://blogs.msdn.com/b/andrewdelin/archive/2005/05/11/416312.aspx?Redirected=true).
    Thanks in advance!

    Hi,
    I think it should be an Outlook related question. Please post a new one on Outlook forum via:
    http://social.technet.microsoft.com/Forums/office/en-US/home?forum=outlook
    Thanks,
    Simon Wu
    TechNet Community Support

  • Get the current week and subtract 12 weeks

    Hi Experts,
    Am getting the system current date and getting the current week using the FM->GET_WEEK_INFO_BASED_ON_DATE. Again I want to subtract 12 weeks including the current week. But still confused with the logic.
    Also I came to know that I can use FM->DATE_GET_WEEK and can subtract 12 weeks from it.
    So please advice how can I proceed further and how can I get the weeks that should be lesser than the 12weeks from the current week.
    Waiting for your valuable ideas.:)
    Thanks and Regards,
    Ramakrishnan M

    Try this one:
    DATA: week      TYPE numc1,
             days      TYPE t5a4a-dlydy,
             date      TYPE p0001-begda,
             months    TYPE t5a4a-dlymo,
             years     TYPE t5a4a-dlyyr.
    CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
         EXPORTING
           date      = s_ord_dt-low
           days      = days
           months    = months
           signum    = '+'
           years     = years
         IMPORTING
           calc_date = date.

  • Display only current week events in sharepoint web part calendar

    i am using calendar in webpart. i need to display only current week events in calendar. Please give me any suggestions...
    Thanks Manohara R

    You could do this using calculated field formula. Refer to the following posts for more information
    http://modery.net/showing-only-this-weeks-events-of-a-sharepoint-calendar/
    http://ankursharepoint.wordpress.com/2011/01/19/list-filter-current-week-items-only/
    http://abstractspaces.wordpress.com/2008/05/14/filter-list-view-by-current-week/
    --Cheers

Maybe you are looking for