Customer Exit (i_step = 1) - Retrieve Variable Value

Hello,
I have BW web report and created customer exit (i_step = 1). The BW Web Report is being called from BSP application and I'm passing variable value on URL.
For example:
/sap/bw/BEx?cmd=ldoc&template_id=Z_JEFF_CLAIM_TEST&VAR_NAME_1=ZAGGET&VAR_VALUE_EXT_1=10310
What I need to do now is retrieve the variable value passed on URL in the custom exit i_step = 1. 
Does anyone know how to do this?
Thanks,
Gary

hi Gary,
can try in variable user exit ZXRSRU01 ?
DATA: LOC_VAR_RANGE LIKE RRRANGEEXIT.
  IF I_STEP = 1.
    LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE WHERE VNAM = 'ZAGGET'.
    .... = LOC_VAR_RANGE-LOW.
    ENDLOOP. 
  ENDIF.
hope this helps.

Similar Messages

  • Issue with customer exit for copying one variable value to another

    Hello Gurus,
    I need to copy the value of a single value variable into another single customer exit variable.
    I coded as below.
      WHEN 'customer_exit_var'.
        IF I_STEP = 2. "after the popup
          LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
          WHERE VNAM = 'user_input_Variable'.
            CLEAR L_S_RANGE.
            L_S_RANGE-LOW = LOC_VAR_RANGE-LOW.
            L_S_RANGE-HIGH = ''.
            L_S_RANGE-SIGN = 'I'.
            L_S_RANGE-OPT = 'EQ'.
            APPEND L_S_RANGE TO E_T_RANGE.
            EXIT.
          ENDLOOP.
        ENDIF.
    I used the condition <= for the customer exit variable in the report. But, it is considering only single value, but not all the values <= to the give value.
    Please help me in this regard,
    Thanks,
    Aarthi.

    Thanks for your immediate response Govind.
    My report is restricted based on two dates. Date1 and Date2. Need to consider all records whose dates are <= Date1 and <= Date2.
    Date1 and Date2 should have same values. But user inputs only Date1.
    So, I created Date1 as Single, User Input Variable restricted the query with <=Date1.
    Next I created Date2 as Single, Customer Exit Variable and restrcited the Query with <=Date2.
    In CMOD I used the above code to assigne Date1 Value to Date2.
    When I execute the report, say I give todays date in the report (Dec, 12, 2007). Date2  has to consider all the values <= Dec 12, 2007. But, in my case it is considering only Dec 12, 2007, but not the before dates.
    So, Please help me in solving this problem.
    Thanks,
    Aarthi.

  • BW Variable Customer Exit I_STEP 3

    Can anyone tell me under what circumstances I_STEP 3 is called to validate a variable input.
    Thank you,
    Beat

    Let me try to explain you with an example
    I have the following scenario our fiscal period starts in Oct so it is 001.2005.
    So if a user runs a report in period 003.2005 the report must report for the periods 001.2005, 002.2005 & 003.2005.
    If the user reports in 005.2005 the report must report for the period 004.2005 and 005.2005 which is the second fiscal quarter. Similarly, if the user reports for period 011.2005 it must report for the periods 010.2005 & 011.2005 which is the fourth fiscal quarter.
    Now in order to do this task i used variable exits
    First create a variable of type customer exit and write the code in Program(Include) ZXRSRU01.
    Code looks like this.
    In the code try to put this logic
    dat1 = fisc period u supplied (say 3.2005)
    dat2 = dat1+4(2) " i.e 3
    like this for four querters u have to define and supply the values dat3 and dat1 in low and high selections.
    WHEN 'ZE_CALMT'.
    IF I_STEP = 3.
    If Qarter = 1.
    Concatenate dat1(4) 01 into dat3. " 200501
    dat1 " 200503 which is supplied by user
    elseif querter = 2
    Concatenate dat1(4) 04 into dat3. " 200501
    dat1 " 200503 which is supplied by user
    etc
    L_S_RANGE-LOW = DAT3
    L_S_RANGE-HIGH = DAT1
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'BT'.
    APPEND L_S_RANGE TO E_T_RANGE.
    ENDLOOP.
    ENDIF.
    I_STEP = 3
    In this call up, 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 up again from the authorization check or from the Monitor.
    If you have specific problem please do let me know.
    Regards
    vijay
    Message was edited by: sundaresan chander

  • Bex Customer Exit: I_STEP 2,3 are not getting called up?

    Hi All,
    I need a small help in BEX variable customer exit. I am trying to give an error message on what user had entered on the selection screen. I kept several breakpoints. But I understand that this particular code is calling up only when 'I_STEP = 1'. For I_STEP 2 and 3, the follwong code is not being called? I have seen so many validations happening on user entered values with error messages.. But I am not sure where I am missing?
    Here is my sample code.. can any one extend the help?
    The original requirement is to 'modify' what user had entered. But I understand that SAP is not allowing to modify what user had input.. So thought of giving a small error message.. and not able to do that also.. so I am in this Forum..
    thanks,
    Hari
    When 'ZCATID2'.
    *data : l_year1(4) type n,
          l_year2(4) type n,
          l_text(12).
    data: l_cat(10).
    *IF I_STEP <> 2.
    *RAISE no_processing.
    *ENDIF.
    IF I_STEP EQ 3.
      break-point.
      READ TABLE I_T_VAR_RANGE WITH KEY VNAM    =  'ZCATID2'
      INTO  LOC_VAR_RANGE .
      if LOC_VAR_RANGE-LOW CP '*'.
      message i999(zz) with 'Test'.
      endif.
      break-point.

    Thanks Roberto for this good document to clear my fundamentals. I think I understand the mistake on my code.
    Thanks verymuch for your timely help.
    Best Regards,
    Hari
    ( I looked to give more points to you but it allwoed me only 10 points to give you.). Have a nice day!!

  • Help needed in customer exit code to exclude a value

    Hi Gurus,
    I need to use a Customer Exit Variable to read the values for a characteristic. Based on one indicator I have to include or exclude a value. I am trying to use the code as below. But, it is saying "AError for variable  in customer enhancement ...".
    Code
    the variable is a multiple single values customer exit variable
             zl_s_range-low = z_placc.
             CLEAR zl_s_range-high.
             if z_pl_ind = '1'.
               zl_s_range-sign = 'I'.
             elseif z_pl_ind = '2'.
               zl_s_range-sign = 'E'.
             endif.
              zl_s_range-opt = 'EQ'.
             APPEND zl_s_range TO e_t_range.
    Please help me to solve the issue,
    Thanks in advance,
    Regards,
    aarthi

    Hi Uday,
    Thanks for your response.
    Below is the complete code.
    WHEN 'ZV_CSS11'.
    IF I_STEP = 1.      "Before Pop-up
       select * into table i_tp_tab_pl from /BIC/QZ_TP_PLAC
        where /BIC/Z_TP_PLAC = '11' and
            DATEFROM <= sy-datum and DATETO >= sy-datum.
    if sy-subrc = 0.
         LOOP AT i_tp_tab_pl.
             clear zl_s_range.
             z_placc = i_tp_tab_pl-/BIC/Z_PLACC.
             z_pl_ind = i_tp_tab_pl-/BIC/Z_PGLA_IND.
             zl_s_range-low = z_placc.
             if z_pl_ind = '1'.
               zl_s_range-sign = 'I'.
             else.
               zl_s_range-sign = 'E'.
             endif.
              zl_s_range-opt = 'EQ'.
             APPEND zl_s_range TO e_t_range.
             clear z_placc.
             clear z_pl_ind.
          ENDLOOP.
    endif.
    endif.
    Thanks in advance,
    Regards,
    aarthi

  • Customer Exit to derive formula variable to text variable (BW 3.5)

    Hi gurus,
    I have created a formula variable in a BEX report (BW 3.5) that is fill by the user during runtime.  This formula variable is used in conditions and other key figures in the query.
    What I need now is to use the value given by the user in this formula variable and expose it in a text variable.
    The variable properties are as follows:
    VARIABLE 1: 'MONTOANA'
    Type of variable: formula
    Processing by: user entry
    Variable entry is: mandatory
    Ready for input?  YES
    Dimension ID: Price  (currency: Argentine pesos / Unit: per mil)
    VARIABLE 2: 'TXMONANA'
    Type of variable: text
    Processing by: customer exit
    Variable entry is: mandatory
    Ready for input?  NO
    Dimension ID: Price  (currency: Argentine pesos / Unit: per mil)
    I pretend tu use the value of 'MONTOANA' in the variable 'TXMONANA', so I wrote the following code in transaction CMOD (enhancment EXIT_SAPLRRS0_001, include ZXRSRU01):
    CASE i_vnam.
    WHEN `TXMONANA`.
        IF i_step = 2. "after the popup
          LOOP AT i_t_var_range INTO loc_var_range
            WHERE vnam = 'MONTOANA'.
            CLEAR l_s_range.
            l_s_range-opt = 'EQ'.
            l_s_range-sign = 'I'.
            l_s_range-low = loc_var_range-low.
            APPEND l_s_range TO e_t_range.
            EXIT.
          ENDLOOP.
        ENDIF.
    ENDCASE.
    I'm not getting any result for the text variable.  Could you kindly help me?
    Thanks to all in advance!!!
    LL

    We found the solution with members of our ABAP team.  In the end the issue was due to the type of the field.  The field loc_var_range-low is CHAR 60 so I had to extract the first characters on the right to get the value I wanted to deliver into the text variable.
    Thanks anyway for your help.  Regards, Leticia

  • User exit to check user variable values

    Hi All,
    We have a user exit variable based on CALYEAR (to have the  last year as default value).
    Therefor, the user could choose another value (year)  but not values later than 2 last years.
    For instance, in 2010, the default value is 2010, and the user could choose 2009 or both 2010 and 2009.
    How can we check the user variable entries, and how can we prevent the user to do this.
    In other words, could you please give us the step number when we have put this checking (1, 2 or 3), and
    If itu2019s possible the ABAP programme to do this.
    Thank you in advance.
    Radjech.

    hi Radjech
    you can reach that with the i_step = 3.
    The step 3 is used for validation. This step checks the variable value keyed in by the user to see if you allow him to proceed the query.
    Here is an example.
    This code it to be included after the i_step = 1 where you give the default value of the year.
    Anyway the I_step = 3 is called only once.
    The case endcase is declared for the whole coding in the user exit. So for example you have
    Case i_vnam
    if i_step = 1.
    your treatment for default value.
    Endif.
    Then you give in the below coding.
    if i_step = 3.
    read table i_var_range into s_var_range with key vnam = zvar_calyear. " here I assume you have defined your simple and unique variable with the same technical name.
    if sy-subrc = 0.
    l_queriedyear = l_s_var_range-low(4) " here you retrieve the value of the variable in a local variable.
    endif.
    l_currrentyear =sy-datum(4). " here you take the current date and put it in a variable.
    if l_currrentyear - l_queriedyear > 2. " here you make the comparison of the current system date and the year of the variable. if it is > to 2 then raise the validation
    raise wrong_value. " here you can use  a raise wrong value
    Endif.
    Endif.
    Or you can combine a message with a raise like follows
    therefore example should be
    if i_step = 3.
    read table i_t_var_range into l_s_var_range with key vnam = zvar_calyear.
    if sy-subrc = 0.
    l_queriedyear = l_s_var_range-low(4)
    endif.
    l_currrentyear =sy-datum(4).
    if l_currrentyear - l_queriedyear > 2.
    Call functinn 'RRMS_MESSAGE_HANDLING'
    Exporting
    I_class = 'RSBBS'
    I_TYPE = 'I'
    I_number = '000'
    I_MSGV1 = 'Year value to big'.
    Raise wrong_value.
    Endif.
    Endif.
    eNDCASE.
    Boujema

  • Customer exit code  not  fetching exact value.

    Dear All,
    My requirement is as per the user entry date
    for that date in one column   for that month in one column    for that finacial year in one column
    fo that date it is coming fine
    even for month  when i give 14/06/2010 a user entry data has to come up to 14th of that month in year also from financial year starting to  14/o6/2010.
    for tha i created three varaibles on calday
    as below
    zv_sn_dat  user entry varaible  ready for input
    zv_mtd_dat---- customer exit not ready for input
    zv_ytd_dat----- customer exit not ready for input
    and written the code as below
    for fetching the current date data
        WHEN 'ZV_SN_DAT'.
       IF i_step = 1 .
         CLEAR l_s_range.
         l_s_range-low = sy-datum.
         l_s_range-opt = 'EQ'.
         l_s_range-sign = 'I'.
         APPEND l_s_range TO e_t_range.
       ENDIF.
    For fetchin month to date ( current date)
    WHEN 'ZV_MTD_DAT'.
       DATA : month(2) TYPE n ,
              year(4) TYPE n .
       IF i_step = 2.
         CLEAR : loc_var_range,month,year.
         LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'ZV_SN_DAT'.
           IF sy-subrc = 0.
             CLEAR l_s_range.
             l_s_range-high = loc_var_range-low.
             year = loc_var_range-low(4).
             month = loc_var_range-low+4(2).
             CONCATENATE year month '01' INTO l_s_range-low.
             l_s_range-sign = 'I'.
             l_s_range-opt = 'BT'.
             APPEND l_s_range TO e_t_range.
           ENDIF.
         ENDLOOP.
       ENDIF.
    *(financial year starts from october first)
       For fetching the Year to Data ( Current Date)
    WHEN 'ZV_YTD_DT'.
       IF i_step = 2.
         CLEAR : loc_var_range,month,year.
         LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'ZV_SN_DAT'.
           IF sy-subrc = 0.
             CLEAR l_s_range.
             year = loc_var_range-low(4).
             month = loc_var_range-low+4(2).
             l_s_range-high = loc_var_range-low.
             IF month NE '01' OR month NE '02' OR month NE '03' OR MONTH NE '04' OR MONTH NE '05' OR MONTH NE '06' OR
               MONTH NE '07' OR MONTH NE '08' OR MONTH NE '09'.
               CONCATENATE year '10' '01' INTO l_s_range-low.
             ELSE.
               year = year - 1.
               CONCATENATE year '10' '01' INTO l_s_range-low.
             ENDIF.
             l_s_range-sign = 'I'.
             l_s_range-opt = 'BT'.
             APPEND l_s_range TO e_t_range.
           ENDIF.
         ENDLOOP.
       ENDIF.
    But the month to date even though iam executing from july 1st but for month to date the data is coming is JUne data
    for year also up to may there is no data , but it is showing June data.
    where the code is wrong ,
    please can anybody suggets where i was gone wrong in code.
    or  may be i was gone wrong to create varaibles all te varaibles onot on the calday?
    Thansk & Regarsd,
    sathish
    *ENDCASE.

    In debugging you can check what are the values being assigned to low and high.
    Place check points at places where you assing the high and low values.
    Double click on them during debugging, you can then find out where the logic is not fine.
    Try by commenting out the code where you are initializing the system date to variable.
    Also this would be fine for IF MONTH LT 10 instead of
    IF month NE '01' OR month NE '02' OR month NE '03' OR MONTH NE '04' OR MONTH NE '05' OR MONTH NE '06' OR
    MONTH NE '07' OR MONTH NE '08' OR MONTH NE '09'.
    -Neelesh
    Edited by: Neelesh Jain on Jul 3, 2010 6:57 PM

  • Customer exit not working for variable

    hi ,  i have created the variable with customer exit,options for variable are optional and ready for input checked.when in debugging mode the value in exit i_vnam is having value of the variable but in the second time it dont have.so i cannot go the code after user inputs data. please solve.

    Hi vijay pilli,
    Custome exit means  by writing code you have to populate the value by specifying a value directly or from the user input.
    for example :
    when ever user runs the report he need to see only for that current year sales revenue.So, for this create a variable for 0calyear > customer exit> clear the ready for input>
    here based on sy-datum we will get the current year.
    when variable
    l_s_range-low = Sy-datum+0(4).
    l_s_range-sign = I.
    L_S_RANGE-OPT = EQ
    Append L_S_RANGE TO E_T_RANGE.
    Regards
    Sree

  • How to Retrieve VARIABLE VALUES in an Email Definition Form?

    Hi,
    I have created an email definition. I am getting email notifications on pwd expiry, but I am not able to get the values of the variables that I selected under target & variables part of the form.
    for eg. I have been getting emails in the following format:
    Hi <User Profile Information.First Name>
    The Password of User ID <User Profile Information.User Login> has expired.
    I want the values ofg those variables such as "User Profile Information.First Name" to be retrived an put in the email body.
    Can anybody help me as to how and wat settings need to be made to retrieve those values.
    Thanks,
    Abhishek

    Hi Juan,
    do you have an example for me?
    Thanks
    Achim

  • Retrieve variable value from local Storage and display on canvas

    Hi
    I'm working on a project that has multiple html files (the projects are split into 12 so 12 different edge projects and im linking them via window.open()). I have a variable that keeps track of correct answers stored in LocalStorage html object. I have managed to get the localStorage variable to increment up by one each time the object is correct however my last step is to get the variable and them display the result on the canvas. I have tried
    var outPut localStorage.getItem(' ') method to retrieve the variable then used the set and get method to display the result however it doesn't work. Im not sure if I need a for loop to go though the localStorage and get the elements
    Code:
    // insert code to be run when the composition is fully loaded here
    yepnope({nope:['jquery-ui-1.10.0.custom.min.js','jquery.ui.touch-punch.min.js'],complete: init}); // load the jquery files
    sym.setVariable("myScore", 0);
    var c = localStorage["myCount"] || 0; //loading from localStorage
    function init(){
    sym.getSymbol("barLimit").$('scrubber').draggable({start: function(e){
    },drag: function(e,ui){ // start: ...  // Find original position of dragged image
    var leftLimitScrubber  = sym.getSymbol('barLimit').$('scrubber').position().left; // position of the scrubber
    var rightLimitScrubber  = sym.getSymbol('barLimit').$('leftLimit').position().left;
    var LimitTwoLeft  = sym.getSymbol('barLimit').$('rightLimit').position().left;
    if(leftLimitScrubber == rightLimitScrubber){
      sym.getSymbol('correctBar1').play('in'); //
      sym.getSymbol('nextButton').play('in');
      sym.getSymbol('incorrectBar1').play('out'); //
      sym.getSymbol('thumbsDown1').play('out'); //
      sym.getSymbol('thumbsUp1').play('in'); //
      sym.getSymbol('congrats').play('in'); //
    localStorage["myCount"] = parseInt(c)+1; //Converting string to number, and then saving it
    console.log("numberOfCorrectAnswers", localStorage["myCount"]);
    var finalScore = sym.getVariable("myScore");
    finalScore = c;
    sym.setVariable("myScore", finalScore);
    sym.$("Score").html(finalScore);
    } else if(leftLimitScrubber == LimitTwoLeft){
    sym.getSymbol('incorrectBar1').play('in');
    sym.getSymbol('correctBar1').play('out');
    sym.getSymbol('thumbsUp1').play('out');
    sym.getSymbol('thumbsDown1').play('in');
    axis: "x",
    containment: "parent"
           //for (var i = 0; i < localStorage.length; i++){ // iterate throught the local storage
             //var getItem = localStorage.getItem(localStorage.key(i));
              //if(getItem == 'numberOfCorrectAnswers' ){
    The above is the code for the 12th project in  this projects it needs to display the variable inside the object localStorage and display on the canvas.
    Any help will mean a lot. Thank You in advance
    P.S edge animate has a lot of bugs hard to code in

    what you need to do is to create a text box and set a default value of zero. Once that is don't you need a code on the stage which grabs the value form the localStorage object. I used the .text() jquery method to display the value on the canvas. So the zero will be replaced with whatever the value of the localStorage is.
    You also need a if statement to check if the localStorage is undefined, if its not then grab the value and display on the canvas.
    e.g
    var number = localStorage['finalValue']; // for the sake of completeness I had to put this line of code
    if( number ! = undefined){ // if not undefined so the object exits then ...
         sym.$(' (text identifier) '). text(number); // note text identifier is the name of the text box you create in edge
    } // Done

  • Dynamic text in Web Report (lookup on Variable Value)

    Hi
    If a user specifies a variable value to run a report (say company code), is it possible to have logic which looks up some attribute of company code (let's say country for example) and then displays this as part of some header text above the query results table?
    E.G. Report:
    These results are for country <value>.
    .... col1 col2
    row1 200 300
    row2 100 400
    I've had a look at the Text Element Object, but I couldn't determine if it can be used for this - ?
    I'm not sure I could use a Customer Exit Variable to look up the Country, as what could it be attached to if Country is not in the query/Infocube - ?
    (I have the added complexity of having multiple queries in one Web Report)
    Many thanks in advance,

    Hi,
    I see 2 possibilities:
    - Use a <b>text</b> variable with processing type customer exit in the query title and read the masterdata table in your customer exit depending on the variable value for company code.
    - Create another query (query on masterdata table) with the same variable. This will result in one row returning the (in the query definition) defined attributes.
    Heike

  • Passed i_step = 2,3(Hierarchy Node Variable with Customer-Exit)

    Hellow !
    I want to insert the following ststement to force the variable to be executed with i_step = 2 or 3.
    CASE I_VNAM.
    when 'ZTEST'.
        CLEAR loc_var_range. REFRESH loc_var_range.
        CLEAR: l_s_range, ytest001.
    LOOP AT i_t_var_range INTO loc_var_range.
       SELECT * FROM ytest001
                  WHERE bname = sy-uname
                        AND node   = loc_var_range-low.
            IF sy-subrc = 0.
              l_s_range-low = loc_var_range-low.
              l_s_range-high = '0HIER_NODE'.
              l_s_range-sign = 'I'.
              l_s_range-opt  = 'EQ'.
              APPEND l_s_range TO e_t_range.
             else.
              l_s_range-low = '#'.
              l_s_range-sign = 'I'.
              l_s_range-opt  = 'EQ'.
              APPEND l_s_range TO e_t_range.
             endif.
    ENDLOOP.
    However, Passed customer-exit(Enhancements for Global Variables in Reporting)  i_step =2,3
    Regards,
    Don

    Hi,
    in addition to Anil's valid input, make sure that ZTEST is NOT ready for input. Indeed "ready for input" vars cannot be changed via customer exits.
    hope this helps...
    Olivier.

  • Customer exit variable output error

    Hi gurus,
    I have created one customer exit variable. in the selection screen i am giving multiple plant and material value,
    my code is working for sigle plant and single material.
    when i have taken multiple value. i am getting error message
    error is 'No value determined for th variable"
    When i debug my code in RSRT, it is giving all the values for different combination of plant and material. and those values are getting in the E_T_RANGE.
    but out put it is giving the error.
    my code is:
    WHEN 'ZPRDEMVA'.
        IF i_step = 2.
          READ TABLE I_T_VAR_RANGE INTO LOC_VAR_RANGE
          WITH KEY VNAM = 'ZPRRNDT'.
          v_date = LOC_VAR_RANGE-LOW.
          v_year = v_date+0(4).
          v_month = v_date+4(2).
          v1_date = v_date+6(2).
          v3 = v_year - 1.
          v4 = v_month - 1.
          if v4 = 00.
          v4 = 12.
          v3 = v3 - 1.
          endif.
          concatenate v3 v4 v1_date into ddate.
          CALL FUNCTION 'DATE_GET_WEEK'
            EXPORTING
              DATE         = ddate
            IMPORTING
              WEEK         = zweek
            EXCEPTIONS
              DATE_INVALID = 1
              OTHERS       = 2.
          CALL FUNCTION 'WEEK_GET_FIRST_DAY'
            EXPORTING
              WEEK         = zweek
            IMPORTING
              DATE         = monday
            EXCEPTIONS
              WEEK_INVALID = 1
              OTHERS       = 2.
          sunday = monday + 6.
          v3_date = monday.
          v4_date = sunday.
          LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
                  WHERE VNAM = 'ZPRPLNML'.
          CLEAR L_S_RANGE.
            v_werks          = LOC_VAR_RANGE-LOW.
          LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
                  WHERE VNAM = 'ZPRMATML'.
          CLEAR L_S_RANGE.
            v_matnr          = LOC_VAR_RANGE-LOW.
          data: dummy_menge like i_mseg-menge value '0.01'.
          Do 52 times.
               select MATERIAL PLANT QUANT_B MOVETYPE
                     from /BIC/AWINO0100 into  table  i_mseg
                     where PSTNG_DATE between monday and sunday
                     and   MOVETYPE between 261 and 262
                     and   MATERIAL = v_matnr
                     and   PLANT = v_werks.
                         if sy-subrc NE 0.
                           i_mseg-menge = '0.01'.
                           i_mseg-matnr = v_matnr.
                           i_mseg-werks = v_werks.
                           i_mseg-bwart = '261'.
                           append i_mseg.
                         endif.
            loop at i_mseg.
              itab1-matnr = i_mseg-matnr.
              itab1-werks = i_mseg-werks.
              itab1-menge = itab1-menge + i_mseg-menge.
              itab1-bwart = i_mseg-bwart.
              COLLECT i_mseg into itab1.
            endloop.
            sort itab1 by matnr werks bwart.
            loop at itab1 where bwart = '261'.
              itab2-matnr = itab1-matnr.
              itab2-werks = itab1-werks.
              itab2-bwart = itab1-bwart.
              itab2-menge = itab1-menge.
              read table itab1 with key matnr = itab2-matnr
                                        werks = itab2-werks
                                        bwart = '262'.
              if sy-subrc = 0.
                itab2-menge =  itab2-menge - itab1-menge.
              endif.
              append itab2.
            endloop.
            clear itab1[].
            refresh itab1.
            sunday = sunday + 7.
            monday = monday + 7.
          ENDDO.
          loop at itab2.
            sum1 = sum1 + itab2-menge.
          endloop.
          average = sum1 / 52.
          loop at itab2.
            sum2 = sum2 + ( ( itab2-menge - average ) *  ( itab2-menge - average ) ).
          endloop.
          sum2 = sqrt( sum2 / 52 ).
          l_s_range-sign = 'I'.
          l_s_range-opt = 'EQ'.
          l_s_range-low = sum2.
          Append l_s_range to E_T_RANGE.
          clear itab2[].
          refresh itab2.
          sum1 = 0.
          sum2 = 0.
          monday = v3_date.
          sunday = v4_date.
          ENDLOOP.
          ENDLOOP.
        ENDIF.
    Can any one please help me.
    Thanks in advance.

    Hi Alec,
    i created a customer exit with the formula variable only. in the code i am getting the both quantity and unit fields. now i want to get quantity with unit in output.
    thanks

  • Formula Variable Customer Exit

    Hi Gurus,
    I have a requirement where I have to read the one formula variable value ( Replacement path with attribute value ) into customer exit of another characteristic variable .
    For example :
    I have one characteristic formula variable called VAR1 ( which gives the value ) .This value I want to use it in customer exit of another varable  VAR2 ( is it possible to use one formula variable value into another variable ) which I want to use it in Customer exit.
    VAR1  -  Formula Variable
    VAR2  -  Simple Variable with out User Input.
    Example is as below :
    Formula Variable ( VAR1 i.e PLND_DLVRY )  based on this value I want to define another variable APO Version in the Customer
    If it is possible please guide me what is the process. Also I want to make sure which I_STEP I need to use...
    Please guide the best solution.
    Thanks
    Ganesh Reddy.

    Hi Krishnan / Arvind,
    Sorry I was thinking 0PLND_DELRY is nav attribute for 0MAT_PLANT. But 0PLND_DELRY is the quantity field so I can't make this field as a nav attribute. Right now I am populating directly in the Cube using master data. my cube  data looks like
    Fields Description
    F1 = Version
    F2= Material
    F3= Plant
    F4= 0PLND_DELRY
    F5= Calendar Yr/Month
    F6= Concensus Forecast ( Key Figure )
    Condition is Combination of Material and Plant will define 0PLND_DELRY ( Delivery Time )
    F1  |   F2 |  F3  |  F4   |F5  |   F6
    201104 | M001 |200 |  30 |  2011/07 |  5100
    201104 | M002 |200 |  60 |  2011/07 |  6200
    201104 | M001 |300 |  90 |  2011/07 |  4900
    201104 | M001 |200 |  30 |  2011/07 |  7900
    201105 | M001 |200 |  30 |  2011/07 |  5700
    201105 | M002 |200 |  60 |  2011/07 |  6900
    201105 | M001 |300 |  90 |  2011/07 |  4300
    201105 | M001 |200 |  30 |  2011/07 |  7400
    201106 | M001 |200 |  30 |  2011/07 |  5500
    201106 | M002 |200 |  60 |  2011/07 |  6700
    201106 | M001 |300 |  90 |  2011/07 |  4500
    201106 | M001 |200 |  30 |  2011/07 |  7500
    201107 | M001 |200 |  30 |  2011/07 |  5000
    201107 | M002 |200 |  60 |  2011/07 |  6500
    201107 | M001 |300 |  90 |  2011/07 |  4000
    201107 | M001 |200 |  30 |  2011/07 |  8000
    In Order to bring the variance for F6 for Material M001 and Plant 200 then my result is
    Calendar Yr / Mnth = 2011/07
    Current Value = 5000
    Lead Time = 30,  offset = -1
    Version = 201107-1 = 201106 Then
    Prior Value = 5500
    Variance = 5000-5500 = -500
    for Material M002 and Plant 200 then my result is
    Calendar Yr / Mnth = 2011/07
    Current Value = 6500
    Lead Time = 60,  offset = -2
    Version = 201107-2 = 201105 Then
    Prior Value = 6900
    Variance = 65000-6900 = -200
    for Material M001 and Plant 300 then my result is
    Calendar Yr / Mnth = 2011/07
    Current Value = 4000
    Lead Time = 90,  offset = -3
    Version = 201107-3 = 201104 Then
    Prior Value = 4500
    Variance = 4000-4900 = -900
    for Material M001 and Plant 200 then my result is
    Calendar Yr / Mnth = 2011/07
    Current Value = 4000
    Lead Time = 30,  offset = -1
    Version = 201107-1 = 201106 Then
    Prior Value = 4500
    Variance = 8000-7500 = -500
    Every month we get same data with different version and different numbers for all months. Please advise me what is the best solution we can do
    Thanks
    Ganesh Reddy.

Maybe you are looking for