Fiscal period to calender month FM

Hi Friends,
    Is there any function module to pass the fiscal period and fiscal year value and get calender date, month and year.
Thanks & Regards,
Vallamuthu.m

Hi,
There are FMs for fetching first and last day of fiscal period.
* This Function Module will get Start date based on the Period, Year and
* Fiscal Year Variant
  CALL FUNCTION 'FIRST_DAY_IN_PERIOD_GET'
    EXPORTING
      i_gjahr        = rlv_gjahr
      i_periv        = rlv_periv
      i_poper        = rlv_poper
    IMPORTING
      e_date         = lv_mfdate
    EXCEPTIONS
      input_false    = 1
      t009_notfound  = 2
      t009b_notfound = 3
      OTHERS         = 4.
* This Function Nodule will get End date based on the Period, Year and
* Fiscal Year Variant
  CALL FUNCTION 'LAST_DAY_IN_PERIOD_GET'
    EXPORTING
      i_gjahr        = rlv_gjahr
      i_periv        = rlv_periv
      i_poper        = rlv_poper
    IMPORTING
      e_date         = lv_mldate
    EXCEPTIONS
      input_false    = 1
      t009_notfound  = 2
      t009b_notfound = 3
      OTHERS         = 4.
Ganga

Similar Messages

  • How to create the above Fiscal period & Client Calender

    Hi All,
    I want to create Client Factory Calendar in BI System.
    Source is MS SQL DB(UD Connect) not ECC.
    I got the below information from the Business Group:
    For the moment we need to implement the Client Calendar. So periods should be according to Client Fiscal Periods. We do not need to implement public holidays, as they donu2019t affect periods.
    Client periods always contain complete weeks, starting Monday, finishing Sunday. Periods contain the following number of weeks: 5-4-4-5-4-4-5-4-4-5-4-4.
    Please calsri fy the below:
    >> Holiday calender is not required. but w/o holiday calender how we can define Factory calendor? Is it possible?
    >> How to define the fisacl periods?.
    >> When can we use these fiscal periods in the Factory Calender?.
    Please provide me step wise procedures..how to create the above Fiscal periods & Client Calender.
    Thanks in advance,
    Sri.

    hi siri.
    please go though these links
    calendar
    difference b/n Factory Calendar and Public Holiday Calendar
    hope this will help u.
    thanks

  • Re: Fiscal period to calender year

    Hi Experts,
    Please can ayone shed light on how to convert fiscperiod to calender year.If there is a routine please do give me the code.
    Regards
    Madhu

    Hi Anil,
    Thanks for the solution. Do we really need to sort the table it_tab.Can you tell whether the following code i wrote is the one you  mentioned.
    Please find whether the following code in startroutine and update routine is fine.
    PROGRAM UPDATE_ROUTINE.
    $$ begin of global - insert your declaration only below this line  -
    DATA: BEGIN OF it_tab OCCURS 0,
          BDATJ  LIKE T009B-BDATJ,
          BUMON  LIKE T009B-BUMON,
          POPER  LIKE T009B-POPER,
          PERIV  LIKE T009B-PERIV,
          END OF it_tab.
    $$ end of global - insert your declaration only before this line   -
    The follow definition is new in the BW3.x
    TYPES:
      BEGIN OF DATA_PACKAGE_STRUCTURE.
         INCLUDE STRUCTURE /BIC/CSu2019myinfosource nameu2019.
    TYPES:
         RECNO   LIKE sy-tabix,
      END OF DATA_PACKAGE_STRUCTURE.
    DATA:
      DATA_PACKAGE TYPE STANDARD TABLE OF DATA_PACKAGE_STRUCTURE
           WITH HEADER LINE
           WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.
    FORM startup
      TABLES   MONITOR STRUCTURE RSMONITOR "user defined monitoring
               MONITOR_RECNO STRUCTURE RSMONITORS " monitoring with record n
               DATA_PACKAGE STRUCTURE DATA_PACKAGE
      USING    RECORD_ALL LIKE SY-TABIX
               SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
      CHANGING ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update
    $$ begin of routine - insert your code only below this line        -
    fill the internal tables "MONITOR" and/or "MONITOR_RECNO",
    to make monitor entries
    select * from T009B into corresponding fields of
      table it_tab. * if abort is not equal zero, the update process will be canceled
      ABORT = 0.
    $$ end of routine - insert your code only before this line         -
    ENDFORM.
    my update routine-------
    ROGRAM UPDATE_ROUTINE.-----calender year in update routine
    $$ begin of global - insert your declaration only below this line  -
    DATA: BEGIN OF it_tab OCCURS 0,
          BDATJ  LIKE T009B-BDATJ,
          BUMON  LIKE T009B-BUMON,
          POPER  LIKE T009B-POPER,
          PERIV  LIKE T009B-PERIV,
          END OF it_tab.
    $$ end of global - insert your declaration only before this line   -
    FORM compute_key_field
      TABLES   MONITOR STRUCTURE RSMONITOR "user defined monitoring
      USING    COMM_STRUCTURE LIKE /BIC/CS8YPSC_02
               RECORD_NO LIKE SY-TABIX
               RECORD_ALL LIKE SY-TABIX
               SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
      CHANGING RESULT LIKE /BIC/VYCSI_002T-PROFIT_CTR
               RETURNCODE LIKE SY-SUBRC
               ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update
    $$ begin of routine - insert your code only below this line        -
    fill the internal table "MONITOR", to make monitor entries
      clear it_tab.
      READ TABLE it_tab WITH KEY
               POPER =  COMM_STRUCTURE-POPER.
               PERIV =  COMM_STRUCTURE-PERIV.
      RESULT = it_tab-BDATJ.
    if the returncode is not equal zero, the result will not be updated
      RETURNCODE = 0.
    if abort is not equal zero, the update process will be canceled
      ABORT = 0.
    $$ end of routine - insert your code only before this line         -
    ENDFORM.
    If this is okay i will go ahead.The table t009B has four keys--why do we need to sort the internal table. is it not sufficient if we do a read on it directly after being filled in start routine.
    Kindly advice. I will assign you all the points.
    Regards
    Madhuri

  • V3 Fiscvar to Calender months

    Please see this scenario
    I have data coming from my ODS into a cube. The data is based on periods (ie no date). My reporting requirements are monthly.
    I woudl like to leave the ODS alone but create a time conversion from the update rules to convert from Period to Calender Month. I have tried using the FISCPER_CALMONTH in the update rules but i keep getting an error saying Formula element is not allowed here in the section where I put the year.
    Is there any other way for this to be done?
    I would also like the 4 special periods to be considered.
    Thanks

    Hi,
    I donot understand why are you using the Year in that formula .You need to use <i>Fiscal year period</i> time characterstic (may be use need to use Fiscal year variant also) in that update rule formula.
    With rgds,
    Anil Kumar Sharma .P

  • Option to show values up to last closed fiscal period or up to current date

    Hello,
    How would I create a query that would ask if I want it to calculate values 'up to the current date' or for the 'latest closed fiscal period'.
    Currently I have setup a report, within which, has restricted key figures that will give the 'Period to date', 'Year to Date', and 'Last Year Year to Date' values for some RKFs, however, it would be very helpful if this report could be setup so that the user could choose whether the report provides:
    1. Values only through the last closed fiscal period
    or
    2. Values up to the current date.
    <b>For example</b> if we are in period 7 of 2006, the user could have the report show all values up to the last closed fiscal period, which in this case would be period 6 of 2006.
    Or the user could have the report show all the values up to the current date.
    Hopefully I have been clear,
    Thanks,
    Nick
    Message was edited by:
            Nick Bertz

    Nick,
        What is the problem you are facing? As San mentioned you can only report till Last Fiscal Period using Customer Exit Variables(Calculate Current Fiscal Period using Current Month and Fiscal Year Variant).
    Or as you mentioned you can create restricted Key Figures using Date or month (YTD etc)
    If i miss your requirement, please guide me.
    Regards,
    Nagesh Ganisetti.
    *Assign Points if it helps.

  • How to get total number of days in current Fiscal period/year

    Hi,
    I need to get total number of days in current Fiscal period/year (current month) and assign it to an infoobject. I need a routine for this. Is there any function module to get this.If possible pls paste the ABAP code also for this task. Thanks in advance

    here is the FM:
    LAST_DAY_IN_PERIOD_GET
    KJ!!!

  • Fiscal Period is not working on weekly level

    Hello,
    I am building this query where users can use the fiscal period on the weekly level. We do have weekly variant maintained in 0fiscvarnt. Problem is every time I execute the query on weekly level its doesnt not bring in any data but if I execute the query on period level, it brings in tons of data.
    Example: if I execute the query with the following setting it would not bring in any data.
    Fiscal period: 001/2008 - 052/2008
    fiscal period variant: AB (weekly based, 001 - 053)
    If I execute the with following settings it would bring lots of data.
    Fiscal Period: 001/2008 - 012/2008
    Fiscal period variant: YZ (Month based, 4-4-5)
    Addition to that, there is no data available in the cube for fiscal variant:AB (weekly based).
    Any suggestion would be appreciated.
    Thanks,

    Khalid
    what you can do is :
    For reporting based on fiscal month periods create a cube and populate it.
    Put in the time dimension all 0Fisc* infoobjects.
    Do the same for weeks.
    So --> 2 cubes : one with fiscal variant month, the other with weeks.
    let's say Cubefiscweek and Cubefiscmonth
    In order to convert to fiscal periods base on a date you have some standard function like date_to_period_convert.
    For example you have the day of transaction purchasing or sales take the date and convert it in the transformation with a routine.
    One important setting :
    Make sure you retrieved the global settings form source system regarding the fiscal periods.
    Maintain the fiscal variant in tx ob29 or gvar for the week variant and the month variants.
    Maybe this tasks is already done in source system so you just need to recover the global setting in BW.  Check if tables T009x are maintained (the one that is important is t009b)
    If they are not maintained ask a functional to give the repartition.
    regards
    Boujema

  • Problem with a new fiscal period

    Hello everybody,
    I got strange behaviour with my program. But first of all let me tell you that I got SAP BOne ver. 2005A SP.1 PL46, and I got fiscal period divided in month
    My program that in 2009 worked fine, but in 2010 dosn't work at all. I don't know if is related to the new fiscal period or the new series.
    The program is pretty simple, for every invoice with a commission it create a Vendor Invoice in the OPCH. So that means that I created all the agents as vendor BP. So for instance for an invoice of 50'000u20AC it create to a Supplier Service Invoice of 1'500 to that agent.
    I made test with the TaxDate in order to be sure that was related just to the 2010 fiscal period but still failed.
    Any idea why?
    Thank you
    Roberto

    Hello Roberto,
    Check the following thread Get the Current Period
    You will find out everything about series, and config of series (probably the period indicatior of your new series!)
    Regards,
    J.

  • Customer exit code to populate three month's fiscal period

    Dear frns,
    I need an ABAP customer exit code to populate three month's fiscal period.
    Please update on this...thanks
    Cheers! Shana

    Dear,
    Thank u for all replies.
    My requirement is simple.
    Rows:
    Fiscal Year
    Columns
    GR Value
    Filters
    Material Number
    Input Paramters:
    Material No.
    Fiscal Year
    Using customer exit if we populate current fiscal year in the selection screen output be like this....
    FISCAL YEAR    GR Value(in crores)
    2009                     4000
    2008                     3000
    2007                     2000
    2006                     1000
    The cube name Custom Cube ZBBP_C03.
    But I dont have time char 0FISCYEAR in my Cube.In my cube avaiable chars are Calender Year,Calender Year/Month,Calender Year/Quarter,Fiscal Period
    Please let me know if you need any information.
    Waiting for replies,
    Thanks & Regards,
    Praveen.K

  • Customer exit code to populate fiscal period for prior three months

    Dear frns,
    I need an ABAP customer exit code to populate prior three month's fiscal period.
    Please update on this...thanks
    Cheers! Shana

    Hi
    Here is the code that will satisfies ur condition.
    CASE I_VNAM.
    IF I_STEP = 2.
    WHEN 'ZVAR1'.
    DATA DATE1 TYPE D.
    DATA PERIOD1 TYPE N.
    DATE1 = SY-DATUM.
    CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'.
    exporting
    l_date = date1
    l_periv = 'v3'
    importing
    E_BUPER = PERIOD2
    E_GJAHR = YEAR2.
    DATA PER3 TYPE N.
    PER3 = PERIOD2 + 1.
    CONCATENATE YEAR2 PERIOD2 INTO FPERLOW.
    DATA LDATE TYPE D.
    LDATE = SY-DATUM + 365.
    CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'.
    exporting
    l_date = LDATE
    l_periv = 'v3'
    importing
    E_BUPER = PERIOD2
    E_GJAHR = YEAR2.
    CONCATENATE YEAR2 PERIOD2 INTO FPERHIGH.
    DATA WA1 LIKE LINE OF E_T_RANGE.
    WA1-LOW = FPERLOW.
    WA1-HIGH = FPERHIGH.
    WA1-SIGN = 'I'.
    WA1-OPT = 'BT'.
    APPEND WA1 TO E_T_RANGE.
    ENDIF.
    Hope u gotit,
    Regard,
    RaviChandra

  • Issues with statistical modeling in calendar months vs 13 fiscal periods

    In our demand planning, we plan at the fiscal period level (13 fiscal periods across a year - not matching with calendar months or year).  We are having issues (strange results) trying to run the statistical modeling at the fiscal period level versus the calendar month level.  Is there a way to run the stat modeling over fiscal periods rather than calendar months?  Can we run stat modeling over a specific date range rathn than including the current month?

    Hi Stephen, I guess I can assume the following:
    1) In the master forecast profile, you have maintained the period indicator and the fiscal year variant
    2) You are choosing a forecast strategy in univariate profile (?) that makes use of seasonality, and you are trying to maintain the number of periods in a season as 13 (in our case, our periods are custom, but there are still 12 periods, so different from your case)
    3) Your history horizon in master forecast profile is more than the number of periods in the season i.e. history has more than 13 periods of data
    If above things are already done and you still face issue when you try to use 13 periods in a season, looks to me like a SAP bug, and it would be best to raise an OSS message to SAP.

  • Last Closed Fiscal Period

    Hi All
    How can I identify the Last Closed Fiscal Period in a query variable ?
    eg. The current calendar month is Feb which is Fiscal period 11 (Variant is Z3). However Finance still have January open so they want to report YTD figures up to and including December (Fiscal periopd 9).
    I have created a user exit variable (with help from SDN) that works out the YTD range for the fiscal periods but it uses system date to calculate current period. Therefore, the current fiscal period is coming out at 11 but I need 9. When the Month End occurs on Friday the current fiscal month should become 10.
    All help appreciated.
    Asif

    Hi Surender
    I need a variable that does not have any user interaction, and will determine the range of periods that constitute the current fiscal year. The range should start at 1 and end at the last closed fiscal period as maitained on R3.
    I have decided to bite the bullet extract the table T100B from R3. It contains details on all open periods.
    I am trying to load it as master data. Its the first tme I have done this type of work so taking some time.
    I have created the extractor and a characteristic with attributes to hold this info. I then plan to read this data in the variable to work out the range.
    If there is a simpler way to do this then please advise.
    Regards
    Asif

  • How to get the last day according to fiscal period input in selection scree

    Hello expert
    how to get the last day of fiscal period input.
    the fiscal period inculdes 1-16
    when fiscal period is greater than 12, only calculate the last day of 12nd month
    your solution will be apprecaited, FM existing?
    thank you
    Kevin

    Hi,
    when you give a particular date in any month
    the following fm will give you the last date of that month
    here you can give
    R_FDATE-HIGH  as 01 and month as the period you wnat and year for current year
    concatenates '01'  month year  into r_fdate-high separated by '.'.
    then it will give g_ltdt for that month and year which wil be the last date of that month
        CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'
          EXPORTING
            DAY_IN            = R_FDATE-HIGH
          IMPORTING
            LAST_DAY_OF_MONTH = G_LTDT
          EXCEPTIONS
            DAY_IN_NO_DATE    = 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.
    thanks & regards,
    Venkatesh

  • How to get the last day of the current open fiscal period?

    hi folks,
         I  have to display the last date of the current open fiscal period in the selection screen. Its just a display only.
          if there is any function module vailable for getting that period, kindly suggest me?
    thanks in advance,
    cheers,
    Adi.

    hi,
    CALL FUNCTION '/BEV3/CHPERIOD_DETERMINE'
    EXPORTING
    date = sy-datum
    version = c_version
    IMPORTING
    period = l_period
    year = l_fiscal_year
    EXCEPTIONS
    period_in_not_valid = 1
    period_not_assigned = 2
    version_undefined = 3
    OTHERS = 4.
    If not use GM_GET_FISCAL_YEAR
    CALL FUNCTION 'GET_CURRENT_YEAR'
    EXPORTING
    BUKRS = '1000' " Company Code
    DATE = SY-DATUM " Date to find fiscal year for
    IMPORTING
    CURRM = w_currm " Current Fiscal Month
    CURRY = w_curry " Current Fiscal Year
    PREVM = w_prevm " Previous Fiscal Month
    PREVY = w_prevy. " Previous Fiscal Year
    Rgds
    Anver

  • Fiscal Period in 0PA_C01

    The cube 0PA_C01 works on the basis of calmonth and it is easy to map it to fiscal period if each fiscal period corresponds to a whole calendar month.
    But we are facing a peculiar situation where the Client's fiscal periods are irregular and do not correspond to exact calendar months.For example Fiscal Period 01.2009 corresponds to the period 02.04.2009 to 29.04.2009 and not to Calendar month April'09.
    In such a case it is becoming a challenge to extract the headcount on the basis of fiscal period from the cube 0PA_C01.
    Could any one offer a clue as to how this could possibly be achieved?

    Hello Rajeev,
    you can always use FM DATE_TO_PERIOD_CONVERT during extraction in ZXRSAU01 or in transfer/update rules on BW. Remember to transfer Global Settings from source system to BW when using second method. Don't forget about transfer data to 0FISCVARNT as well.
    Thanks = points.
    Best Regards,
    Maciej Janik

