Fiscal Week Dates & Days Generation

Hi Friends,
I am developing an application which requires Fiscal Week
I mean i have a drop-down list box which contains weeks in a year(52).
when i select a week and then click on submit button 'GO' i want to see the list of days with dates in that week.
Any idea how to go about it?
Pooja

Hi,
I assume that u will do teh following...In database u have say weeksmaster database,,,, with weekid,weekname,weekstartdate and wekenddates,,,as fields
Now There are two ways in solving ur problem ....
1)one after clicking the go button hit the server (web server) which will retrive the all days included bw the startand edn days of the selected week.( some query/procedure u run in oracle to retrive the days bw startday and endday )amd show the results back to the user in browser.
2) at the time of loading the first page only u maintain an array of dates in javascript... i.e. every week will have a corresponding array in ur javascript....in this u can work with onchange function which instead of hitting t he server retrives weeek days from javascript...
either way u can proceed,,,and decide which best suites ur requirements...
Regards
Mahesh

Similar Messages

  • How to find first and last date of a fiscal week using SQL

    Hello,
    I want information about FISCAL Week, means a Week based on ISO standard. I know format strings ‘IW’ or ‘IYYY’ gives fiscal week and fiscal year respectively from a given date. But I want to find the first and last date of a fiscal week. Say suppose I have a fiscal week is 2, and fiscal year is 2008, how to find the start and end date of the given fiscal week.
    Any kind of help would be greatly appreciable.
    Thanks,
    Prince

    davide gislon wrote:
    The following query evaluate the begin of a fisical week, where &year and &week are respectively the year and week you want to calculate.
    To evaluate the end of the week you have to add 6.
    Note that my database is set to have monday as day number 1 of the week, and sunday as day number 7; if your database settings are different you should modify the query accordingly.
    SELECT CASE TO_CHAR(TO_DATE('&year','YYYY'),'D')
    WHEN '1' THEN TO_DATE('&year','YYYY')+((&week-1)*7)
    WHEN '2' THEN TO_DATE('&year','YYYY')+((&week-1)*7-1)
    WHEN '3' THEN TO_DATE('&year','YYYY')+((&week-1)*7-2)
    WHEN '4' THEN TO_DATE('&year','YYYY')+((&week-1)*7-3)
    WHEN '5' THEN TO_DATE('&year','YYYY')+((&week-1)*7+3)
    WHEN '6' THEN TO_DATE('&year','YYYY')+((&week-1)*7+2)
    WHEN '7' THEN TO_DATE('&year','YYYY')+((&week-1)*7+1)
    END BEGIN_FISICAL_WEEK
    FROM DUAL
    Hope this is helpful.
    Cheers,
    Davide
    Edited by: davide gislon on 08-Jan-2009 07:19Your query does nothing you say it does. TO_DATE('&year','YYYY') returns first day of the current month for year &year. And the only reason it returns January 1, &year is that we are currently in January:
    SQL> select TO_DATE('&year','YYYY') from dual
      2  /
    Enter value for year: 2005
    old   1: select TO_DATE('&year','YYYY') from dual
    new   1: select TO_DATE('2005','YYYY') from dual
    TO_DATE('
    01-JAN-05
    SQL> As soon as we roll into February:
    SQL> alter system set fixed_date = '2009-2-1' scope=memory
      2  /
    System altered.
    SQL> select sysdate from dual
      2  /
    SYSDATE
    01-FEB-09
    SQL> select TO_DATE('&year','YYYY') from dual
      2  /
    Enter value for year: 2005
    old   1: select TO_DATE('&year','YYYY') from dual
    new   1: select TO_DATE('2005','YYYY') from dual
    TO_DATE('
    01-FEB-05
    SQL> alter system set fixed_date = NONE scope=both
      2  /
    System altered.
    SQL> select sysdate from dual
      2  /
    SYSDATE
    08-JAN-09
    SQL> But even if TO_DATE('&year','YYYY') would always return January 1, &year, or you would fix it to TO_DATE('0101&year','MMDDYYYY') it still would be wrong. ISO week rules are
    If January 1 falls on a Friday, Saturday, or Sunday, then the week including 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 week is the first week of the new year, because most of the days in the week belong to the new year.Therefore, next year:
    SQL> DEFINE YEAR=2010
    SQL> DEFINE WEEK=1
    SQL> ALTER SESSION SET NLS_TERRITORY=GERMANY -- enforce Monday as first day of the week
      2  /
    Session altered.
    SQL> SET VERIFY OFF
    SQL> SELECT CASE TO_CHAR(TO_DATE('0101&&year','MMDDYYYY'),'D')
      2  WHEN '1' THEN TO_DATE('0101&&year','MMDDYYYY')+((&&week-1)*7)
      3  WHEN '2' THEN TO_DATE('0101&&year','MMDDYYYY')+((&&week-1)*7-1)
      4  WHEN '3' THEN TO_DATE('0101&&year','MMDDYYYY')+((&&week-1)*7-2)
      5  WHEN '4' THEN TO_DATE('0101&&year','MMDDYYYY')+((&&week-1)*7-3)
      6  WHEN '5' THEN TO_DATE('0101&&year','MMDDYYYY')+((&&week-1)*7+3)
      7  WHEN '6' THEN TO_DATE('0101&&year','MMDDYYYY')+((&&week-1)*7+2)
      8  WHEN '7' THEN TO_DATE('0101&&year','MMDDYYYY')+((&&week-1)*7+1)
      9  END BEGIN_FISICAL_WEEK
    10  FROM DUAL
    11  /
    BEGIN_FI
    04.01.10
    SQL> SELECT TRUNC(TO_DATE('0101&&year','MMDDYYYY'),'IW') FROM DUAL
      2  /
    TRUNC(TO
    28.12.09
    SQL> 2 user10772980:
    Use:
    SELECT  TRUNC(TO_DATE('0101&&year','MMDDYYYY'),'IW') + (&&week-1)*7 FISCAL_YEAR_&&YEAR._WEEK_&&WEEK
      FROM  DUAL
    FISCAL_YEAR_2010_WEEK_1
    28.12.09
    SQL> SY.

  • From where to get "First day of the week" data for all the locales, is it present in CLDR spec 24?

    I am trying to get "First day of the week" data from CLDR spec24 but cannot find where to look for it in the spec. I need this data to calculate numeric value of "LOCAL day of the week".
    This data to implement "c" and "cc" day formats that equals numeric local day of the week.
    e.g if "First day of the week" data for a locale is 2 (Monday) , it means numeric value for local day of the week will be 1 if it is Monday that day, 2 if it is Tuesday that day and likewise.

    Hi
    If you want to week to be started with Sunday then use the following formula:
    TimestampAdd(SQL_TSI_DAY, 1-DAYOFWEEK(Date'@{var_Date}'), Date'@{var_Date}') if it's retail week(starts from Monday) then the follow below:
    TimestampAdd(SQL_TSI_DAY, 1-DAYOFWEEK(Date'@{var_Date}'), Date'@{var_Date}')
    I'm assuming var_Date is the presentation variable for prompt...
    Edited by: Kishore Guggilla on Jan 3, 2011 4:48 PM

  • Find date if year, month, week and day is given

    Hi,
    How to find the date, if year, month, week and day is given?
    For example:
    Given, year - 2010, month - 03, Day - Wednesday, Week - 3,
    Then how can we get the date as 17-Mar-2010.
    Thanks,
    Chris

    with dt_tbl as (
                    select  2010 year,
                            3 month,
                            3 week,
                            'Wednesday' day
                      from  dual
    select  trunc(to_date(year || '-' || month || '-01','yyyy-mm-dd'),'iw') + (week - 1) * 7 +
              case day
                when 'Monday' then 0
                when 'Tuesday' then 1
                when 'Wednesday' then 2
                when 'Thursady' then 3
                when 'Friday' then 4
                when 'Saturday' then 5
                when 'Sunday' then 6
              end dt
      from  dt_tbl
    DT
    17-MAR-10
    SQL> SY.

  • Previous weeks data

    Hi all,
    I have a requirement where I need to show the Unbilled amount of this week as well as last 20 weeks based on region. Let say I am on fiscal week 20. Now if create a report based on region and Unbilled amount I will get $ 20 for europe. Now if after one week i.e FW 21 , I run the same report I get & 25 for Europe. Again let say after one more week i.e FW 22 I get $ 27 for Europe.
    Now user if run a report on FW 22. he wants areport like
    Week   Region  Unbilled
    FW20   Europe  $20
    FW21   Europe  $25
    FW22 Europe    $27
    i.e history data is required . As data is changing every day , user wants to see previous 20 weeks data.
    Now I am using a Zcube built on standard extarctor 0FI_GL_4. i dont have loading date or system date.
    Please suggest what to do
    Regards,
    Sunny

    Hi.
    If your object fiscal week restricted by variable you should do the next:
    1. create 20 calculated KF each one restricted with this variable with appropriate offset (lets say previous week wth vriable and offset -1, 2 weeks ago with variable and offset -2 ...)
    2. create another calculated KF with variable without offset to represent user selection week.
    So at the end you will see one KF with current week and 20 another KF with 20 previous weeks.
    Regards.

  • Advanced Custom Field help. Need fiscal quarter/fiscal week.

    A coworker is setting up an MS Project...project, and she asked
    for some help adding a custom field that would convert the Start date field into our Fiscal Quarter Fiscal Week schema, to display as FQFW, e.g. Q1W1. I've written a formula that accomplishes this quite nicely in excel, but I've never even touched Project
    until this week. Apparently it doesn't take formulas quite the same way as Excel does. I tried using the ''Switch" function in Project, and it worked, but it only accepts 14 arguments(right?), and there are obviously 52 weeks we're dealing with. Does
    anyone have any suggestions? Would there be a way to do this using VBA? (I know next to nothing here as well.)
    Formula in excel where A1 is the Start Date:
    =IF(AND(A1>=DATE(2014,2,1),A1<=DATE(2014,5,2)),CONCATENATE("Q1","W",(INT((A1-DATE(2014,2,1))/7)+1)),IF(AND(A1>=DATE(2014,5,3),A1<=DATE(2014,8,1)),CONCATENATE("Q2","W",(INT((A1-DATE(2014,5,3))/7)+1)),IF(AND(A1>=DATE(2014,8,2),A1<=DATE(2014,10,31)),CONCATENATE("Q3","W",(INT((A1-DATE(2014,8,2))/7)+1)),IF(AND(A1>=DATE(2014,11,1),A1<=DATE(2015,1,30)),CONCATENATE("Q4","W",(INT((A1-DATE(2014,11,1))/7)+1)),FALSE))))
    Any and all suggestions welcome.
    Thanks.

    msinnen,
    You're correct, switch statements and if statements can only be nested to 15 levels. However, VBA can get you there. This macro should do what your coworker needs with the following assumptions - the fiscal year starts in January and quarters end on the
    last day of the month, not the last Friday. If either or both of those assumptions are incorrect, then this macro will need some tweaking. Note: the quarter and work week designator will be written into the Text1 field.
    Sub FQuartsandWeeks90()
    Dim t As Task
    Dim Mon As Integer
    Dim Qtr As String, Wk As String
    For Each t In ActiveProject.Tasks
        If Not t Is Nothing Then
            t.Text1 = ""
            Mon = Month(t.Start)
            Select Case Mon
                Case 1 To 3
                    Qtr = "Q1"
                    Wk = "W" & CStr(DatePart("ww", t.Start))
                Case 4 To 6
                    Qtr = "Q2"
                    Wk = "W" & CStr(DatePart("ww", t.Start) - 13)
                Case 7 To 9
                    Qtr = "Q3"
                    Wk = "W" & CStr(DatePart("ww", t.Start) - 26)
                Case Else
                    Qtr = "Q4"
                    Wk = "W" & CStr(DatePart("ww", t.Start) - 39)
            End Select
            t.Text1 = Qtr & Wk
        End If
    Next t
    End Sub
    John

  • SQL query to determine Fiscal Week

    Hi Experts,
    I need to figure out the fiscal week for a specific datetime field based on the following requirements:
    1. A week Starts on Saturday and Ends on Friday.
    2. If Feb 1st of a given year is a Saturday, then week 1 will run from February 1st to February 7.
    3. If Feb 1st is not on a Saturday, then week 1 starts on the previous Saturday and ends on the first Friday of February
    Example 1: February 1st 2011 is on a tuesday so Week 1 will be from Jan 29th (Saturday) to February 4 (Friday). Week 52 of 2011 will be from Jan 21, 2012 (Saturday) to Jan 27, 2012 (Friday)
    Example 2: February 1st 2014 is on a Saturday so Week 1 will be from February 1st to February 7.
    I am looking for some sql or pl sql to get the week number. Any help will be greatly appreciated

    Hi,
    Welcome to the forum!
    Here's a PL/SQL function that returns the beginning of the fiscal year which contains a given date, in_date:
    CREATE OR REPLACE FUNCTION     fiscal_year_begin
    (       in_date       IN   DATE     DEFAULT SYSDATE
    RETURN     DATE
    DETERMINISTIC
    AS
         return_date          DATE;
         next_fiscal_year_begin     DATE;
    BEGIN
         return_date     := NEXT_DAY ( ADD_MONTHS ( TRUNC ( ADD_MONTHS (in_date, -1)
                                                    , 'YEAR'
                                    , 1
                                   ) - 7
                             , 'SATURDAY'
         IF  TO_CHAR (in_date, 'MM-DD') BETWEEN '01-26'
                                             AND     '01-31'
         THEN
              next_fiscal_year_begin := fiscal_year_begin (in_date + 7);
              IF  in_date >= next_fiscal_year_begin
              THEN
                   return_date := next_fiscal_year_begin;
              END IF;
         END IF;
         RETURN     return_date;
    END     fiscal_year_begin
    /Here's how it works:
    First, it finds the Saturday on or before February 1 in the same calendar year as in_date (or, if in_date is in January, the previous calendar year). In most cases, this will be the beginning of the fiscal year.
    The only exceptions are the days between January 26 amd January 31, inclusive. These days could be in the following fiscal year, so we check when that fiscal year begins and, if that date is less than in_date, the later date will be the one returned.
    To find the week number of a given date a_date, you can use this formula:
    1 + FLOOR ( (a_date - fiscal_year_begin (a_date))
              / 7
           )which finds how may days have passed since the beginning of the fiscal year, dvides by 7 to get the number of completed weeks (0-52), and adds 1 to get the number of the week in progress.
    You may want to write another function that does that forumula
    You could do the whole job in pure SQL, but it would be messy, and you'd have to copy that messy calculation in every query that used the fiscal year, which I imagine will be a lot of places.
    If the PL/SQL function proves to be too slow, you could use it to populate a table that contained the fiscal year starting points for all years in which you might be interested, and join to that table. You could also include every week in that table.
    Here's some code I wrote to test the function:
    CREATE TABLE table_x
    AS
    SELECT     DATE '2011-01-26' AS a_date     FROM dual     UNION ALL
    SELECT     DATE '2011-01-31'              FROM dual     UNION ALL
    SELECT     DATE '2011-02-01'              FROM dual     UNION ALL
    SELECT     DATE '2011-02-02'              FROM dual     UNION ALL
    SELECT     DATE '2011-02-08'              FROM dual;
    INSERT INTO  table_x (a_date)
    WITH   cntr     AS
         SELECT     LEVEL     AS n
         FROM     dual
         CONNECT BY     LEVEL <= 10
    SELECT     ADD_MONTHS (x.a_date, 12 * c.n)
    FROM             table_x    x
    CROSS JOIN        cntr           c
    ALTER SESSION     SET NLS_DATE_FORMAT     = 'DD-Mon-YYYY Day';
    SELECT     a_date
    ,     fiscal_year_begin (a_date)     AS year
    ,     1 + FLOOR ( (a_date - fiscal_year_begin (a_date))
                    / 7
                )               AS week
    FROM     table_x
    ORDER BY  a_date;Output:
    A_DATE                YEAR                        WEEK
    26-Jan-2011 Wednesday 30-Jan-2010 Saturday          52
    31-Jan-2011 Monday    29-Jan-2011 Saturday           1
    01-Feb-2011 Tuesday   29-Jan-2011 Saturday           1
    02-Feb-2011 Wednesday 29-Jan-2011 Saturday           1
    08-Feb-2011 Tuesday   29-Jan-2011 Saturday           2
    26-Jan-2012 Thursday  29-Jan-2011 Saturday          52
    31-Jan-2012 Tuesday   28-Jan-2012 Saturday           1
    01-Feb-2012 Wednesday 28-Jan-2012 Saturday           1
    02-Feb-2012 Thursday  28-Jan-2012 Saturday           1
    08-Feb-2012 Wednesday 28-Jan-2012 Saturday           2
    26-Jan-2021 Tuesday   01-Feb-2020 Saturday          52
    31-Jan-2021 Sunday    30-Jan-2021 Saturday           1
    01-Feb-2021 Monday    30-Jan-2021 Saturday           1
    02-Feb-2021 Tuesday   30-Jan-2021 Saturday           1
    08-Feb-2021 Monday    30-Jan-2021 Saturday           2Whenever you post a question on this forum, it helps if you also post some sample data (CREATE TABLE and INSERT statements) and the results you want from that data, like I just did.

  • Fiscal Week and Fiscal Variant Creation in BW

    Hi,
    I have a 2004s system that is not connected to an R/3/ECC client.  The data comes from a SQL Server Database.  We need to report on a fiscal week basis and not a calendar week.
    We have a seperate calendar week that finance uses, but operations uses a different work week (Tues - Mon). 
    I figure the best way to handle this is by creating a Fiscal Variant of 53 periods (one for each week).  My problem is that I cannot right click on the R/3 source system and import all of the Fiscal Periods.  I have to create them in BI directly. 
    Can anyone advise me on how to do this?  I have completed the following steps:
    1.) I went into SPRO=> SAP NetWeaver=> Business Intelligence=> General BI Settings=> Maintain Fiscal year variant.
    2.) Then I created variant ZA with Year-Dependent and 53 periods.  I left special periods blank.
    3.) I create the periods for 2007 and 2008 making 1/6/07 the last day of the first period of 2007 and 12/29/07 the last day of the last period of 2007 and one final entry for 12/31/07 for period 1 year shift +1.  2008 was set up similarly.
    4.) I setup the period texts naming them as 1/ FW 1 ... to 53/ FW 53 for both 2007 and 2008.
    5.) I then went into SHortened Fiscal Year and made both 2007 and 2008 to have 52 periods.
    Am I missing something here?  When I load my data I get the following error:
    "Fiscal year variant ZA is not maintained for calendar year 2007" and I get this error on over 100 records of my 1300 record load.  Some Dates are 2/18/08 which isn't in FY07 and others are 1/8/07 - 1/10/07.
    Any help is appreciated.
    Thanks,
    Brian

    Did you ever get an answer to your question? We are seeing the same issue.

  • BI7 - Fiscal Week to Calendar Week Conversion

    Hello Experts,
    i have a requirement to convert Fiscal Week (YYYYWWW) to Calendar Week (YYYYWWW). Source field is from a flat file. My company follows the fiscal variant : Z3 (Fiscal Calendar : July to Jun)
    Could any of you please shed some light (Function Module (if any)) to achieve this
    Example : Input Field : 2011001 (Fiscal Year : 2011; Fiscal Week 1 represents 1st week in Sep 2010 ) 
                    Output should appear as : 2010027  (This is for Week 27 in Calendar Year 2010)
    i would much appreciate your time and response
    Thanks,
    Ragavan

    Hi,
    The following steps could be helpful to solve your case.  Analyse if you need to make any correction so as to adequate them:
    1) Take YYYY from Fiscal Week and call function 'FIRST_AND_LAST_DAY_IN_YEAR_GET' in order to get the first day in fiscal year.
    2) Yake WWW from Fiscal Week and multiply it by 7.
    3) Add the number of days obtained in 2 to the date obtained in 1.  This should be the first date in the fiscal week.
    4) Use function '/SDF/CMO_DATETIME_DIFFERENCE' to get the number of days between the date obtained in 3 and the beginning of calendar year (January 1 of YYYY / YYYY+1).
    5) Divide the result you got in 4 by 7, so as to get the number of weeks elapsed (round if necessary).  This should give you the WWW part of Calendar Week.
    6) The YYYY part of Calendar week should be YYYY/YYYY+1 from Fiscal Week.
    Here you can find a similar example related to fiscal week and fiscal quarter:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/608a0483-91ab-2d10-e38d-b90ec3c487f3
    Regards,
    Maximiliano

  • Error in Timebucket while using Fiscal Week

    We have a requirement to run deployment to create deployment
    orders weekly. Hence we copied 9ANSNP94 and want to change the timebucket.
    The weeks definition over here is not the same as SAP Std.
    E.g
    Start Date
    End Date
    Week Number
    1-Jan-13
    6-Jan-13
    Week 1
    7-Jan-13
    13-Jan-13
    Week 2
    14-Jan-13
    20-Jan-13
    Week 3
    21-Jan-13
    27-Jan-13
    Week 4
    28-Jan-13
    31-Jan-13
    Week 5A
    1-Feb-13
    3-Feb-13
    Week 5B
    4-Feb-13
    10-Feb-13
    Week 6
    11-Feb-13
    17-Feb-13
    Week 7
    18-Feb-13
    24-Feb-13
    Week 8
    25-Feb-13
    28-Feb-13
    Week 9A
    1-Mar-13
    3-Mar-13
    Week 9B
    Hence we have defined Fiscal year variant
    upto 62 periods
    But get error in timebucket –
    Can you please help to resolve the issue
    Regards
    Nishigandha
    Start Date
    End Date
    Week Number
    1-Jan-13
    6-Jan-13
    Week 1
    7-Jan-13
    13-Jan-13
    Week 2
    14-Jan-13
    20-Jan-13
    Week 3
    21-Jan-13
    27-Jan-13
    Week 4
    28-Jan-13
    31-Jan-13
    Week 5A
    1-Feb-13
    3-Feb-13
    Week 5B
    4-Feb-13
    10-Feb-13
    Week 6
    11-Feb-13
    17-Feb-13
    Week 7
    18-Feb-13
    24-Feb-13
    Week 8
    25-Feb-13
    28-Feb-13
    Week 9A
    1-Mar-13
    3-Mar-13
    Week 9B

    Thanks ada
    It worked really well. Now I can see the fiscal weeks in planning book.
    But the period is displayed as P13.2014, I want this to be viewed as per the period Text.
    I have defined the text in the fiscal year varaint configuration
    Do I need to use the user Exit - APODM006 or is there any std way?
    Start Date
    End Date
    Period
    Week Number
    1-Jan-14
    5-Jan-14
    1
    Week 1
    6-Jan-14
    12-Jan-14
    2
    Week 2
    13-Jan-14
    19-Jan-14
    3
    Week 3
    20-Jan-14
    26-Jan-14
    4
    Week 4
    27-Jan-14
    31-Jan-14
    5
    Week 5
    1-Feb-14
    2-Feb-14
    6
    Week 6
    3-Feb-14
    9-Feb-14
    7
    Week 7
    10-Feb-14
    16-Feb-14
    8
    Week 8
    17-Feb-14
    23-Feb-14
    9
    Week 9
    24-Feb-14
    28-Feb-14
    10
    Week 10A
    1-Mar-14
    2-Mar-14
    11
    Week 10B
    3-Mar-14
    9-Mar-14
    12
    Week 11
    10-Mar-14
    16-Mar-14
    13
    Week 12
    17-Mar-14
    23-Mar-14
    14
    Week 13
    24-Mar-14
    30-Mar-14
    15
    Week 14
    31-Mar-14
    31-Mar-14
    16
    Week 15A
    1-Apr-14
    6-Apr-14
    17
    Week 15B

  • Problem with Fiscal weeks

    Hi,
    I have to write a query which should fetch data for the last 6 fiscal weeks from the data from which it is run.
    eg
    SELECT TO_CHAR(SYSDATE,'YYYYIW')-6 FROM DUAL
    The above query would give me the last 6th fiscal week from the current date, but this query fails when the date lies in the first 6 fiscal weeks, it would return something like 200595 which should be 200546. The problem is that the number of the fiscal weeks for a year are not fixed. it might be 52, 53 or 54 also.
    Is there any function existing in oracle that would handle the above problem? if not can ayone help me to find a workaround for that.
    Thanks in advance
    Ramesh

    Is it a problem with week starting end of year and ending at the begining of the following year ?
    If yes, you maybe need to work with WW instead of IW, and try something like :
    SQL> exec :dt:='02062006'
    PL/SQL procedure successfully completed.
    SQL> ed
    Wrote file afiedt.buf
      1  select to_char(to_date(:dt,'DDMMYYYY'),'YYYYWW') "WEEK",
      2         case when to_char(to_date(:dt,'DDMMYYYY'),'WW') -6 > 0
      3              then to_char(to_date(:dt,'DDMMYYYY'),'YYYYWW') -6
      4              else to_char(last_day(trunc(to_date(:dt,'DDMMYYYY'),'YYYY')-1),'YYYYWW')
      5                   + (to_char(to_date(:dt,'DDMMYYYY'),'WW') -6) end WEEK_MIN_6
      6* from dual
    SQL> /
    WEEK   WEEK_MIN_6
    200622     200616
    SQL> exec :dt:='05012005'
    PL/SQL procedure successfully completed.
    SQL> select to_char(to_date(:dt,'DDMMYYYY'),'YYYYWW') "WEEK",
      2         case when to_char(to_date(:dt,'DDMMYYYY'),'WW') -6 > 0
      3              then to_char(to_date(:dt,'DDMMYYYY'),'YYYYWW') -6
      4              else to_char(last_day(trunc(to_date(:dt,'DDMMYYYY'),'YYYY')-1),'YYYYWW')
      5                   + (to_char(to_date(:dt,'DDMMYYYY'),'WW') -6) end WEEK_MIN_6
      6  from dual
      7  /
    WEEK   WEEK_MIN_6
    200501     200448
    SQL> Nicolas.

  • W_DAY_D is not getting Loaded with Enterprise WEEK or FISCAL week informati

    HI Experts,
    We have OBI Application 7.9.6.1 (FIN,SCM,PSA analytics application).
    We are using Oracle EBS 12.0.6 as the source system.
    we are using the Enteprise Calendar in EBS to load the W_DAY_D,but the W_DAY_D is not getting Loaded with Enterprise WEEK or FISCAL week informations,
    does any one have an answer to this question,how to load theEnterprise WEEK or FISCAL week information in the W_DAY_D table??
    We have raised an SR with Oracle Support & got the reply that this is a product BUG & they have internaly raised an Enhancement Request.
    God knows when this will be fixed??
    Can any one provide me with a work around ?/
    Thanks

    Hello:
    Please look at these W_MCAL_PERIOD_D, and W_MCAL_DAY_D Tables for Fiscal information. For more information you can look at the RPD BMM Layer Dim - Date Fiscal Calendar.
    With Regards,
    Mohan

  • Previous week Dates

    Hi all
    Please help in writing a query to get the previous week data.
    If the input date is sysdate then it should return values for previous week Monday to Sunday.
    Whatever the input it should get the value for previous week from Monday to Sunday.
    Thanks
    Jo

    IW is the formatter for the "Iso-Week"
    ISO = international standard organization
    See also: http://en.wikipedia.org/wiki/ISO_week
    Main thing is that it will always start with monday. The weeknumber might be different then for ww format. This doesn't matter in your case. But you migh want to do some experiments with to_char(sysdate,'IW'), to_char(sysdate,'WW').
    Trunc(<datevale>,'IW') will cut the date back to the first day of this iso-week.
    select to_char(sysdate-365,'IW') IW , to_char(sysdate-365,'WW') WW from dual;
    IW     WW
    37     36Edited by: Sven W. on Sep 9, 2010 2:29 PM

  • Custom Fiscal week table update

    Hi All,
    I am Basis person but was assigned a task to look into an issue one of the user was getting. Below is the issue
    We have a Info Object  ZFISCWEEK  which we were told by consultant that it pull from table ZFISWKTBL and has to be updated using SM30. Here are 2 issues we have
    1) All the entries in SM30 are not showing up when Fiscal week field is selected in Query Designer and try to add restrictions.
    2) Even after deleting all the entries from table ZFISWKTBL we are seeing some entries in Fiscal Week restrictions.
    I notice that the selection fields for Fiscal Week are coming from /BIC/RZFISCWEEK and this table is not having all the entries that are there in ZFISWKTBL table.
    Other than the Basis person which is me, we don't have any one else who know SAP, so any inputs to fix this issue will be very much helpful.
    Regards,
    Praveen

    Hi Ajay,
    We were updating table "ZFISWKTBL" using SM30 and not /BIC/SZFISCWEEK. I tried to run the steps as mentioned by you and I don't see option for Maintain Master data. I was only able to enter "ZFISCWEEK" as InfoObject and not the /BIC/**** and when I click on Display and don't see an option of Maintain Master Data. Under Extras I see Master data and under that I see Maintain but it is greyed out. So can you let me know if I am running the steps wrongly or what. In RSA1 I tried to delete Master data for ZFISWEEK Infoobject and I got error not all data is deleted, But I do see some of the stale entries in /BIC/SZFISCWEEK got deleted.
    Can you guide what else need to be done to get this done.
    Thanks,
    Praveen

  • Function module to get last fiscal week

    Hi Gurus,
    Can anybody give me the function module to go back to few fiscal weeks.
    For example ,
    if the current fiscal week is 2008030,
    I need to get the value 2008024.
    This can be done with ABAP code. But I am looking for function module.
    Thanks,
    Rajani.
    Points will be assigned.

    Hi Rajani,
    Please try this:
    REPORT Z_CAL_WEEK .
    DATA: Z_DATE TYPE SY-DATUM.
    DATA: Z_WEEK TYPE SCAL-WEEK.
    Z_DATE = SY-DATUM
    Z_DATE = Z_DATE - 42. "CORRESPONDING DATE 6 WEEKS in the past
    CALL FUNCTION 'DATE_GET_WEEK'
      EXPORTING
        DATE = Z_DATE
      IMPORTING
        WEEK = Z_WEEK.
          EXCEPTIONS
         DATE_INVALID       = 1
         OTHERS             = 2
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    WRITE :Z_WEEK.
    Regards
    Joe

