YEAR function in BMM

Hi everybody!
I am facing strange problem in OBIEE (server version 11.1.1.6). Adding logical column to fact table, that is derived from existing column using following expression:
FILTER("TT#1"."FACT"."TICKET_NUMBER" USING  EXTRACT( YEAR  FROM "TT#1"."FACT"."DATEREG") = "TT#1"."FACT"."YEAR")
where data types are
"FACT"."TICKET_NUMBER" - INT
"TT#1"."FACT"."DATEREG" - DATETIME
"TT#1"."FACT"."YEAR" - DOUBLE
So, I want to compare registration date and year for every record in fact table, and if registration date is within a year, then my new logical column will contain corresponding ticket number.
It works fine in OBIEE Report until I execute consistency check in BMM. Then Oracle BI Administration Tool informs me that consistency check fixed certain objects, but no errors, warnings or best practice violations left to report. And after that my logical column is marked with "fx" and calculation expression is emptied.
If I compare YEAR function with constant instead of column - check consistency passes fine. Neither changing data type of "TT#1"."FACT"."YEAR" to integer, nor using cast function changes situation.
Where am I wrong?

Hi,
My OBIEE ver 11.1.1.5, As far as i know FILTER expression can only be used on Aggregate columns and is available only in Presentation.
example : FILTER ( SALES.QUANTITY USING(ORG.ORG_NAME = 'SILICON ASIA'))
The current scenario of Ticket Number is not a aggregate column so that will not work,and in BMM im not sure if you can use the FILTER expression.Try a CASE statement as a work around.
psuedo code
CASE WHEN
Year("TT#1"."FACT"."DATEREG_SET" )  = "TT#1"."FACT"."YEAR"
THEN
"TT#1"."FACT"."TICKET_NUMBER"
END
http://rampradeeppakalapati.blogspot.in