Maybe you are looking for

  • Power converter and non-Apple Adapters

    I am traveling to London and Paris next month. Do I actually need the power brick or can I use an adapter with USB cable? I am traveling with two iphones, and two cameras. I expect to have very few outlets. Also has anyone used these non apple adapte

  • Pooled jdbc connection(s), and server resources

    Hello All, I am curious about the difference between jdbc connections in a connections pool, and 'stand alone' connection. I have Oracle 9.2 To describe... In my application server (WebLogic) I have a connection pool, with 10 connections. Does this t

  • [Consolidation-Locked] Lightroom 4 edit in problem

    I purchased Lightroom 4 upgrade, installed it, converted my catalog, and set the preferences for "edit in" another application to Photoshop Elements 9. This works fine in Lightroom 3, but when I try to send aa photo from Lightroom 4 to Elements, noth

  • Rfposxext - Adding special field

    Could anybody help me with this issue? I need to add a special field to the automatically generated structure rfposxext. The field name is REGIO. I tried with SPRO but the source table where the REGIO is present is not available in the list of change

  • Using KVM causes MacPro's display output to go black for a few seconds

    I have a Mac Pro plugged into a IOgear 2 port DVI KVM. The Mac Pro's other DVI output is plugged in, via VGA, to a second monitor that is not switched. Whenever I switch to my Mac Pro, both displays go black for 2-4 seconds and then come back. This i