Var. Exit code for Fiscper of Current Fiscal Year

Hi Guys,
I need to create a variable exit to calculate the Current Fiscal Period of Current Fiscal Year. (STrange requirement)
Can anyone please help me with the sample code?
Regards

You can use DATE_TO_PERIOD_CONVERT based on the current date (sy-datum).
call function 'DATE_TO_PERIOD_CONVERT'
exporting
i_date = sy-datum
i_periv = w_fiscal_year_var
importing
e_buper = w_period
e_gjahr = w_year
exceptions
input_false = 1
t009_notfound = 2
t009b_notfound = 3
others = 4.

Similar Messages

  • System fiscal year in co code does not match current fiscal year.

    Hi
    I have seen this problem.I  did run some closing steps and this error gone . Can some one please explain some logic behind this error ? Because I am sure i have not done any specific transaction to match the system fiscal year and current fiscal year then how this error gone away ?
    I have checked the other posts on this forum related to this error but still feel to ask for clarity of concept.
    Thanks in advance
    Satya

    Hi Satya,
    Ex:
    FY is 2011 ( for US)
    compny code FY may / may not same as system FY.
    for Business adjust ment / Financial Adjustments client not close previous FY.
    now if you check your system, Comp Code FY is 2010 & System FY is 2011.
    Company Code Closing FY T.Code: OAAQ
    Tables need to chek for conformation year end activities done/not: TABA, T093B, T093C
    Regards,
    Viswa

  • Customer exit code for fiscalyear period based on system date

    Hi Experts,
    Please provide customer exit code for fiscalyear period derive based sy-datum. Fiscal year period derivie current to previous 12 periods and current to fast 12 periods.
    Thanks,
    Subbaraju

    Hi Subbaraju,
    Please use below customer exit code for your solution. Please define declarations as per requirement.
    When 'ZFPERIOD'.
    IF I_STEP = 2.
    ztoday = sy-datum.
    zfast = sy-datum + 365.
    CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
      EXPORTING
        i_date               =  ztoday
        i_periv              = 'K4'
    IMPORTING
       E_BUPER              = PERIOD2
       E_GJAHR              = YEAR2.
    CONCATENATE YEAR2 PERIOD2 INTO FISCPERLOW.
    CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
      EXPORTING
        i_date               =  zfast
        i_periv              = 'K4'
    IMPORTING
       E_BUPER              = PERIOD2
       E_GJAHR              = YEAR2.
    CONCATENATE YEAR2 PERIOD2 INTO FISCPERHI.
    L_S_RANGE-LOW = FISCPERLOW.
    L_S_RANGE-HIGH = FISCPERHI.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'BT'.
    APPEND L_S_RANGE TO E_T_RANGE.
    ENDIF.
    Similar code user for your previous periods also.
    Thanks,
    Chandra

  • Need to Display Data for Cummulated to Current Day of Current Fiscal Year

    We use fiscal variant V3 (April-March).  My need is to display data automatically from first of fiscal period (April 1 2006) to today.
    I tried using 0CYTCD on Calendar Day but this works only for the current calendar year that the system is in  i.e 2007.
    Is there a standard variable I can use on 0CALDAY so I always get data from day one of current fiscal year/period to today? e.g. April 1, 2006 to January 3, 2007
    If not, can someone please help with the exact customer exit code that I would need to write in CMOD in BW?
    Thanks a ton!

    I thought of using 0FYTCD variable, but I cannot find it in the business content.
    Has anyone used 0FYTCD (Fiscal year to current day) in BW 3.1 SP25?
    Again, I am looking for a variable that would get me the beginning of fiscal year to today.
    Thanks.

  • Function module to read customer balances for current fiscal year.

    Hi,
    Could anyone please tell me about the function module which would display the customer credit balances from the FD10n transaction code for teh current fiscal year. that means from july 2010 to july 2011.

    Hi,
    use the BAPI 'BAPI_AR_ACC_GETCURRENTBALANCE'
      CALL FUNCTION 'BAPI_AR_ACC_GETCURRENTBALANCE' "Closing balance of customer account in current fiscal year
      EXPORTING
        companycode =               " bapi3007_1-comp_code  Company code
        customer =                  " bapi3007_1-customer  Customer
      IMPORTING
        actual_balance =            " bapi3007_9    Carry forward balance and balance
        return =                    " bapireturn    Return Code
        .  "  BAPI_AR_ACC_GETCURRENTBALANCE
    This method provides a customer's balance for the current fiscal year.
    It displays both the balance of standard transactions and the total balance of standard transactions and all special general ledger transactions.
    Read the Documentation of the BAPI.
    Regards,
    Dhina..

  • Year To Date for Current Fiscal Year

    Hi All,
    I have installed BC variable Year To Date for Current Fiscal Year 0I_CFYTD..
    foloowing error occurs
    Variable 0I_CFYTD could not be replaced..
    Do i need to write any code or Please help.....

    Hi,
    Please check if fiscal year variant is used in the filter. Else the BC variable throws an error. Drag fiscal year variant to the filter area and set a value or variable input for the same.
    Regards,
    Satya

  • What varaible is best to use for current fiscal year.

    Hello all,
    I have few restricted key figures which need to be reported as "for current fiscal year" so which ios the best variable we can use for that.In the filter area I have fiscal year variant and comp code do I have to give users the input ready for fiscal year?
    Also then i need comparison between current and previous year for same RKF so I plan to offset the varaible by "-1" .
    Thanks

    It works for me Bhanu. Last I used that it gave me errors so was not sure.
    for YTD i dont see any variable in fiscal year am I looking at wrong place.
    can you suggest something
    Thanks

  • Find SAP Exit code for Variable '0CMONTH '

    I am trying to fnd the SAP exit code for variable 0CMONTH so I can create a customer copy and make the variable 'ready for input'. Any ideas where I can find the code or a simple way to effectviely copy the delivered variable.
    I have tried looking in SE37 and then RSVAREXIT* but cannot seem to find the specific code I need.
    Thanks
    Steve

    Hi,
    Search the technical name for the variable in metadata repository and try to find the program where it is declared.  Then i hope u can go the code where it is written.
    Cheers.
    Ranga.

  • Current Fiscal year/Period (0FISCPER)

    Hello
    I am using 0FISCPER in a stk query. In that I want to restrict this Char. by Current Fiscal year/Period. But I cant find ant SAP exit variable for this. How to restrict the query by Current Fiscal year/Period??????
    Pls help. urgent.

    You can create a variable with customer exit and use this in your query for your purpose.
    to get the current FISCPER you can use RSARCH_DATE_CONVERT Function Module in Customer Exit.
    based on your system date this FM will calculate current FISCPER value

  • Current fiscal year and previous fiscal year restriction in Query  Customer

    Hi ,
    My requirment is disply current year qtrs and previous year qtrs in the report . User will not enter year , date , month or qtr . system should calucualte and disply curremt year qtrs and previous year qtrs .
    I have created ZFISCYEAR reference of a 0FISYEAR year . now I would like to write customer exit for Current fiscal year and previous fiscal year to display current year qtrs and previous year qtrs.
    Could you please provide customer exit code if you have or recomend if you know any other options.
    Appriciate you help
    Thanks

    hi try this
    take into account that I don't know th periv you use could be K4 or one defined by you so I have commented it.
    The coding here is for the current fiscal period for the previous year just to another l_year varibale and populate with offset for instance l_year = l_year - 1.
    so for current year
    WHEN 'CURRPERIOD'.
        current_date = sy-datum.
        CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
          EXPORTING
            i_date  = current_date
        '    i_periv = ''
          IMPORTING
         '   e_buper = l_period.
            e_gjahr = l_year.
        l_s_range-low = l_year.
        l_s_range-sign = 'I'.
        l_s_range-opt = 'EQ'.
        APPEND l_s_range TO e_t_range.
    for previous period
    WHEN 'PREVPERIOD'.
        current_date = sy-datum.
        CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
          EXPORTING
            i_date  = current_date
        '    i_periv = ''
          IMPORTING
         '   e_buper = l_period.
            e_gjahr = l_year.
        l_year = l_year - 1.
        l_s_range-low = l_year.
        l_s_range-sign = 'I'.
        l_s_range-opt = 'EQ'.
        APPEND l_s_range TO e_t_range.
    bye
    Boujema

  • Reversal of Last Fiscal year asset in current fiscal year

    Dear SAP experts
    Asset has been booked in last fiscal year (jan2006) depreciation also posted till this fiscal year last month (2007 June)
    Asset value-70000 (invoice value)
    Accumulated Depreciation-33753.42
    Asset net book value as on date- 36246.58
    With same information one more asset also booked by mistake, so my client want to reverse any one of them asset with depreciation (which has booked in last fiscal year)
    I tried with asset credit memo (T code ABGF); it is picking up only asset net book value (36246.58) not accumulated depreciation (which is already affected in Accumulated GL account).
    Can you tell me is there any way to solve this problem

    Hi Chaitanya,
    If you have already acquired and depriciated the asset in previous fiscal year and closed the books and published the results why do you want to reverse it now. from accounting point of view also how would you show the entry for reversal of depriciation.
    Any how the acqusition and depriciation posted in previous fiscal year can not be reversed in current fiscal year it can be reversed only in previous fiscal year. as per SAP standards you can write up the asset if you have wrongly depricaiated the asset.
    Or else you can retire the asset with revenue which will give the same financial impact as you are expecting.
    Thanks & Regards
    Sree

  • I would like to display current fiscal year always on variable screen

    Hi
    I have requirement in which I would like to display the current fiscal year on variable screen in BI Report.
    we have a standard variable however the sap exit to display the current fiscal year is not shown...
    Can any one tell me, how to proceed in this case.
    Thanks
    Chetan

    Hello,
    For I-step = 1, use the function module DATE_TO_PERIOD_CONVERT.
    here for IMPORT use i_date = sy-datum and i_periv = ur fiscal variant.
    The output is e_buper contains fiscal period and e_gjhar contains fiscal year.
    The use concatenate to join fiscal year and fiscal period to the variable low value.
    Regards,
    Shashank

  • Variable to display data from Current Fiscal Year to the MONTH entered

    Hi Friends,
    In the Quey Designer I require a CHARACTERISTIC VARIABLE for the 0CALMONTH which should have the following features:-
    1.Input Month(e.g JUN 2008)
    2.Mandatory
    3.Ready for Input
    The query should show the following OUTPUT:-
    The data should be displayed from the CURRENT FISCAL YEAR to the value of the Input MONTH entered.
         e.g For Input  =  DEC2008
               Output = from APRIL 2008 to DEC2008.
    Do we have a standard variable for this or we have to go for a Customer Exit??
    Thanks in Advance!!!
    Vivek

    Hi,
    Create a customer exit as follows.
    WHEN 'ZCMTD'.
    you variable name
    data: ZCMTD_LOW like sy-datum.
    ZCMTD_LOW = sy-datum.
    ZCMTD_LOW+4(2) = '04'.
    *replacing last two symbols (month) in the current month with '04'
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW = ZCMTD_LOW.
    *initializing low interval limit
    L_S_RANGE-HIGH = SY-DATUM.
    *initializing high interval limit
    L_S_RANGE-SIGN = 'I'.
    *defining interval as inclusive
    L_S_RANGE-OPT = 'BT'.
    APPEND L_S_RANGE TO E_T_RANGE.
    ENDCASE.
    Thanks,
    Ashok

  • How to get current fiscal year.

    Hi Experts,
    I am working on Asset Management.I need to get current fiscal year.
    I have to enter fiscal year on selections screen which i have to validate that it should not be greater than current fiscal year.
    For above i have used following code snippet but i have hard coded variant as 'MK'.
    To get variant i was using function '/IBS/RB_FI_GET_FISCAL_YEAR_VAR'  but in my selection screen we have to enter multiple company codes. if i will keep this function inside loop then it may give multiple variants.
    How to resolve this ?
    DATA : l_year(4) type c,
           l_date TYPE sy-datum.
    CALL FUNCTION '/IBS/RB_FI_GET_FISCAL_YEAR_VAR'
      EXPORTING
        i_company_code               =
      IMPORTING
        E_FISCAL_YEAR_VARIANT        =
      EXCEPTIONS
        COMPANY_CODE_NOT_FOUND       = 1
        OTHERS                       = 2.
      l_date = sy-datum - 700.
      l_date = l_date + 1.
      IF sy-subrc EQ 0.
        CALL FUNCTION 'GM_GET_FISCAL_YEAR'
         EXPORTING
           I_DATE                           = l_date
           i_fyv                            = 'MK'
         IMPORTING
           E_FY                             = l_year
         EXCEPTIONS
           FISCAL_YEAR_DOES_NOT_EXIST       = 1
           NOT_DEFINED_FOR_DATE             = 2
           OTHERS                           = 3.
        IF sy-subrc EQ 0.
          IF s_gjahr-low GT l_year.
            PRINT Error Message "Entered fiscal year should not be greater than current fiscal year".
          ENDIF.
        ENDIF.

    make it simpler by using - DATE_TO_PERIOD_CONVERT
    CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
      EXPORTING
        I_DATE               = SY-DATUM
        I_PERIV              = L_VARI    "Fiscal year Variant - refer to tab T009B
    IMPORTING
       E_BUPER              = L_BUPER " Fiscal Period
       E_GJAHR              = L_GJAHR  " Fiscal year
    EXCEPTIONS
       INPUT_FALSE          = 1
       T009_NOTFOUND        = 2
       T009B_NOTFOUND       = 3
       OTHERS               = 4
    Hope this will solve ur problem.

  • Asset write off in the current fiscal year.

    Hi Experts,
    I want to write off an asset in next 4 periods of the current fiscal year 2007. For example:
    Asset 11000
    APC value: 10000
    APC Date: 01.01.2005
    The useful life will end in fiscal year 2008.
    The book value left at the begining of the current fiscal year 2007 Rs. 4000.00
    In the current fiscal year this asset has already been depreciated for previuos 3 periods.
    Now Business wants to write off ( fully depreciated ) this asset in next 4 periods equally and then if the book value and tax value is nil, they want to scap the asset.
    Now can you please tell me how to make this happened. Its very urgent. If you need any more information, most welcome.
    Rgds,
    BABA

    Hi,
        You would have to set the asset to manual depreciation(Depr.Key MANU)
    and generate a posting via ABMA for each of the periods.
    Kind regards

Maybe you are looking for

  • Midi loop not sounding same at arrange area

    Hi, when I drag a midi loops (green loops) into the arrange area it will not play the same sound........ mean I'm not getting the same effect of the midi loop at the arrange area & I don't want use these loop on audio track. I know if I drag the midi

  • Movement type 311 E in WM

    Hi gurus, I am working on product support @clients place where we have MTO items. Now the scenario is that a material XYZ was Goods Receipted in a wrong storage location (0001) by the Production Order confirmation. This was due to the way it was setu

  • HP W1707 Monitor

    Hi i need HP W1707 Monitor can pl help me...thank you This question was solved. View Solution.

  • Different LOV behavior between SQL query data model and data template

    I have noticed different behavior when using parameters linked to list of values (LOV) of type menu with the multiple selection option enabled and a SQL query data model vs a data template. Here's the example because that first sentence was probably

  • MySQL gateway connection

    Looks like plenty of folks here have similar problems getting the dg4odbc gateway working for MySQL. Hope someone that's tackled this can help me out. Our configuration is such that we have our gateway machine separate from our Oracle database, and t