Similar Messages

  • Windowing function in BMM

    Hi,
    How can I perform the following windowing function in BMM?
    count(distinct EVENT_ID BY CLIENT_KEY)
    Thanks.
    Andy

    Hi,
    I was able to use the evaluate function that you suggested. However, I still couldn't get the result in report.
    Here is part of my logical layer (BMM):
    Dim - Time: TIME_KEY, ...
    Dim - Client: CLIENT_KEY, ...
    Fact - Encounters: # Visits ( i.e., count(distinct(EVENT_ID) )
    The above fact table contains foreign keys (TIME_KEY, CLIENT_KEY, etc.) to all dimension tables in the physical layer.
    My requirements:
    I need to generate a pivot report that has the following information:
    Rows: Translated categories based on # Visits (from Fact - Encounters; for example: 1-5, 6-10, ...)
    Columns: Fiscal Year (from Dim - Time)
    Measures: # distinct Clients (from Fact foreign key)
    Measures: Percentage of # distinct Clients (from Fact foreign key)
    Last Row: Average # distinct Clients in each of the Fiscal Year columns
    Somehow I could only get the correct measures when I used aggregation rule=count distinct for the CLIENT_KEY foreign key column in the "presentation layer". However, I know this is not the right way to count foreign keys in the presentation layer. Do you know the correct way to get to this report?
    Thanks.
    Andy

  • Year function reteives different values

    SELECT year(convert(date,'24-10-49',5)) --dd-mm-yy
    --2049
    SELECT year(convert(varchar(10),'24-10-49',5)) --dd-mm-yy
    --2049
    SELECT year(convert(date,'24-10-50',5)) --dd-mm-yy
    --1950
    SELECT year(convert(varchar(10),'24-10-50',5)) --dd-mm-yy
    --1950
    Do we have any range for year function or do SQL server shows values to only limited period??

    Hello Vishal,
    That depends on the "Two Digit Year Cutoff" of the SQL Server Setting, see
    http://msdn.microsoft.com/en-us/library/ms191004.aspx
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • MONTH and YEAR functions.  Please help...

    Can anyone tell me why the YEAR and MONTH functions will only accept the format dd-MMM-yyyy (ex. 01-JAN-2009)
    The calendar prompt will only retun the format dd/mm/yyy (ex. 01/01/2009). This renders the calender pretty useless.
    I am really in need of some help on this. Does anyone know how to get the value returned from the calendar in a prompt into a format that can be used by the YEAR and MONTH functions?
    Thank you in advance

    Hi,
    Can you do those things at DB Level.. addition of YEAR and MONTH columns to Table.. because doing CAST to DATE operation will work at DB Level..
    Ex: In Answers if you give YEAR(CAST('01-03-2009' AS DATE)), it is erroring out because default allowed date format of BI is different from the one specified.. Though it is issuing correct SQL which is working at DB level.. donno how to change the default format of BI..
    So, what I can suggest is an alternative, which is at DB level.. if it is apt for you.. then
    Following statement gives you YEAR value..
    TO_NUMBER(TO_CHAR( cast('01-03-2009' as DATE), 'yyyy'), '9999')
    This is the statement taken from Manage Session of BI..
    -Vency

  • Year Function

    Hi all !
    Is there any way(function) to find out a new year in sql / plsql ?
    Pls help me with a solution ..
    Thanks and Regards
    user 10685325

    Hi !
    Thanks for ur replies ..
    For testing purpose, i created a procedure in sql editor. .the coding i used is
      1  CREATE OR REPLACE PROCEDURE bal_up (cl IN VARCHAR2) AS
      2   BEGIN
      3      UPDATE bal_assign set existing_balance = 8 WHERE leavetype =  cl;
      4*   END bal_up;
      5  /
    Procedure created.
    SQL> call bal_up('Casual Leave');This is working.. In order to schedule the job, i tried using the following codings, which gave me the corresponding errors shown
    SQL>
      1  declare
      2     l_job number;
      3  begin
      4     dbms_job.submit( l_job,
      5                   call bal_up('Casual Leave');,
      6                      add_months(trunc(sysdate,'YEAR'),0)+16.05/24);/*Here i have added '0' instead of '12' for testing*/
      7* end;
      8  /
                     call bal_up('Casual Leave');,
    ERROR at line 5:
    ORA-06550: line 5, column 23:
    PLS-00103: Encountered the symbol "BAL_UP" when expecting one of the followin
    . ( ) , * @ % & | = - + < / > at in is mod remainder not
    range rem => .. <an exponent (**)> <> or != or ~= >= <= <>
    and or like LIKE2_ LIKE4_ LIKEC_ between || multiset member
    SUBMULTISET_
    The symbol "." was substituted for "BAL_UP" to continue.
    ORA-06550: line 5, column 45:
    PLS-00103: Encountered the symbol ";" when expecting one of the following:
    . ( ) , * % & | = - + < / > at in is mod remainder not range
    rem => .. <an exponent (**)> <> or != or ~= >= <= <> and or
    like LIKE2_ LIKE4_ LIKEC_ betwee
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2     l_job number;
      3  begin
      4     dbms_job.submit( l_job,
      5                 'bal_up('Casual Leave');',
      6                      add_months(trunc(sysdate,'YEAR'),0)+16:20:00/24);/*Here i have added '0' instead of '12' for testing*/
      7* end;
      8  /
    SP2-0552: Bind variable "20" not declared.
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2     l_job number;
      3  begin
      4     dbms_job.submit( l_job,
      5                 'bal_up('Casual Leave');',
      6                      add_months(trunc(sysdate,'YEAR'),0)+17/24);/*Here i have added '0' instead of '12' for testing*/
      7* end;
      8  /
                   'bal_up('Casual Leave');',
    ERROR at line 5:
    ORA-06550: line 5, column 25:
    PLS-00103: Encountered the symbol "CASUAL" when expecting one of the followin
    ) , * & | = - + < / > at in is mod remainder not rem => ..
    <an exponent (**)> <> or != or ~= >= <= <> and or like LIKE2_
    LIKE4_ LIKEC_ between || multiset member SUBMULTISET_
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2     l_job number;
      3  begin
      4     dbms_job.submit( l_job,
      5                 'bal_up(Casual Leave);',
      6                      add_months(trunc(sysdate,'YEAR'),0)+17/24); /*Here i have added '0' instead of '12' for testing*/
      7* end;
      8  /
    declare
    ERROR at line 1:
    ORA-06550: line 1, column 107:
    PLS-00103: Encountered the symbol "LEAVE" when expecting one of the following
    . ( ) , * @ % & | = - + < / > at in is mod remainder not
    range rem => .. <an exponent (**)> <> or != or ~= >= <= <>
    and or like LIKE2_ LIKE4_ LIKEC_ as between from using ||
    multiset member SUBMULTISET_
    The symbol "." was substituted for "LEAVE" to continue.
    ORA-06512: at "SYS.DBMS_JOB", line 79
    ORA-06512: at "SYS.DBMS_JOB", line 136
    ORA-06512: at line 4Pls help to overcome this ..
    Thanks and Regards
    user 10685325

  • Year Function output

    I am using this query to get a list of years greater then 2009, but the format is coming back as 2,009. Any idea how to change this format?
    SELECT distinct(year(F_OPPORTUNITY.ESTIMATEDCLOSEDATE)) DT_RANGE FROM "TNS-CRM-DWH" where year(F_OPPORTUNITY.ESTIMATEDCLOSEDATE) > 2009

    try this...
    SELECT distinct(cast(year(F_OPPORTUNITY.ESTIMATEDCLOSEDATE) as int)) DT_RANGE FROM "TNS-CRM-DWH" where year(F_OPPORTUNITY.ESTIMATEDCLOSEDATE) > 2009

  • Year and Month calculation

    Hi
    I have created a report with two prompts, they are "Enter Start date:" and "Enter End date:" where i take date values from a calendar while prompting.
    For example:
    Start date = 10/11/2003
    End date = 10/10/2003
    If i want to display the End date means, i ll use UserResponse("Enter End Date:") in the webi reports. What should i do to calculate Year and Month from this user response value,
    i used these calculations below, but it is not working, showing me #ERROR message.
    1) ToDate(UserResponse("Enter End Date:");"dd/MM/yyyy")     =  #ERROR
    2) FormatDate(ToDate(UserResponse("Enter End Date:");"dd/MM/yyyy");"dd/MM/yyyy")     = #ERROR
    3) Year(UserResponse("Enter End Date:")   = The expression or sub-expression at position 6 in the 'Year' function uses an    invalid data type. (WIS 10037)
    4) FormatDate(ToDate(UserResponse("Enter End Date:");"dd/MM/yyyy  hh:mm:ss A");"MM/dd/yyyy") =#ERROR
    so help me how to get the year and month values from prompts ?
    Thanks
    Dineshkumar

    to get the Month Value and year value in Webi
    month name
    =Month(ToDate(UserResponse("Enter End Date:");""))
    month number of the year
    =MonthNumberOfYear(ToDate(UserResponse("Enter End Date:");""))
    to get the Year Value
    =Year(ToDate(UserResponse("Enter End Date:");""))
    good luck

  • Function Calendar not working in OBIEE 11G - Analysis

    This code works in 10.1.3 but not in OBIEE 11.1.1, Please let me know the correct code.
    Error: Query Failed: [nQSError: 22025] Function Calendar Extract is called with an incompatible type
    case when "- Calendar"."Year" = YEAR('@{var_date}{2012-11-05}') then 'Current' Else 'Prior' end

    Check the data type of the column being used to populate the variable. The Year Function works fine. I suspect the data type is not date. If you don't have date columns in your database and are creating one (ex., using MM, DD, YYYY columns explicitly)then check the default date format in your environment either double click the physical database folder -> features or in your NQSconfig. it should be in date data type.

  • Change of Financial Year End

    Hi Experts
    We have been advised that we will be changing our financial year (currently July to June) to tie in with our new acqusition companies fiscal year, which runs from January to December.This will be done with effect from end June 2012.
    Consequently, we will be running a 6 month 2012 fin year (July to December 2012) and then properly aligning with the 2013 fin year from January 2013.
    We have SAP version ECC6 without Flex General Ledger. 
    Two approaches have been identified by our consulting company :
    One approach is to make use of the shortened fiscal year functionality. This would allow us to create a shortened FY2013 of only 6 months, which would run from July 2012 to December 2012.The next Fiscal Year would then start in January 2013 and run to December, as required.The only drawback is that the shortened fiscal year would have to be FY2013, although it ends in December 2012, and that going forward, the FY would always be 1 year ahead of the actual calendar year. There is a further impact, in Fixed Assets, the shortened fiscal year will need to maintain a small bit of config, (OAYP) where we stipulate that the depreciation for the shortened year needs to be reduced to match the shortened length of the year.  Also in using the shortened fiscal year approach there is also apparently a couple of SAP notes  that they will need to apply to ensure that the asset depreciation is correctly calculated during the shortened year.
    In the other alternative  the u201Cnew and correctu201D Fiscal years are created and linked to new Company Codes.  All financial transactions are then posted in the new companies from period one of the new Fiscal year.
    The closing balances of old companies are posted as opening balances for the new Companies. 
    Some of the other implications are:
    The Profit Centers must be opened in the new companies.
    The stock must be transferred to the new companies.
    The open Purchase orders must be u201Cconvertedu201D to the new companies or new Purchase Orders must be created.
    The Fixed Assets must be transferred to new companies.
    The Controlling Area might be impacted.
    To be able to do Comparison reports we should do a history take on. (This can only be monthly movements per profit center per GL-Account, converted to the new Fiscal periods.)
    Experts, are there any other options that are worth persueing with the least business impact ? Please help, your advise will be highly appreciated.

    If you do not prefer to create new company codes and undergo a conversion effort, you can go with the first alternative and then engage SAP SLO services to replace the shortened fiscal year 2013 in your system to the correct fiscal year.  That way, your next fiscal will remain 2013, and your fiscal year will not be always 1 year ahead of your actual fiscal year.
    Please also read the following SAP note.  There is a lot of material to read in the attachments to this note, but the time that you spend reading it is time well spent.
    https://service.sap.com/sap/support/notes/672255

  • Non-functioning Clone Tool

    Running Photoshop CS3 on Windows XP Professional 160GB; 77GB Free
    All of a sudden after more than a year functioning fine my clone stamp tool stopped working. Everything else is working fine. I reinstalled CS3 and the tool worked fine then, after a reboot, it stopped working again.
    I am not supertech knowledgeable, so other than running a complete scan with my anti-virus program and a Windows Defender scan, neither of which identified any problems, I'm at a loss.
    I'd be grateful for any ideas.

    So, an artist here just encountered this problem on a Mac running 10.4.11. None of the suggested fixes seemed to help her, but I was able to "reboot" the clone tool by launching the System Prefs->Wacom Tablet and tinkering around in there a bit.
    To be honest, I am not sure exactly which part of my tinkering was successful. She had 2 tablets listed, even though one is the an old one that she no longer uses and also 2 grip pens listed. I deleted the extra copy of each, clicked with the grip pen a couple times to make sure the tablet that was hooked up was still functional and then quit system prefs. Upon returning to PS, everything was running smoothly again...
    At any rate, it might be something to check.
    BTW, disconnecting/reconnecting the Wacom from the USB chain had no effect. Tried that first.

  • How do I count the number of times a particular year occurs in a range of dates?

    One column in my spreadsheet is a date and time.  I want to be able to count how many times a particular year occurs.
    Is there a way to combine the COUNTIFS and YEAR functions, or is there something easier to use?
    I'm using Numbers '09.
    Thank you for your assistance.

    You could use COUNTIFS with the two conditions being ">="&DATE(year, 1,1) and "<"&DATE(the next year, 1,1)

  • Cast and Concat functions error

    Hi
    I am getting below errors while doing cast and concat
    The error message is nQSError: 22020] Function Concat does not support non-text types.
    and my concat code is
    CAST (cast(day(current_date) as char)||'-'||month(current_date)||'-'||cast(year(Core."Dim - Date"."Date") as char) AS DATE )
    Error when tried it differently [nQSError: 27002] Near <)>: Syntax error [nQSError: 26012] .
    CAST (concat(cast(day(current_date) as char)||'-'||month(current_date)||'-'||cast(year(Core."Dim - Date"."Date") as char)) AS DATE )
    Please suggest.

    Hi,
    CASE WHEN Core."Dim - Date"."Year" = 'year(current_date)' THEN FILTER( AGO(Core."Fact - Spend and AP Invoice Distribution"."Spend YTD", Core."Date"."Year", 1)
    USING Core."Dim - Date"."Date" = VALUEOF(NQ_SESSION."R_Current_Date")) WHEN Core."Dim - Date"."Year" <> 'year(current_date)' THEN FILTER( AGO(Core."Fact - Spend
    and AP Invoice Distribution"."Spend YTD", Core."Date"."Year", 1) USING Core."Dim - Date"."Date" = CAST ( TRIM(BOTH ' ' FROM CAST ( EXTRACT( DAY FROM CURRENT_DATE )
    AS CHARACTER ( 30 ))) || '/' || TRIM(BOTH ' ' FROM CAST ( EXTRACT( MONTH FROM CURRENT_DATE ) AS CHARACTER ( 30 ))) || '/' || TRIM(BOTH ' ' FROM
    CAST (Core."Dim - Date"."Year" AS CHARACTER ( 30 ))) AS DATE )) ELSE 0 END
    Here I have taken this part of the code from above code and started testing from answers
    CAST ( TRIM(BOTH ' ' FROM CAST ( EXTRACT( DAY FROM CURRENT_DATE )
    AS CHARACTER ( 30 ))) || '/' || TRIM(BOTH ' ' FROM CAST ( EXTRACT( MONTH FROM CURRENT_DATE ) AS CHARACTER ( 30 ))) || '/' || TRIM(BOTH ' ' FROM
    CAST (Core."Dim - Date"."Year" AS CHARACTER ( 30 ))) AS DATE )) ELSE 0 END
    what I could make out is when I was casting it to date I was getting the error
    ORA-01830: date format picture ends before converting entire input string at OCI call OCIStmtExecute:
    So When I have casted it to char and removed the year function from concatenation it worked out.
    With the same idea I have used this part of the code in my main code above but here char was not working out, so I need to use date and there were no compilation
    errors as it used to be before.
    CASE WHEN Core."Dim - Date"."Year" = 'year(current_date)' THEN FILTER( AGO(Core."Fact - Spend and AP Invoice Distribution"."Spend YTD", Core."Date"."Year", 1)
    USING Core."Dim - Date"."Date" = VALUEOF(NQ_SESSION."R_Current_Date")) WHEN Core."Dim - Date"."Year" <> 'year(current_date)' THEN FILTER( AGO(Core."Fact - Spend
    and AP Invoice Distribution"."Spend YTD", Core."Date"."Year", 1) USING Core."Dim - Date"."Date" = CAST ( TRIM(BOTH ' ' FROM CAST ( EXTRACT( DAY FROM CURRENT_DATE )
    AS CHARACTER ( 30 ))) || '/' || TRIM(BOTH ' ' FROM CAST ( EXTRACT( MONTH FROM CURRENT_DATE ) AS CHARACTER ( 30 ))) || '/' || TRIM(BOTH ' '
    FROM CAST (Core."Dim - Date"."Year" AS CHARACTER ( 30 ))) AS DATE )) ELSE 0 END
    Now when I check results in reports. I get the error ORA-01830: date format picture ends before converting entire input string at OCI call OCIStmtExecute
    The problem here happening is
    Core."Dim - Date"."Date" data type is DATETIME
    and the concat string whole date type is DATE.
    Its like datetime=date
    Since becuase of this mismatch I assume I am getting this error.
    So I thought of changing the data type of Core."Dim - Date"."Date" data type in rpd. Even though I checked out to do the changes I am unable to do though I login with
    Admin account.
    Secondly I thought of changing the concat string whole date type to DATETIME then I get the syntax error.
    Any help on this would be much appreciated.
    Thanks.
    Edited by: 949675 on May 7, 2013 5:33 AM

  • Unable to insert break on Year object

    Hi,
         I am trying to insert break on Year object, trying to create a new variable using 'Year' function on 'start_date' but getting error as 'Incorrect Datatype'.
    The Year function is working fine for Today 'Year(<Today>)'--- no error
    Have tried different formats for date(mm/dd/yyyy, standard, number).
    The data provider is excel.
    Regards,
    Aparna

    Hi Aparna,
    I Tried this at My End and Itu2019s working Fine with strange Behavior..
    The  Data I used in Excel is : Format for Start_date I used is Date: *3/14/2001
    In DESKI I used your Format mm/dd/yyyy
    Year     Start_date     Resort     Sales revenue
    2001     5/12/2005     ABC     123456
    2001     6/16/1999     GHJ     45578
    2001     1/15/2000     TYU     45321
    2002     2/15/2006     DEF     789654
    2003     6/12/1996     GHI     456789
    2004     7/19/2009     JKL     128456
    2005     12/12/1998 MNO     123658
    2006     9/24/1984     PQR     784521
    I Came Across Very Strange Behavior.
    Strange Behaviopur 1:
    When I unchecked the Option u201CFirst Row Contains Column Namesu201D Data Provider contains Data as Present in the Excel Sheet ( No timestamp to the Start_date). Here while finding Year from
    Year( Start_date) I got the Error.
    Strange Behavior 2:
    When I Checked the Option u201CFirst Row Contains Column Namesu201D Data Provider contains Start_Date Column in Excel with Time (Adds Time Stamp to the  Start_Date column).
    When I run this Report DESKI automatically inserts variables of Dimension type  Year(Start_Date), Month(Start_date), Quarter(Start_date) I checked this on different  Patches but same behavior. Fix Pack 2.3 ,3.1 ,3.5
    Here when you use year (Start_date) to Extract Year it works Perfect. And You can Put Break on this also.
    So use the Function Year(Start_date) as I mentioened in first  Behavior and delete all other Variables automatically created  using Data-> Variables
    Please check this at your End how it worksu2026.
    I Hope this Helpsu2026.
    Thanksu2026
    Pratik

  • Sorting albums by year doesn't work properly in new iTunes 11.

    Sorting albums by year doesn't work properly in new iTunes 11.
    See the screenshots below.
    There's a kind of albums. Double CD in one set. Queen "The Works" 1984, for example.
    First CD is the original release and the second one is bonus CD for the original album's reissue in 2011.
    iTunes 10 took year info from track 1 of CD1 for "sort album by year" function.
    But new iTunes 11 takes the highest value of year in the album's track list.
    Same things with additional bonus tracks for the album's reissues.
    See the screenshot of Madonna "Like a Virgin" 1984 album.
    So my collection is in a huge mess after last update to iTunes 11.
    It's a big problem. And must be solved to the next update.

    I noticed this too, and I think it gets even more complicated when you think about the difference between how you want Re-releases to be ordered: based upon the intial release year (like you have described above), and Compilations or Greatest Hits: where you want them to be sorted by when the albums were actually released. iTunes 11 seems to just grab the date of the most recently released song on an album. This worked fine for 2/3 of my Compilation albums, because they just happened to be released the same year as the latest song on each album.
    Compilation example (released: 2003, latest song on album: 1969):
    This is what I submitted to Apple as feedback:
    This issue is actually aimed at  iTunes 11, but 10.6.3 is the most recent version number I could select in the drop-down menu.
    As with normal albums, iTunes 11 puts a release year next to "Various Artists" in Albums > Expanded View (and also in the Songs and Genre Tabs). However, iTunes seems to produce this number by looking for the last released song on the album. This has worked fine for 2/3 of my compilations, but the third one is a 60s compilation released in 2003. It displays "1969" next to "Various Artists" and there are no tags available in Get Info to change this. This also happens to greatest hits collections.
    When selecting View > View Options > "Artist" then "Year" in Album view, and View > View Options > "Year" in Artist and Genre view, the above issue causes compilations, greatest hits collections, and re-releases (Although users may want re-releases to be listed in order of original release) to be sorted in the wrong order.
    Considering iTunes 11 has added this feature (in previous iTunes versions, "Year" would only appear next to individual tracks), it is a shame an "Album Year" or "Sort Album Year" hasn't been added to the Get Info options.
    As is, the only solution I can think of is to change all track years to the release year of the album.
    I imagine this might be a bit of an edge case, and not something the majority of iTunes users would care about, but then again, I could imagine a fair number of musicphiles wanting control over this metadata.
    Message was edited by: folo1988, info added.

  • How to get fiscal period based on date and Fiscal year?

    Hi Guys,
               Can anybody tell me how to get Fiscal period based on date and Fiscal Year or fiscal year variant?
    Thanks,
    Gopi.

    Hi,
    Please refer the code below:
    *: Report:  ZFISCALYR                                                  :
    *: Date  :  2004                                                       :
    *: Description: Demonstrates how to return the corresponding fiscal    :
    *:              year and posting period for a company code and posting :
    *:              date or posting date and fiscal year variant.          :
    REPORT  zfiscalyr NO STANDARD PAGE HEADING.
    TABLES: ekko.
    PARAMETERS:     p_bukrs TYPE ekko-bukrs,
                    p_bedat TYPE ekko-bedat.
    DATA: gd_fiscalyr  TYPE bapi0002_4-fiscal_year,
          gd_fiscalp   TYPE bapi0002_4-fiscal_period.
    DATA: gd_fiscalyr2 TYPE T009B-BDATJ,
          gd_fiscalp2  TYPE bapi0002_4-fiscal_period.
    DATA: gd_periv     TYPE t009-periv.
    *START-OF-SELECTION.
    START-OF-SELECTION.
    * get fiscal year and period - (requires date and company code)
      CALL FUNCTION 'BAPI_COMPANYCODE_GET_PERIOD'
        EXPORTING
          companycodeid = p_bukrs
          posting_date  = p_bedat
        IMPORTING
          fiscal_year   = gd_fiscalyr
          fiscal_period = gd_fiscalp.
    * Alternative fiscal year function module
    * - (requires date and fiscal year variant code from T009 table)
    * gets first entry in fiscal year variant table (will need to choose
    * correct one from table rather than just using first entry)
      SELECT SINGLE periv
        FROM t009
        INTO gd_periv.
    * get fiscal year and period
      CALL FUNCTION 'DETERMINE_PERIOD'
        EXPORTING
          date                      = p_bedat
    *    PERIOD_IN                 = '000'
          version                   = gd_periv
       IMPORTING
          period                    = gd_fiscalp2
          year                      = gd_fiscalyr2
       EXCEPTIONS
          period_in_not_valid       = 1
          period_not_assigned       = 2
          version_undefined         = 3
          OTHERS                    = 4.
    *END-OF-SELECTION.
    END-OF-SELECTION.
      WRITE:/ 'From function module: BAPI_COMPANYCODE_GET_PERIOD',
            / 'Fiscal year is:', gd_fiscalyr,
            / 'Fiscal period is:', gd_fiscalp.
      SKIP.
      WRITE:/ 'From function module: DETERMINE_PERIOD',
            / 'Fiscal year is:', gd_fiscalyr2,
            / 'Fiscal period is:', gd_fiscalp2.
    Thanks,
    Sriram Ponna.
    Edited by: Sriram Ponna on Apr 17, 2008 8:59 PM

