Regarding Customer exit to calculate fiscal week

Hello All,
             I have a requirement to calculate the fiscal week from fiscal period. Here i used the FM 'UMC_FISCPER_TO_CALWEEK' to calculate the fiscal week. But the problem here is i created variable on fiscal year /week so when i pass the fiscal period i should get fiscal week, here i am getting calweek which make no sence. Is there any function module to calculate the Fiscal week if we pass fiscal period.
Thanx in Advance
Anil

We cant calculate fiscal week from just fiscal period. we need date or this.
You can try this function  ZFI_GET_FISCAL_WEEK_QUARTER or some other similar function. However, the input should be a date.
Looks like there is no funciton to calculate fiscal week. we may need to write our own code for this based on other FMs.
Re: Get Week number in a particular Fiscal year
~ Arun KK
Edited by: arun kk on May 8, 2008 10:22 AM

Similar Messages

  • How to create a customer-exit to calculate a week from a date

    Hi my Guru's,
    I actually try to implement an Exit variable to calculate a week number from a characteristic date (0FINISHDATE) in my BEX report. Does anyone has an example of customer-exit which calculate a week number after giving a date in the popup.
    What I really need is how to initialize the OFINISHDATE value in my Exit.
    Any help will be appreciate,
    Cheers,
    MK2

    Hi,
    I  donot know this following workaround works properly are not. we have to wait for Our BW gurus' suggestions.
    1) Create a formula variable with 'Replacement path' as processing type on Characterstic 0FINISHDATE.
    2) Create one more Formula variable with 'customer exit' as processing type .
    3) In Cmod
    DATA: l_s_range type rsr_s_rangesid.
    DATA: datein like sy-datum. "la caractéristique date
    DATA: date2 like SCAL-WEEK. " déclaration de Résultat
    DATA : NUMB1(2) TYPE N.
    CASE i_vnam.
    when 'FORMULA_VARIABLE2'.
    IF I_STEP = 2. "after the popup
    LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
    WHERE VNAM = 'FORMULA_VARIABLE1'.
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW(8) = LOC_VAR_RANGE-LOW(8)
    datein(8)  = L_S_RANGE-LOW(8).
    here we are finding the Week no user entered date.
    CALL FUNCTION 'DATE_GET_WEEK'
    EXPORTING
    DATE = datein
    IMPORTING
    WEEK = date2.
    numb1 = date2+4(2)
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW  = numb1.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT  = 'EQ'.
    APPEND L_S_RANGE TO E_T_RANGE.
    ENDCASE.
    With rgds,
    Anil Kumar Sharma .P
    Message was edited by: Anil Kumar Sharma

  • Customer exit for difference of weeks

    Hi All,
    I have two formula variables with processing from customer exit.
    1. ZVAR_FV1 = getting current calendar week from system
    2. ZVAR_FV2 = getting user entry week in formula variable
    Now I want to find the difference between the two.
    So if current week is 012011 and user entry week is 502010
    then ZVAR_FV1 = 201101
           ZVAR_FV2 = 201050
    I need the difference of the two weeks as 3
    Can u please advise how can i get that ?  is it possible to find the difference of the two in the query level?  if i need to write a customer exit can u please advise the code for it as I am not an ABAP expert...
    Many thanks!
    Tanu

    Hi,
    As per you mail you have two variables.
    ZVAR_FV1 & ZVAR_FV2.
    Take a new variables ZVAR3 till ZVAR7
    ZVAR3 = ZVAR1_FV1+0(4).
    ZVAR4 = ZVAR1_FV2+0(4) .
    ZVAR5 = ZVAR3 -ZVAR4.
    ZVAR6 = ZVAR5 * 52.
    ZVAR7 = ((ZVAR1_FV1+4(2)) + ZVAR6) - (ZVAR1_FV2+4(2)).
    By the above code you will have your 3 in the variable ZVAR7.
    Thanks & Regards,
    Vishnu

  • Customer exit variable to get weekly report

    Hi All,
    I have a requirement as following. there are 2 user selection variables.
    Selection variables  are v1: start date: Period Range (d1-d2)
    V2: Period : Values should be 1month, 3 months, 6months (these values should be populated from Customer exit variable itself)
    The report layout shoud show:
    Actual sales by week (for period selected in v1)
    Plan sales by week (for period value selected in v2)
    Can you please reply with the abap?
    Quick replies are much apprciated.
    Thanks
    Suman

    Hello,
    You can try with the following way:
    1) Create a new infoobject with  master data tick on and load it via flat file with the needed values like 1 month, 2 months etc.
    2) Now include this infoobject in the MPRO along with the other infoprovider. If not using MPRO please create and use one.
    3) IN the MPRO include and assign this infobject in one of the dimension.
    4) Now in the query include this infoobject in the filter and create an user entry variable and in its default value include #
    5) Now include calmonth in the query and create a variable of type user exit not ready for input and include iit for calmonth.
    6) Now create a user exit for variable on calmonth at i_step = 2.
    7) The logic can be simply reading the value from the i_t_var_range table for variable on the new infobject and based on the selection write routine to populate the months needed.
    8) Here note that while writing routine please make sure you read i_t_var_range for all values NE #.
    9) The only disadvantage is that we need to always include # entry along with other entries.
    Hope it helps!!
    Regards,
    Shashank

  • Regarding Customer Exit in Bex

    Hello Expers.
    Here is my scenario: I have variable which accepts the key date from the user. The requirement is to get the calmonth from the date entered by the user. According to my point of view, Writing customer exit is a best option but i do not know is it possible for me to pass the date, entered by the user, to exit? If Yes than please let me know how?
    Help required Urgently

    use the parameter I_STEP which specifies when the enhancement is called.
    The following values are valid for I_STEP:
    ·        I_STEP = 1
    Call takes place directly before variable entry
    ·        I_STEP = 2
    Call takes place directly after variable entry. This step is only started up when the same variable is not input ready and could not be filled at I_STEP=1.
    ·        I_STEP = 3
    In this call, you can check the values of the variables. Triggering an exception (RAISE) causes the variable screen to appear once more. Afterwards, I_STEP=2 is also called again.
    ·        I_STEP = 0
    The enhancement is not called from the variable screen. The call can come from the authorization check or from the Monitor.
    sample code : user enter value of date in say variable ZDATE
    l_s_range TYPE rsr_s_rangesid,
    l_t_var_range TYPE rsr0_s_var_range.
    WHEN 'ZCALM' .
    if i_step=2.
    read table i_t_var_range into l_t_var_range with key vnam = 'ZDATE' .
    if sy-subrc = 0.
    l_s_range-low = l_t_var_range+0(6).
    l_s_range-high = l_t_var_range+0(6).
    l_s_range-opt = 'EQ'.
    l_s_range-sign = 'I'.
    append l_s_range to e_t_range.
    endif.
    endif.

  • Regarding Customer exit - ABAP Code

    Hi Friends,
    I have a scenario in one of the query and need to write a customer exit for the same. Here is the scenario:
    I am using one input variable XXX to get input from user which feeds value to one of the charateristic lets say "CHAR1" in query. I have one more characteristic "CHAR2" which has to get the value from the same variable XXX. This is not allowed in BI7.0 as the variable is Hierarchy Node type. It gives error that "Variable XXX is used for two different characteristics."
    So i need to create one more vaiable YYY which will get the value from XXX and then YYY will feed value to CHAR2. I would appreciate if some one could tell me step by step how to write customer exit and give me the piece of ABAP code i need to write in my case.
    Your help will be appreciated in terms of points.
    Thanks,

    Hi Manmit,
    The following link can guide you on how to write customer exits (this has example as well)
    [http://help.sap.com/saphelp_nw70/helpdata/EN/61/579b3c494d8e15e10000000a114084/frameset.htm]
    Hope this helps.
    Cheers,
    Sumit

  • Doubt Regarding Customer Exit

    Hi All ,
    In customer exit MM06E005 we have a screen area named INCLUDES in the components screen , in that we have two customer includes .
    My doubt is that whether it is mandatory that we can add only the field that are added in that customer includes i.e CI_EKKODB  CI_EKPODB  or we can add any others from other customer includes such as CI_COKB in the table EKKN..

    Hi,
    You can add fields in other cusomer include also but then this userexit will not be useful for you since its using CI_EKKODB and CI_EKPODB.
    REWARD IF USEFUL

  • Custom exit variable for fiscal year/period

    Hi BI Experts
    1) In one of the column i just want Budget data to be displayed for the entire year..i.e even if the user enters 005/2006 for fiscal year /period that column should display 001/2006 to 012/2006 Budget.
    I have created a restricted KF for 0AMOUNT restricted by version(for Budget), valuetype (for Budget )
    now how do I assign variable for Fiscal year/period...and the problem is posting period is not populated ...I mean there is no transformation for that...
    Can you share your experience on that ...full points wil be awarded...
    Thanks

    Hi Ajay and Pradhiba
    I am really sorry for assigning you guuys points ...wasa bit busy ...
    The problem is that the year and posting period is not populated...there fore I cannot use those time characteristics...
    Now I have only fiscal year/period populated..now i want
    if the user enters 005/2006 ....i want my first column to calculate the data for 001/2006 to 012/2006 ...thats the req...
    can u share ur ABAP experience in that...
    thanks

  • Regarding Customer Exit

    I am doing Function Exit for Transaction CO12.
    When the Wage Group is initial it should display message like "Enter Shift A/B/C in field Wage Group".
    i am getting this one. after display this message screen should go to previous screen ( What we entered data) . I am getting this one but data is clearing and fresh CO12 transaction is opening.
    I want that data also.
    Please sugget.
    Regards
    Rami

    Dear Rami Reddy,
    This is a functio Exit.
    i don't think you need to use LEAVE SCREEN.
    see from the Standard Code of SAP the funtion module will get called and it come to your code, after executing the FM it will contine processing further.
    in Function Exits IT is not adviceable to use LEAVE SCREEN or CALL SCREEN unless suggeted by the FM documentation
    Most importantly you are using the LEAVE SCREEN with in a loop.
    please analyze your code with peace of mind.
    regards
    Ramchander Rao.K
    Edited by: ramchander krishnamraju on Nov 20, 2008 8:18 AM

  • Customer exit to calculate previous quarter based on user entry in 0PCALMON

    Hi,
      I have written a CMOD code to calculate previous quarter based on user entry in 0PCALMON (0CALMONTH).  That is if 09.2008 is entered for 0PCALMON, it should fetch the months 04.2008, 05.2008,06.2008.
    But unfortunately I am getting all years and all months.
    Could you please help me debug this code.
    Global Declaration :
           z_vcalmonth(2) TYPE n ,
           z_vcalyear(4) TYPE n.
    When 'YQV_LQ'.
    if i_step = 2.
    READ TABLE i_t_var_range WITH KEY
      vnam = '0PCALMON'
      iobjnm = '0CALMONTH'
      INTO l_s_var_range.
      if sy-subrc = 0.
            z_vcalmonth = l_s_var_range-low+4(2).
            z_vcalyear = l_s_var_range-low(4).
          IF ( z_vcalmonth >= 1 AND z_vcalmonth <= 3 ).
            z_vcalyear = z_vcalyear - 1.
            CONCATENATE z_vcalyear '10' INTO l_s_range-low.
            CONCATENATE z_vcalyear '12' INTO l_s_range-high.
          ENDIF.
          IF ( z_vcalmonth >= 4 AND z_vcalmonth <= 6 ).
            CONCATENATE z_vcalyear '01' INTO l_s_range-low.
            CONCATENATE z_vcalyear '03' INTO l_s_range-high.
          ENDIF.
          IF ( z_vcalmonth >= 7 AND z_vcalmonth <= 9 ).
            CONCATENATE z_vcalyear '04' INTO l_s_range-low.
            CONCATENATE z_vcalyear '06' INTO l_s_range-high.
          ENDIF.
          IF ( z_vcalmonth >= 10 AND z_vcalmonth <= 12 ).
            CONCATENATE z_vcalyear '07' INTO l_s_range-low.
            CONCATENATE z_vcalyear '09' INTO l_s_range-high.
          ENDIF.
          l_s_range-sign = 'I'.
          l_s_range-opt = 'BT'.
          APPEND l_s_range TO e_t_range.
    endif.
    endif.

    Hi,
    U can use the FM SLIM_GET_QUARTERLY_PERIODS
    Pass the variable first date of 0PCALMON ( 09.2009 => '01.09.2009') to get the table of all the 4 period ranges in PERIODS  table in result
    and read the Last entry to get the Previous Quarter period
    PERIODS table
    S OP LOW        HIGH      
    I BT 01.07.2008 30.09.2008
    I BT 01.10.2008 31.12.2008
    I BT 01.01.2009 31.03.2009
    I BT 01.04.2009 30.06.2009
    Then pass this values in l_s_range-low l_s_range-high
    Hope this helps
    Sonal...

  • How to create an user input variable for customer exit variable? - BW3.5

    Hi Guru,
    I have a requirement for the selection period of my reports. There are 3 possible reporting periods which should be user selectable:
    1. Month: Current reporting month
    2. Fiscal Year to Date
    3. Project Year to Date
    Here I need 2 variable to do these, 1 customer exit and 1 user input variable. I have created a variable customer exit to calculate all these requirement. But can any1 tell on how to create the user input variable for my customer exit? I need a user input variable with drop down list like below.
    01-Current month
    02- Fiscal Year to Date
    03-Project Year to Date
    I have create a new master data for this variable, but it's not working. What I need now is a standalone master data which do not need to link to any exiting records. Can any1 tell me how to create this?

    Just go to the definition of the variable for which you have created a customer exit. There you will find a check box for "Ready for Input". Just tick that checkbox and the variable will be available as a selection variable in the reports selection screen.
    Regards,
    Yogesh

  • Need to calculate one week before the user entered week

    Hello Friends,
    I have a ZCALWEEK object and I have created a variable on it. It is a simple 'Manual input' type of variable. We have to display a few keyfigures which will be restricted for the week value entered by the user (in variable mentioned above). Along with this we have a few keyfigures which have to be restricted for a week before i.e. user entered week -1.
    I tried to use the "Set offset for variable" option, but it is grayed out. Now the solution that I see for this is to create another variable (customer exit) and calculate the previous week. However, I believe that there has to be a simpler way, in the query designer itself, of doing this i.e. without creating customer exit.
    I really appreciate your timely feedback. Thanks!
    Regards,
    Prem.

    Prem,
    Variable offset should work in your case....
    Chose the variable  for the KF.... keep the offset as -1.
    Otherwise we need to go for customer exit....
    consider a variable x fill this by the current week or week entered... take the -1 in another variable  and use it..
    Cheer's
    HVR.

  • Error while executing customer Exit Variable (No value could be determined for variable.  BRAIN 632)

    Hello,
    I created a customer exit variable which has to show the range between the first and last day of the previous month. The query will be executed every first of the month.
    Variable is declared as: Customer exit, based on 0CALDAY, Interval, Mandatory and NOT input.
    When i debug the query, it is making the calculation but its not populating my variable; when I execute the query from RSRT, the output test shows a message:
    ENo value could be determined for variable ZRANGE_PREVMONTH.                            BRAIN               632ZRANGE_PREVMONTH
    Below the code i'm using (SAP 7.4)
    ***Customer Exit to calculate previous month.
    IF i_step = 2.
         CASE i_vnam.
              WHEN 'ZRANGE_PREVMONTH'.
    DATA:  LS_RA_SID  TYPE   RSR_S_RANGESID.
    DATA:  yyyy(4) TYPE n.
    DATA:  mm(2) TYPE n.
    DATA:  dd(2) TYPE n.
    DATA:  fst_date LIKE sy-datum.
    DATA:  fst_date2 LIKE sy-datum.
    LOOP AT i_t_var_range_c INTO loc_var_range
        WHERE vnam = '0DAT'.
          dd = sy-datum+6(2).
          mm = sy-datum+4(2).
          yyyy = sy-datum+0(4).
          fst_date2 = sy-datum.
          IF dd = '01' AND mm = '01'.
            mm = '12'.
            yyyy = yyyy - 1.
          ELSEIF dd = '01' AND mm <> '01'.
            mm = mm - 1.
          ELSEIF dd <> '01'.
            mm = mm - 1.
          ENDIF.
          CLEAR: fst_date.
          CONCATENATE yyyy mm '01' INTO fst_date.
          fst_date2 = fst_date2 - 1.
          CLEAR: ls_ra_sid.
          ls_ra_sid-sign = 'I'.
          ls_ra_sid-opt = 'BT'.
          ls_ra_sid-high = fst_date2.
          ls_ra_sid-low = fst_date.
          APPEND ls_ra_sid TO e_t_range.
    ENDLOOP.
    ENDCASE.
       ENDIF.

    Hi Fernanda,
    Try this:
    DATA:  LS_RA_SID  TYPE   RSR_S_RANGESID.
    DATA:  fst_date LIKE sy-datum.
       CASE i_vnam.
              WHEN 'ZRANGE_PREVMONTH'.
    fst_date = sy-datum - 1.
    concatenate fst_date(6) '01' into ls_ra_sid-low.
          ls_ra_sid-sign = 'I'.
          ls_ra_sid-opt = 'BT'.
          ls_ra_sid-high = fst_date.
          APPEND ls_ra_sid TO e_t_range.
    ENDLOOP.
    ENDCASE.
       ENDIF.
    Just post here for any queries..
    Regards,
    Loed

  • Urgent - Customer Exit

    Hi All
    I am trying to write a Customer exit. But it is not working. i have created a Formula Variable (Zvar1) with customer exit to calculate Days Elapsed. This Days Elapsed should show the day which the user enters. For example if user enters 2004/06/22 when variable pop ups this days elapsed should show 22. For this i have assigned variable (ZZCALDAY) for  Calender day. Below you can see the customer exit. Exit_SAPLRRS0_001. Please help me out with the code.
    *&  Include           ZXRSRU01
    DATA: l_s_var TYPE rrs0_s_var_range.
    DATA: l_s_range TYPE rsr_s_rangesid.
    DATA: lv_date TYPE sy-datum.
    DATA: lv_date1 TYPE sy-datum.
    CASE i_vnam.  " Variablenname
      WHEN 'ZVAR1'.
        IF i_step = 2.
          READ TABLE i_t_var_range
          WITH KEY vnam = 'ZZcalday' INTO l_s_var.
          IF sy-subrc = 0.
            lv_date = l_s_var-low.
            lv_date1 = lv_date+6(2).
            CLEAR l_s_range.
            l_s_range-sign = 'I'.
            l_s_range-opt = 'EQ'.
            l_s_range-low =  lv_date1.
            APPEND l_s_range TO e_t_range.
          ENDIF.
        ENDIF.
    ENDCASE.
    Regards
    Naga Yadavalli

    The below program works when i debug if step=2 is uncommented. When i try to run the query it is not showing the data (No applicable data available)..
    *&  Include           ZXRSRU01
    DATA: l_s_var TYPE rrs0_s_var_range.
    DATA: l_s_range TYPE rsr_s_rangesid.
    DATA: lv_date TYPE sy-datum.
    DATA: lv_date1(2) TYPE n.
    CASE i_vnam.  " Variablenname
      WHEN 'ZVAR1'.
    <b>*    IF i_step = 2.</b>
          READ TABLE i_t_var_range
          WITH KEY vnam = 'ZZCALDAY' INTO l_s_var.
          IF sy-subrc = 0.
            lv_date = l_s_var-low.
            lv_date1 = lv_date+6(2).
            CLEAR l_s_range.
            l_s_range-sign = 'I'.
            l_s_range-opt = 'EQ'.
           Move lv_date1 to l_s_range-low.
            APPEND l_s_range TO e_t_range.
         ENDIF.
        ENDIF.
    ENDCASE.

  • Customer exit and variables

    Hello,
    Before posting this question I've search on the forum and already found part of my needs, but I still miss the end.
    I'd like to create a customer exit to calculate the last day of previous month (this is OK, there are lots of threads regarding this) and another one for last day of previous-previous month (this is OK as well)
    I've done the modifications in CMOD, changed the ABAP code and activated it. I've created 2 variables in Query Designer and now I would like to use them in selections. Here I'm stucked because when I try to select any of my 2 variables to restrict dimensions, I don't get them!
    I've noticed that I'm only able to create text type variable while I would like to create characteristic value type variable. How can I do to do so?
    Thanks for your help,
    Benoit

    Hi benoit,
         Actually you dont know how to create variable.
    For Creating variable on any characteristic, Just select that characteristic, Right click on that, select restrict, and there you can see single value, Variable, favourite etc, there in Variable, right click and create variable.
    Or refer this link.
    http://help.sap.com/saphelp_bw21c/helpdata/en/f1/0a5a2ee09411d2acb90000e829fbfe/frameset.htm
    there go to using variable and variables for Characteristic Value.