Maybe you are looking for

  • How to download a file under link in FF?

    there is a 'save target as...' popup menu option in "big" firefox, which I use to skip default action for specific files. I.e. to download a pdf file to read it later instead of open it in acroread right now. How can I get the same function in mobile

  • Error when connecting to Portal logon screen...

    Hi, We have a problem logging on to our portal system. We changed the logon screen par file to add a graphic, this worked ok but we found a cosmetic error. We changed the logon screen par file again and now we get the error below. We have put back th

  • Mass Deletion of Sales Orders

    Hi Gurus,    I have some unused old sales orders which  affects the MRP run , to rectify this we want to delete or archieve the old SOs. How to do Mass deletion or Archieve the unused SOs? Kindly help to resolve . Thanks in Advance, Regards, Joseph

  • Email message continuity service

    Hi, I am looking for an email message continuity service to use if our facility losses power or internet service. I have found postini, but it does not work with syncronization to a mac mail server. I have also looked into symanteccloud (www.symantec

  • TO not getting created Automatically  for mvt 311

    Hi, I am facing issue while doing Stock transfer between 2 Sloc. TO is not automatically getting created once i do stock transfer in MB1B for mvt 311. I checked Tcode OMKX,OMKY,OMKZ, in  all of them "A" is maintained in Automatic TO field. Kindly let