Explain the customer exit code?

Hi,
Any one explain this customer Exit written for a variable.
When 'Zabcdefg'.
      clear: beg_fiscper, end_fiscper.
      call function 'DATE_TO_PERIOD_CONVERT'
        exporting
          i_date               = sy-datum
      I_MONMIT             = 00
          i_periv              = 'S1'
       importing
         e_buper              = period
         e_gjahr              = year
       exceptions
         input_false          = 1
         t009_notfound        = 2
         t009b_notfound       = 3
         others               = 4.
      if sy-subrc eq 0.
      Period = Period - 1.
        concatenate year period
                     into beg_fiscper.
        concatenate year period
                     into end_fiscper.
      endif.
      clear: l_s_range.
      l_s_range-sign   = 'I'.
      l_s_range-opt = 'BT'.
      l_s_range-low    = beg_fiscper.
      l_s_range-high   = end_fiscper.
      append l_s_range to e_t_range.
Points will be definitely assigend.
Vasu

When 'Zabcdefg'.
clear: beg_fiscper, end_fiscper.
bold A fucntion module whcih converts the given date into the period
call function 'DATE_TO_PERIOD_CONVERT'
exporting
i_date = sy-datum
bold The date passed is the system date.
boldThe other variable values are passed below
I_MONMIT = 00
i_periv = 'S1'
importing
e_buper = period
e_gjahr = year
exceptions
bold Exceptions in case of not found values
input_false = 1
t009_notfound = 2
t009b_notfound = 3
others = 4.
bold checking whether the execution is true and if true, the period is geting a period less minus one which is output from the function module.
if sy-subrc eq 0.
Period = Period - 1.
bold joining the period and year
concatenate year period
into beg_fiscper.
concatenate year period
into end_fiscper.
endif.
bold passing output to the variable in the report.
clear: l_s_range.
l_s_range-sign = 'I'.
l_s_range-opt = 'BT'.
l_s_range-low = beg_fiscper.
l_s_range-high = end_fiscper.
append l_s_range to e_t_range.