Maybe you are looking for

  • Time [ Quota Generation for Part-time employees]

    Hi Experts, I need a help.  I have a following issue. 1] Whenever an employee is marked with a tick '' as Part-time], I want the quota to be generation based on the Weekly workdays [field in SAP WKWDY]. 2]  I used the option of defining reduction rul

  • Recovering from a disk crash

    i experienced a hard disk failure on my MacBook Pro today. at first Safari started complaining it's unable to save bookmarks, then Mail gave errors about not being able to write data. i tried logging out and logging in again with the same account but

  • Photoshop CS5 Crashes on Start Up after Snow Leopard Font Update

    Great! Updated what I thought would be a simple update to the Snow Leopard Font 'thingy' did the update and install then went back to doing some work in Photoshop CS5 - only for it not to boot up as it did fine before... Luckily I still have CS4 inst

  • Youtube streaming issues since latest update

    Hi all, Since the most recent YouTube app update on my iPad Mini i'm having issues streaming to my apple tv (gen2) When the ipad auto locks youtube vids stop playing, i can get around this by turning off auto lock but this never used to occur. Using

  • Table data alignment

    Hello Every one. In Adobe form I created table, if the data exceed to second page the alignment is not proper like I have 3 item details those are printed in right hand side, if the data exceeds second page those 3 item details are printed in right h