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

Similar Messages

  • 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

  • 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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • 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

  • 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

  • Get current method through reflection. Is it possible?

    Is it possible to get current method name (I mean method, which currently executes) through reflection.

    it would seem i am not the one that has a problemas I said, get over it. I have no problem with you whatsoever, I merely pointed out that your solution was a massively heavyweight one that almost certainly wasn't necessary. if you really can't take this sort of opposition, that's your own look out. but don't go trying to start a flame war just because somebody disagreed with you on a couple of points
    that's twice today you've posted something that actually wasn't pertinent to the original question, and rather than accept that, you insist on keeping dragging it up, re-defining terms and making passive-aggressive comments such as the one above. grow up
    The End

  • 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.

  • To get current user through trigger

    Hi,
    I want audit trail through database trigger. But I noticed in trigger 'portal30.wwctx_api.get_user' is failed to parse. Is there any way to get the current user in trigger?
    Thanks,
    Sumita

    Prior to calling the get_user function you'd need to set the context first by invoking the wwctx_api.set_context method.
    Peter

  • 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

  • Query to get data for current week+13

    Hi Friends,
    I have two tables
    BACKLOG_WEEK_AFTER_ATP (LE)
    BACKLOG_ATP_GT_CW (RE)
    ** First I have to query whats the current week and year and it should come in this format ---- 2011-WK30
    columns in table BACKLOG_WEEK_AFTER_ATP are:
    ITEM_NUMBER      QUANTITY
    1N5418                 20
    1N5614                 30
    1N5806SM               10
    1N5811                  0
    2PFF6                  60columns in table BACKLOG_ATP_GT_CW are:
    ITEM_NUMBER     QUANTITY        YEAR_WEEK
    1N5418                30        2011-WK30
    1N5418                 5        2011-WK31
    1N5614                30        2011-WK32
    1N5806SM              30        2011-WK33
    1N5811                20        2011-WK32
    3EX473K1              20        2011-WK30My report should look like
    ITEM_NUMBER    2011-WK30  2011-WK31  2011-WK32  2011-WK33  ...............till 13th week
    1N5418                10         -5         -5         -5  ...............till 13t week
    1N5614                30         30          0          0  ................till 13th week
    1N5806SM              10         10         10         20  ................till 13th week
    1N5811                 0          0         20         20  ................till 13th week
    2PFF6                 60         60         60         60  ................till 13th week
    3EX473K1              20         20         20         20  ................till 13th weekTo get this report i have these conditions to keep in mind.
    1) If item_number not present in LE table and present in RE table then repeat what it is in RE table till 13th week
    2) If item_number not present in RE table and present in LE table then repeat what it is in LE table till 13th week
    3) If item_number present in LE and also present in RE table then do subtraction for RE - LE for that particular item_number till 13th week.
    4) If item_number is there in LE table but not present in RE table for current_week+1(today week comes as 29th week) then repeat the same which is there in LE table. If item is found in RE table for (example 32th week) then subtract RE -LE for that particular item_number
    Thanks in advance.
    Regards

    Hello,
    If you don't need the PIVOT display, then this may help you :
    with le as
    (select '1N5418' item_number, 20 quantity from dual union all
    select '1N5614' item_number, 30 quantity from dual union all
    select '1N5806SM' item_number, 10 quantity from dual union all
    select '1N5811' item_number, 0 quantity from dual union all
    select '2PFF6' item_number, 60 quantity from dual ),
    re as
    (select '1N5418' item_number, 30 quantity, '2011-WK30' year_week from dual union all
    select '1N5418' item_number, 5 quantity, '2011-WK31' year_week from dual union all
    select '1N5614' item_number, 30 quantity, '2011-WK32' year_week from dual union all
    select '1N5806SM' item_number, 30 quantity, '2011-WK33' year_week from dual union all
    select '1N5811' item_number, 20 quantity, '2011-WK32' year_week from dual union all
    select '3EX473K1' item_number, 20 quantity, '2011-WK30' year_week from dual
    row_gen as (
    select item_number, calc_year_week,
           row_number() over(partition by item_number order by calc_year_week) rn
    from
        (select le.item_number from le union select item_number from re) item,
        (select to_char(level*7+sysdate,'YYYY-"WK"WW') calc_year_week from dual connect by level<=13) week)
    select item_number, calc_year_week, calc_qty
    from row_gen, le, re
    where row_gen.item_number=le.item_number(+)
    and row_gen.item_number=re.item_number(+)
    and row_gen.calc_year_week=re.year_week(+)
    model
    partition by (row_gen.item_number)
    dimension by (rn)
    measures (calc_year_week, year_week, le.quantity le_qty,re.quantity re_qty,0 calc_qty )
    rules  (
    calc_qty[1]  =
        case when re_qty[cv()] is null then le_qty[cv()]
        when le_qty[cv()] is null then re_qty[cv()]
        else  re_qty[cv()]-le_qty[cv()]
    end,     
    calc_qty[rn>1] order by rn =
        case when re_qty[cv()] is null then calc_qty[cv()-1]
        else re_qty[cv()] - calc_qty[cv()-1]
        end           )
    order by 1,2;I am not sure this is the simplest way to do it, but the results seem to match your example.
    Regards,
    Sylvie
    Edited by: Troll35 on Jul 19, 2011 3:08 PM

  • 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.

  • 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

  • TS3276 I get Apple Mail through having activated POP in gmail. Since a week, when I click on "Get Mail", after a delay I see brielfly flashing "Incoming message 70 etc." but it dissapears and no mails gets downloaded. How to proceed?

    I get Apple Mail through having activated POP in gmail. Since a week, when I click on "Get Mail", after a delay I see brielfly flashing "Incoming message 70 or whathever the number in waiting is." and the green band extends to the end of the line in a fraction of a seconde, but then dissapears and no mails gets downloaded. It is not a matter of password etc.. that are all OK. Strangely, yesterdays, some email did come through after a few days of failure, but not anymore. Could it be related to hacking or something like that? Any thing I could try?
    I have OX 10.6.8.
    Many thanks for your kind suggestions

    Maybe these will help:
    https://discussions.apple.com/message/17677533#17677533
    https://discussions.apple.com/message/18324129#18324129
    https://discussions.apple.com/message/18203126#18203126

Maybe you are looking for

  • What type of hang? and how to fix?

    Hi, I'm using a java based library application (Sirsi/Dynix Workflows) and i get the following Java SE Platform Not Responding pop-up error when doing a search. My question is, how can i tell what a 6144 hang type is? and how would i go about fixing

  • Pricing of Service Entry Sheet is not coming in editable mode in ML81N

    Dear Friend, I am trying to create a Service Entry Sheet in ML81N where selecting the red button for Condition where itu2019s all coming in display mode where as I have maintained some Z Condition to put the value or % wise. Client requirement is put

  • Reverse wont work on my Muvo N

    Hello, recently my Muvo N200 has started to power off whenever I try to fast rewind/reverse an mp3 file. It will fast forward all right but if I reverse it, it shuts down. Anyone have this problem or know how it can be fixed? Thanks, C5John

  • Ios 6.1.2 wifi is work ??? in iPhone 4s

    anybody know iphone 4s in ios 6.1.2 wifi is greyed or work?

  • Button roll-over animation with dynamic text

    So I have a button I want to be able to use over and over. When you roll over the button, it does an animation and has a dynamic text box in it. Ovbiously im trying to make each text different for each button. What would be the smartest way to go abo