Similar Messages

  • How to make BEX Customer Exit Variable inactive through Customer Exit Code

    Hi,
    I had created two variables VAR1 and VAR2 as Customer Exit variables
    If VAR1 is entered then it should automatically make the VAR2 as NO Entry Variable.
    vice versa also required.
    can u help me with any code in CMOD so that we can make it inactive through Customer Exit Code.
    Thanks in Advance.
    Sunil.

    What i want is not commenting the code
    I want to make the BEX Variable as inactive by using the Customer Exit Code
    EX : If value in VAR1 is entered  then VAR2 should become automatically inactive.
           If value in VAR2 is entered  then VAR1 should become automatically inactive.
    how can this be done
    Thanks in advance.
    Sunil

  • Return Custom Exit Code

    Hello Experts,
    We are using Wise Script Wrappers to run Microsoft Updates (KB). Wise Script has Exit Installation Command through which we can control the Custom Exit codes return by the setup (Wrapper) .
    Case 1
    In our case when we use shutdown.exe at the end  after installation of KB's to reboot the machine the exit code reflected in sccm is 0 though we set Exit code 100 in Wrapper.
    Case 2
    When we dont reboot at the end of installation that is we dont use Shutdown.exe the Exit code return is 100.
    We cannot use Config manager restarts computer due to our business needs
    So Any help will be appreciated on how we can  control the custom exit codes
    Thanks,
    Apppack

    So the real question is why are you using non-standard exit codes?If you do non-standard things, you will get non-standard results.
    As Jérémy pointed out 3010 means "The requested operation is successful. Changes will not be effective until the system is rebooted." There are actually other standard error codes that indicate a pending reboot also but 3010 is the most common. A complete
    list of standard error codes is available at http://msdn.microsoft.com/en-us/library/cc231199.aspx.
    Jason | http://blog.configmgrftw.com

  • Looking for an ABAP-code for the customer-Exit Variable

    Hello,
    I have defined a Variable (Interval) which should be processed through Customer-Exit on characteristic Supplier-Date (date format). This Customer-Exit Variable is called ZDATE.
    We have another time characteristic Fiscal year / period (0FISCPER) which has single mandatory input variable for ex.  003.2011. This input variable is called ZFISCPER.
    Now I have to write an ABAP-Code where the customer exit variable ZDATE is derived (fiscal last year to last period) from input variable ZFISCPER in INCLUDE ZXRSRU01.
    Means when the input variable (ZFISCPER) is 003.2011 then the customer exit variable ZDATE should be calculated in INCLUDE ZXRSRU01 as 01.01.2010 u2013 28.02.2011 (fiscal last year to last period).
    Since I am quite new in ABAP, I will be grateful if you could write me sample ABAP for this.
    Many thanks.

    Hi,
    should be something like:
    DATA: l_s_range TYPE rsr_s_rangesid,
    input LIKE sy-datum.
    When 'ZDATE'
    CONCATENATE '0101' 0FISCPER+3(4)-1 into l_s_range-low. "You get 01012010
    CONCATENATE '01' Fiscper+1(6) into input.                            "You get 01032011
    l_s_range-high = input-1.                                                     "You get 28022011
    APPEND l_s_range TO e_t_range.
    Greetings
    Roman

  • Customer Exit code written at transaction SE38

    I am new to writing ABAP code. I talk to someone on here earlier and they gave me some code that is indented below to determine the last day of the week as a date. I am trying to use this code in a form that is called from a user exit. However, I do not understand what the code is doing. I added some break points and found out the the variables CurDate TYPE SCAL-DATE, and
    CurWeek TYPE SCAL-WEEK never populate with a date or a value. So my first question is why don't these variables populate with a value? My second question is how do I write the final desired value (LastDayOfTheWeek) back to the customer exit variable? My third question is to explain TYPE-POOLS: RSR, RRS0 and how they relate to i_t_var_range, e_t_range, and l_s_range. Are these standard variables used in customer exits or are these custom to the environment that I am working at? I know this is alot to ask, but I have no other place to get information. Thanks for all the help possible.
    -- Ryan
    *& Subroutine pool   ZBW_VAR_WEEKEND
    *& Created By: Ryan Casey
    *& Date: 07/19/2005
    *& Purpose: This function is used to determine the date of the last
    *&          day of the week (Sunday).
    *& Changes:
    PROGRAM  ZBW_VAR_WEEKEND.
    TYPE-POOLS:  RSR,
                 RRS0.
    Form GetWeekendDate  using     i_t_var_range type rrs0_t_var_range
                                   i_step type i
                         changing  e_t_range type rsr_t_rangesid.
                              DATA: l_s_range TYPE rsr_s_rangesid,
                                    CurDate TYPE SCAL-DATE,
                                    CurWeek TYPE SCAL-WEEK,
                                    LastDayOfTheWeek TYPE SCAL-DATE.
                              CALL FUNCTION 'DATE_GET_WEEK'
                              EXPORTING
                              DATE = CurDate
                              IMPORTING
                              WEEK = CurWeek
                              EXCEPTIONS
                              DATE_INVALID.
                              CALL FUNCTION 'WEEK_GET_FIRST_DAY'
                              EXPORTING
                              WEEK = CurWeek
                              IMPORTING
                              DATE = LastDayOfTheWeek
                              EXCEPTIONS
                              WEEK_INVALID.
                              ADD 6 TO LastDayOfTheWeek.
    *&l_s_range-low    = LastDayOfTheWeek.
    *&l_s_range-sign   = 'I'.
    *&l_s_range-opt    = 'EQ'.
    *&APPEND l_s_range to e_t_range.
    Endform.

    Hi Ryan,
    I thought it was related to BW since the message is posted in the BW forum and accordingly suggested a formula in the update rule, so you would not find it as a FM in R/3. The following code should do it.
    data : p_week type KWEEK,
           p_Date type SYDATUM.
    p_week = <incoming value in week of year>
    CALL FUNCTION 'WEEK_GET_FIRST_DAY'
      EXPORTING
        week               = p_week
    IMPORTING
       DATE               = p_date
    EXCEPTIONS
       WEEK_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.
    To get the last day of the week.
    p_date = p_date + 6.
    You can find the available fm in the system from se37 transaction code.
    Cheers, Ashu

  • Customer Exit Code

    Hello Folkes,
    Could some one explain the below code step by step.
    Is there any documentation explaining about L_S_RANGE-LOW ,L_S_RANGE-HIGH, etc How they are related to the customer variable. Please give your suggestions.
    Lets assume variable ZVAR1 is on fiscal year:
    and Lets assume variable ZVAR2 is on fiscal period:
    WHEN 'ZVAR2'.
    IF I_STEP = 2.
    LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
    WHERE VNAM = 'ZVAR1'.
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW = LOC_VAR_RANGE-LOW(4).
    L_S_RANGE-LOW+4(2) = '01'.
    L_S_RANGE-HIGH = LOC_VAR_RANGE-LOW(4).
    L_S_RANGE-HIGH+4(2) = '12'.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'BT'.
    APPEND L_S_RANGE TO E_T_RANGE.
    ENDLOOP.
    ENDIF.
    Regards
    -R

    Hi Rajesh,
    The situation looks for me as following.
    You have a query where the result is shown for the whole fiscal year (fiscal periods from 001 to 012 - most likely with K4 fiscal year variant).
    Since you don't want to manually change the structure of the query (the reporting year) from year to year, you implemented the reporting year variable ZVAR1.
    The user just enters the reporting fiscal year into variable ZVAR1, let's say 200X. The customer exit variable ZVAR2 (of range type) should return the range of fiscal periods to be applied, from 200X01 to 200X12.
    So, the code does the following.
    When the system executes a query containing ZVAR2 (WHEN 'ZVAR2' statement) after the user enters the variable value (IF I_STEP = 2 statement), it searches among the all entered variables values the reference to ZVAR1 variable (LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
    WHERE VNAM = 'ZVAR1'. statement).
    If the system finds it, it tooks the four digits of the entered date (it's the entered year) and adds to it 01 for the low range limit (L_S_RANGE-LOW4(2) = '01'. statement) and 12 for the higher range limit (L_S_RANGE-HIGH4(2) = '12'. STATEMENT) returning in the customer exit variable a range of fiscal periods from 01 to 12 of the reported year.
    The statement L_S_RANGE-OPT = 'BT'.
    means that low and high values of the returned range should be treated as BeTween option, and
    the statement L_S_RANGE-SIGN = 'I'
    means Inclusive.
    So, the variable ZVAR2  returns its range value: BeTween 01 period of the entered year (through ZVAR1) till 12 period of the same year Inclusively.
    It's simple. There is no need to write any documents or howtos.
    For more details you can execute the SMOD t-code in English choosing:
    enhancement = RSR0001
    object components = Documentation
    and pressing Display button.
    Hope it helps.
    Eugene
    The (your) query has a variable that limits the fiscal periods (most likely in columns).

  • How to use Multiple Single Option for selection in the Customer Exit

    Hi,
    How can we handle the multiple single values in the customer exit variable.
    I have a requirement which is as follows -
    Table A fiields -> Field Coach, Partner 2, Relation between PArtner 1 & Partner 2, Valid from, valid to date.
    Table B ->  Service Month, Start Date, End Date.
    Table C -> Billing Date, Execution Partner,cal month /year.
    For the Field coach in TABLE A, multiple Partner 2 are present.
    Report has to be built on Table C.
    User inputs the Service month and Field Coach . User can enter multiple field coach values.
    For the All the Field Coach values entered, corresponding Partner2's have to be found from Table A and to be passed to the Execution Partner in Table C.
    Now if we want to use customer exit variable on the field Execution Partner, how can we handle the Multiple Single selections in the customer exit.
    Thanks,
    Shubham

    Hi,
    While creating the variable you must have to specify multiple value.
    In customer exit
    write code multiple times and append the values.
    For example:
    when 'variable'.
    l_s_range - sign = 'I'.
    l_s_range - OPT = 'EQ.
    l_s_range - LOW = EXECUTION PARTNER 1.
    APPEND L_S_RANGE TO E_T_RANGE.
    l_s_range - sign = 'I'.
    l_s_range - OPT = 'EQ.
    l_s_range - LOW = EXECUTION PARTNER 2.
    APPEND L_S_RANGE TO E_T_RANGE.
    l_s_range - sign = 'I'.
    l_s_range - OPT = 'EQ.
    l_s_range - LOW = EXECUTION PARTNER 3.
    APPEND L_S_RANGE TO E_T_RANGE.
    Regards,
    Ranganath.

  • Problem in transporting the Customer exit variable

    Hi all,
    i have careated a variable to capture the current date in my report, with the processing type, Customer Exit. and, its getting populated fine in my DEV environment. basically, i have to compute the number of days, in which net due date is being compared to the current date.  when i transport this to the QA environment, the values for number of days is gettting some junk value, wherein in DEV its showing the exact values. It seems i have to take cetain measures in transportation of the Customer Exit.
    please advice.
    Thanks in advance
    Sneel

    Hello ,
               In the Quality after you run the report check in the layout option>display text elements> variables and check what value is displayed for the use exit variable , if it is correct then problem may be in the selection you gave when you run the report if the user exit variable value is wrong , then set a break point in the code and run the report from rsrt and check where the error is.
    hope it is clear
    assign points if useful

  • How to write customer exit code to get current user as default in variable

    Hi guys,
           I design a query which has a variable called var_employee , I also set some default values for this variable in query designer. But I would like to set the current user account who logon on (who execute the query) in the dropdownlist as default user when the variable selection screen appear. of course after that he can choose other avaiable value.
          I look up some related threads, all says that this need some customer exit code, and they mention to use CMOD to create the customer exit , but I don't know the detail process, as I am pretty new on this.
         The attribute of the var_employee  variable is :  employee(defined info object by myself) characterstic value, customer exit.
         Can somebody show me the process to create the customer exit, and the apap code in detail if possbile. then I can try.
          Thanks a lot in advance.
    Best Regards,
    Ben

    Hi,
    Please have a look at:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f1a7e790-0201-0010-0a8d-f08a4662562d
    Krzys

  • 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

  • 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 Error

    Hi All,
    i have an issue while executing customer exit code for a query.
    Its giving the following error
    WValue "07.2010" is too long for variable Z_RAPMONTHS
    EValue "07.201" for user-exit variable Z_RAPMONTHS is invalid
    EVariables contain invalid values.
    I>> Row: 82 Inc: LRRMSU13 Prog: SAPLRRMS
    ASystem error in program CL_RSR_OLAP_VAR and form INIT-02- (see long text)
    Requiremnt is: variable value should corresponds to last six months including current month (six months in total), e.g.  if we execute the report today (December month) the desired value should be 07.2010 - 12.2010.
    code which i have written is:
    when 'abc'.
        DATA: curr_month(2) TYPE n,
              calc_month(2) TYPE n,
              curr_year(4) TYPE n,
              prev_year(4) TYPE n.
        CLEAR:curr_month,curr_year,prev_year.
        if i_step eq 1.
          curr_month = sy-datum+4(2).
          curr_year = sy-datum+0(4).
          if curr_month = '01'.
            calc_month = curr_month + 7.
            prev_year = curr_year - 1.
           CONCATENATE calc_month '.' prev_year INTO l_s_range-low.
          else.
            calc_month = curr_month - 5.
          CONCATENATE calc_month '.' curr_year INTO l_s_range-low.
         else.
         l_s_range-low = lv_zp0003_year.
            ENDIF.
      CONCATENATE curr_month '.' curr_year INTO l_s_range-high.
          IF l_s_range-low = l_s_range-high.
              l_s_range-opt = 'EQ'.
            ELSEIF l_s_range-high IS INITIAL.
              l_s_range-opt = 'EQ'.
            ELSEIF l_s_range-low LT l_s_range-high.
              l_s_range-opt = 'BT'.
            ENDIF.
            l_s_range-sign = 'I'.
            APPEND l_s_range TO e_t_range.
    Can any one please let me where i am doing the mistake.
    Thanks & Regards.
    AKG

    remove the '.' from the below concatenate statements.
    CONCATENATE calc_month '.' curr_year INTO l_s_range-low.
    CONCATENATE curr_month '.' curr_year INTO l_s_range-high.
    use the code as
    CONCATENATE calc_month curr_year INTO l_s_range-low.
    CONCATENATE curr_month curr_year INTO l_s_range-high.

  • Execute Process Task - Error :The process exit code was "2" while the expected was "0".

    I am designing a utility which will keep two similar databases in sync. In other words, copying the new data from db1 to db2  and updating the old data from db1 to db2.
    For this I am making use of the 'Tablediff' utility which when provided with server name, database, table info will generate .sql file which can be used to keep the target table in sync with the source table.
    I am using the Execute Process Task  and the process parameters I am providing are:
    WorkingDirectory : C:\Program Files (x86)\Microsoft SQL Server\90\COM
    Executable :      C:\SQL_bat_Files\SQL5\TC_CTI\customer.bat
    The customer.bat file will have the following code:
    tablediff -sourceserver "LV-SQL5" -sourcedatabase "TC_CTI" -sourcetable "CUSTOMER_1" -destinationserver "LV-SQL2" -destinationdatabase "TC_CTI" -destinationtable "CUSTOMER"  -f "c:\SQL_bat_Files\sql5\TC_CTI\sql_files\customer1" 
    the .sql file will be generated at:  C:\SQL_bat_Files\sql5\TC_CTI\sql_files\customer1.
    The Problem:
    The Execute Process Task is working fine, ie., the tables are being compared correctly and the .SQL file is being generated as desired. But the task as such is reporting faliure with the following error :
    [Execute Process Task] Error: In Executing "C:\SQL_bat_Files\SQL5\TC_CTI\package_occurrence.bat" "" at "C:\Program Files (x86)\Microsoft SQL Server\90\COM", The process exit code was "2" while the expected was "0". ]
    Some of you may suggest to just set the ForceExecutionResult = Success (infact this is what I am doing now just to get the program working), but, this is not what I desire.
    Can anyone help ?

    Jwelch,
    Thanks for the input,
    "Change the SuccessValue property of the Execute Process task from 0 to 2 (which means that you will get a failure if there are no differences, since TableDiff returns 0 in that case)."
               -- Not possible b'coz if there is no difference in the tables, which is also a possiblility, the job will fail.
    "FailTaskIfReturnCodeIsNotSuccessValue to FALSE (which means it won't fail regardless of the code returned)."
              -- Does this mean the job will never fail? Lets say the target table doesnt exist, then, by setting "FailTaskIfReturnCodeIsNotSuccessValue to FALSE " will the job fail? I guess my question is, how is what you've suggested different from setting "ForceExecutionResult = Success". Both the cases will show the task status "Success" even if there is an error.
    Is there a way to keep the property of job 'Failure' if there is any generic errors like target table not found or say, the path given for .sql file output is not valid etc.
    Thanks again,
    Little_Birdie.

  • Customer exit code to calculate  Average YTD.

    Hi Experts,
    I want to create new column ( AVGYTD TRGT) in Bex report for folling data .( Which is FF data).
    I have created one formula variable(zfmvavgytd) of type customer exit. and strucked at coding part.
    so that, anybody provide customer exit code for required column(avgytd trgt). and details are as follows.
    0CALMONTH  ENO  ENAME  PERDAY_ TRGT  
    04.2011             1     ABC             100                     
    04.2011             2     BCD             200
    05.2011             1     ABC             200 
    05.2011             2     BCD             200 
    06.2011             1     ABC             300 
    06.2011             2     BCD             200 
    07.2011             1     ABC             200
    07.2011             2     BCD             200 
    till  03.2012        
    Now I want to display the column for ( AVG YTD_TRGT)   based on "0calmonth " & " ENo  "   as below
    AVG YTD_TRGT
    100           
    200
    150
    200
    200
    200
    200
    200
    calculation behind this is...
    for 04 .2011   --empno(1)  ---100/1
    for 04 .2011   --empno(2)  ---200/1
    for 05 .2011   --empno(1)  ---200+100/2
    for 05 .2011   --empno(1)  ---200+200/2
    for 06 .2011   --empno(1)  ---300200100/3
    for 06 .2011   --empno(1)  ---200200200/3
    for 07 .2011   --empno(1)  ---200300200+100/4
    for 07 .2011   --empno(1)  ---200200200+200/4

    First you need to calcualte the YTD and then Average YTD.
    Year to Date (YTD) u2013 From the 1st to entered u201CKey Dateu201D for the current year.
    Average Year to Date - YTD divided by the u201CNo of Daysu201D in year till u201CKey Dateu201D for current year.
    Check the below code for getting Previous YTD....next create a Selection restrict the KF with YTD varaible
    Below is sample code for reference.
    to calculate "Previous year to date" (User input Calday u2013 key date)
    WHEN 'ZDAYPYR'.
    IF I_STEP = 2. "after the popup
    LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
    WHERE VNAM = 'ZPDATE'.
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW = LOC_VAR_RANGE-LOW.
    L_S_RANGE-LOW(4) = L_S_RANGE-LOW(4) - 1. "low value previos year
    v_loc_date = L_S_RANGE-LOW. "take input value in another variable
    L_S_RANGE-LOW+4(4) = '0101'.
    L_S_RANGE-HIGH = v_loc_date. "high value = input, taken into another variable
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'BT'.
    APPEND L_S_RANGE TO E_T_RANGE.
    EXIT.
    ENDLOOP.
    ENDIF.

  • Sample of plan version customer exit code

    Hi! We have a requirement for Forecast accuracy report to be able to report comparison of current actual v current month forecast and
    forecast 1 month ago, forecast 2 months 2 up to 12 months ago. I'm using Calculated/Restricted Key figures with variables "0FISCYEAR & and 0P_FYEAR" with offset and plan version variable 0VERSION & OP_VERS3 but not restricted. The offset for period/year works but not sure how to link it to a plan version specific to period/year. We don't want the variable for plan version to be fixed. We would like to pull the values of the Cal./Rest key figures for period/year and specific version. In our case, we use versions 1, 2, 3 up to 12 for 2010, and version 1 represents 01/2010 forecast/plan version, version 2 is 02/2010 up to 12/2010 version 12. And for 2011, we use versions 101, 102, 103 up to 112. 101 is version specific for 01/2011, 102 for 02/2011 up to 112 for 12/2011.  Same thing for FY 2012, our versions are 201 (representing version for 02/2012) , 202, 203 up to 212.  We have the same pattern of versions for 2020 as well (starts from 01 to 12; 101 to 112; 201 to 212 up to 901 to 912).
    We would like to be able display the values for 12 rolling months for the version specific to period and year as mentioned above.
    Example - in the query, I enter period/ year "03/2011" and version 103 (which represents the version for 03/2011). The result of the query should show up the following CKF/RKF columns:
    1. Current Actual 03/2011
    2. Current Forecast 03/2011 version 103
    3. Forecast 1 month ago 02/2011 version 102
    4. Forecast 2 months ago 01/2011 version 101
    5. Forecast 3 months ago 12/2010 version 12
    6. Forecast 4 months ago 11/2010 version 11
    7. Forecast 5 months ago 10/2010 version 10
    8. Forecast 6 months ago 09/2010 version 09 up to forecast 12 months ago version 03.
    I think we will need a short coding/customer exit for variable version but donu2019t know what needs to be done if using enhancement.  I created a variable customer exit for plan version "ZVAR_MULTIVERSION_EXIT".  Type of variable is characteristic value, processing type is customer exit, reference characteristic is "0VERSION", other basic settings - multiple values and optional.  Please advise if anything I need to change on the settings for plan version variable.  Then my next question is how to code this scenario or maybe you can provide a sample abap code and how to link the customer exit to the "ZVAR_MULTIVERSION_EXIT" plan version variable.   Please advise and greatly appreciate any help and input you can provide.
    Thanks a lot in advance for your help.
    Ching

    Hi,
    Write the code as follows, it will solve your requirement:
    "Declare work area WA_RANGE with type same as I_T_VAR_RANGE.
    when 'variable_name'.
         IF i_step = 1.
              REFRESH e_t_range.
              data: v_date type sy-datum.
              data: v_mon type I length 2.
              data: v_year type I length 4.
              data: v_month type /bi0/oicalmonth.
              v_date = sy-datum.
              v_mon = v_date+4(2).
              v_year = v_date+0(4).
              v_year = v_year - 1. "Previous Year
              concatenate v_year v_mon into v_month.
              WA_RANGE-SIGN = 'I'.
              WA_RANGE-OPT = 'EQ'.
              WA_RANGE-LOW = v_month.
              append wa_range to e_t_range.
         ENDIF.
    Hope this helps.
    Regards,
    Joe
    Edited by: lazarus_joey on Feb 17, 2012 7:04 PM