Maybe you are looking for

  • Is there a way to run a power pc based application in Lion?

    MyAkai  sampler's USB editor software, 'AkaiSys' won't run since i upgraded my macbook pro to OSX Lion. An alert says that powerpc apps are no longer supported. Can i get around this without reverting back to Snow Leopard?

  • IFS Document Search

    Hi , I'm new on IFS and trying to do something that I supposed it's quite simple but not having too much luck.. I'm performing a search (using the web interface) on the document content and getting correct results. I'd like to be able to when I open

  • Spotlight can't be trusted? Cant find in ~/Music...

    Hey everyone, Tried to do a quick search in the Finder for a folder in my iTunes Music folder. I was looking to see if I had an artist's album without opening up iTunes (which is still pretty slow). Anyway, neither the Spotlight menu search nor a Fin

  • Need Help with Installing AP 1250

    I am installing AP 1250 with wireless client authenticating to radius server running on MS ISA server.   The users are supposed to be authenticating with AD.  So far I have been running into problems and unable to get any user connected via Wireless

  • Migrating from Git to TFS 2013

    Hi, I have TFS 2013 and want to migrate GIT source code to TFS. I was able to migrate the code with history but want to ask for a way where by I can keep branches also intact. I want to give away from GIT and want to use Git support from TFS itself.