Maybe you are looking for

  • Header and Footer in Block ALV Display

    Hi All, My requirement includes to ALV Block List Display with header and footer. I have made two forms TOP_OF_PAGE and END_OF_PAGE . I have pass the form and name of event to an internal table it_events. This it_events[] is then passed to FM ' REUSE

  • I have encountered a different iTunes 7.0 problem from the rest if these

    ok, I have wrapped my brain around this one as much as I care to. here is "MY" problem with the new upgrade. To start, the background info I guess. I opend up my old (6.0 version) and tried to download one of my favorite TV shows (WILDBOYZ)...lol any

  • Execution of a batch file within SSIS fails in Sql Server Agent Job

    Hi All, I have an SSIS Package, which simply runs a batch file , the code for the batch file is MOVE \\cambosnapp01\Claims\Analytics\NICB\CurrentAlerts\* \\cambosnapp01\Claims\Analytics\NICB\AlertsArchive If i run the SSIS package manually it runs fi

  • HELP - all words are getting underlined in red while using yahoo mail. How to fix this?

    I am using Firefox browser and already upgraded to the latest 5.0. While using my yahoo mail all words are underlined in red(it is happening as I write this note). How do I stop this from happening and have just he mispelled words underlined? When th

  • Help with uninstalling "old" Adobe Reader

    Since I trust anything Adobe 100%, I did not hesitate to follow a link (contained in "Adobe for Andoid" email from you to me) to install Adobe Reader on my new NOOK HD+ 32.  IT IS A "BAD" LINK, details were forwarded to Adobe by Chrome Support 7-2-13