Using SAP exit EXIT_SAPLRRS0_001

Hi all,
My requirement is to calculate a query variable value based on the value of 2 other variable values , say i require to calculate "V3 = V1 + V2 ".
In this exit's include - ZXRSRU01, i use
CASE i_vnam.
WHEN 'V3'.
"    LOOP AT i_t_var_range INTO lw_loc_var_to
         WHERE vnam = 'V1'.  " => what i assumed was that lw_loc_var_to-low will hold the actual value of the variable. But this is not the case in real scenario .
I would like to know how do we access query variable values inside the include of this exit ?
Kindly help me solve the issue if you have tried the same.
Thank you all in advance,
Regards,
Asha

HI asha,
you can do one more thing..
populate value of V1 and V2 normally in I_STEP =2 and
calculate V3 in its I_STEP = 3 and use global variables
Code for Such variable is:
INCLUDE ZXRSRU01 *
DATA: L_S_RANGE TYPE RSR_S_RANGESID.
DATA: LOC_VAR_RANGE LIKE RRRANGEEXIT.
CASE I_VNAM.
WHEN 'V1'.
    IF i_step = 2.
      LOOP AT i_t_var_range INTO loc_val_range
                     WHERE vnam = 'v1char'.
        EXIT.
      ENDLOOP.
      IF sy-subrc EQ 0.
        loc_val_range-low = l_s_range-low.
        gl_variable  = loc_val_range-low ''''gl_variable is global variable
      ENDIF.
      l_s_range-sign = 'I'.
      l_s_range-opt = 'EQ'.
      APPEND l_s_range TO e_t_range.
    ENDIF.
WHEN 'V2'.
    IF i_step = 2.
      LOOP AT i_t_var_range INTO loc_val_range
                     WHERE vnam = 'v2char'.
        EXIT.
      ENDLOOP.
      IF sy-subrc EQ 0.
        loc_val_range-low = l_s_range-low.
        gl_variable2  = loc_val_range-low ''''gl_variable2 is global variable
      ENDIF.
      l_s_range-sign = 'I'.
      l_s_range-opt = 'EQ'.
      APPEND l_s_range TO e_t_range.
    ENDIF.
WHEN 'V3'.
    IF i_step = 3.
      l_s_range = gl_variable + gl_variable2
      l_s_range-sign = 'I'.
      l_s_range-opt = 'EQ'.
      APPEND l_s_range TO e_t_range.
    ENDIF.
ENDCASE.

Similar Messages

  • How to create/use SAP Exit variable of Query designer

    Hello experts,
    Can you please guide me on how to create/use SAP Exit variables ?
    Is there any way we can transport customer exit include in which we write all codes related to customer exit variables?
    Kindly provide your valuable inputs on this.
    Thanks,
    Mitesh

    Hello Gautam,
    I think you should first implement the user-exit via the transaction SMOD/CMOD and the SAP-Enhancement RSR00001 User-Exit ( BW Reporting )
    For the concrete implementation I would suggest to encapsulate the variables, as it is described here
    Easy implementation of BEx-Userexit-Variables
    and here: BEx-Userexits reloaded
    Kind regards,
    Hendrik

  • Using SAP Exit Variable twice on the same report

    Hello all,
    I need to use the same variable -Current Calendar Day (SAP Exit)- to filter against 2 characteristics on the same report.
    Unfortunately it's not possible, here the error:
    " Variable 0DAT is used in both (structure) element 11T4741S4XTWZUAJ9IQ6DUDE1, and element AZLK9YCS4XGJ940MRPMLXMDS9 for various characteristics (ZCBBIDATE, ZCBPHTDT). This is not permitted as the characteristic is required for the F4 value help structure."
    May you please suggest me a way to do it ? Thanks in advance.

    Hi
    As the 0DAT varaible check the other standard varaible which provides the same function in business content.
    Or create a varaible with Customer exit and use it.
    In CMOD write the code in like this
    WHEN 'ZDAT'
    L_ZDAT = Sy-datum.
    L_S_RANGE-low = L_ZDAT.
    and follow the other codes as you define for other varaibles.
    REgards
    M.A

  • Error when using SAP Exit Variable for Current Fiscal Period (0FPER)

    Hi Friendz,
    My requirement is to execute a query for the current fiscal period. I am using the SAP Exit Variable 0FPER.
    I placed this variable on char. Fiscal year/period 0FISCPER.
    When I execute the Query, it is returning the error: No value could be determined for variable ZVBSYCUR; Variables Contain Invalid Values.
    Please give inputs on how to use this variable.
    Regards...
    Ganesh

    Hello Dipika,
    I am also getting the same error.
    ERROR: Variable 0FPER could not be replaced.
    Yesterday we created one customer exit. But this should not affect the SAP Exit right? Till yesterday the 0FPER variable was working fine. I tried re-installing from BI content, but still getting the same error. If anybody has a clue please let me know.
    Thanks,
    Harshal

  • SAP EXIT Variable 0FYEAR is not working for Fiscal Year(OFISCYEAR)

    Dear SDN,
    I have created Simple Query.
    ROWS
    Company code(0COMP_CODE)
    Fiscal Year(0FISCYEAR)
    Columns
    Total Debit postings(0DEBIT)
    Total Credit posting(0CREDIT)
    Filters
    Companycode(Variable Selection option)
    Fiscal year(Varialbe SAPEXIT 0FYEAR)
    Fiscal Year Variant(K4)
    After executing the query in the variable screen only company code is displayed.
    SAP EXIT FISCAL YEAR VARIALBE(0FYEAR) IS NOT WORKING.....
    Is there any setting or activation is required to use SAP EXITS?
    Waiting for Solution......
    Thanks & Regards,
    Praveen.K

    Hi
    In this case you will have to use a Customer Exit (which is Ready for Input) Variable which gets Current Fiscal Year as a Default Value.
    In order to do that - you will need to create a Customer Exit Variable which is Ready for Input. The Variable will have to be assigned with Current Fiscal Year under I_STEP 1 (this refers to the coding of the Customer Exit in T-code: CMOD)
    If you need any help with the coding - don't hesitate to ask.
    Yaniv

  • To use a Sap Exit variable in a diferent infoobject of the same type

    Hi gurus,
      I have the Sap Exit standard variable 0P_KEYDT in the infoobject Posting Date (0PSTG_DATE), and i need use this variable with the Document Date (0DOC_DATE), but i don´t have it in the infoobject. Both infoobjects are referenced by 0DATE.
    Are there some way to copy the variable from one infoobject to other, or i need make my own exit?
    Thanks in advance and regards.

    If both of them are the same type means they are referring to 0DATE, then you should be able to access the standard variable defined. What you need to do is, delete the variable  and recreate it, but when you recreate the variable don't refer to a characteristic 0PSTG_DATE but refer to date object so that it will be available to all date types.
    I will tell you the side effect of doing this, changing the standard definition is always risky because if someone install the object again, then the change you made will be overwritten and hard to know what happened.
    thanks.
    Wond

  • Combine two reports in query designer using key figure with sap exit

    Hi experts,
    i want to combine two reports in query designer using key figure with sap exit
    in the report 1 key figure calculation based on the open on key date(0P_DATE_OPEN)
    to calculate due and not due in two columns
    in report 2 key figure calculate in the time zones using given in variable Grid Width (0DPM_BV0) like due in 1 to 30 days, 31 to 60 days...the due amount based on the open on key date(0P_DATE_OPEN)
    to calculate in 1-30, 31-60, 61-90, 91-120, 121-150 and >150 days in 6 columns
    now i have requirement like this
    not due, 1-30, 31-60, >60, due,1-30, 31-60, >60 in 8 columns
    or
    not due, due, 1-30, 31-60, 61-90, 91-120, 121-150 and >150 in 8 col
    thank you

    Hi Dirk,
    you perhaps know my requirement,
    for the management to make used in one report,
    we have in reporting finacials Ehp3.
    Vendor Due Date Analysis - which show due, not due
    Vendor Overdue Analysis - show only due and analysis in time grid frame
    i want to combine in one report that show NOT DUE, DUE, DUE time frames in grid.
    krish...

  • SAP Exit Variables changes using FM RREX_VARIABLE_EXIT

    Hi BW Group:
                I am trying to made some modifications on Dates fields and for that I created variables as SAP Exit.
    In the code of the standard FM RREX_VARIABLE_EXIT appear a part to include the code for the new variables as RSVAREXIT_XXX_YYY.
    Does any one in the group use a SAP Exit variable before? Do you need to code in this FM?
    Thanks in advance.
                      Norge

    Hi,
      Please chk this URL , hope it may help u .
    http://help.sap.com/saphelp_bw21c/helpdata/en/f1/0a56a7e09411d2acb90000e829fbfe/content.htm

  • Subject: Where are SAP Exit Variables and how to use them in Bex Query

    I have seen references to variables:  0cyear (Current Year), 0CALYEAR (current year), oCALMONTH (Current month/year).
    Under 0CALMONTH characteristic or 0CALYEAR I do not see any of the variables, so how does
    one use these variable in the query. For example I want to create a restricted key figure:  Duration restricted by Current calendar year (e.g.  2009 if I am in 2009, 2010 if I am in 2010..).

    Thanks a lot. Actally, I was looking in my production system and under varaiables I did not find any SAP Exit variables,
    but in development envrionment I do see some.
    Why will it not show me these variables in production? Is it because:
    1. Some special premssion is required to view this type of variable
    or
    2. THese varaiables were not installed from Business Content
    It is hard for me to beleive, it is permission issue.

  • Give me details about  customer exit, sap exit using characterstics variabl

    give me details about  customer exit, sap exit using characterstics variable

    Hi,
    Customer Exit:
    http://help.sap.com/saphelp_nw04/helpdata/en/f1/0a56f5e09411d2acb90000e829fbfe/content.htm
    SAP Exit:
    http://help.sap.com/saphelp_nw04/helpdata/en/f1/0a56f5e09411d2acb90000e829fbfe/frameset.htm
    Characteristic Variables:
    http://help.sap.com/saphelp_nw04/helpdata/en/5c/8db07d555411d189660000e829fbbd/frameset.htm
    SAP and Customer Exit:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f1a7e790-0201-0010-0a8d-f08a4662562d
    Some Imp Docs:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/650ee690-0201-0010-4bb7-83c3e2a74039
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/009819ab-c96e-2910-bbb2-c85f7bdec04a
    Assign points if these are helpful.
    Rgs,
    I.R.K

  • Standard SAP EXIT on Text Variables

    Hello Experts,
    I am working on Customer Aging Analysis. first of all I want to use standard SAP Queries and want to have a look on standard SAP EXIT created on variables.i have opened the query no 0FIAR_C03_Q0005. here it shows me one text variable 0P_KEYD2. now i want to see that SAP EXIT created on the variable of Posting Date.
    I went to SE37. i entered the Function Module EXIT_SAPLRRS0_001. but i didn't get standard SAP EXIT given by SAP.
    Can anyone tell me from where i can activate or Get the standard SAP EXIT ?
    Regards,
    Komik Shah

    Hi Mansi,
    Thanks for your reply.
    now if i want to add that SAP EXIT in EXIT_SAPLRRS0_001, then can i add it ? or do i have to directly use RSVAREXIT_0P_KEYD2 ??
    All standard SAP EXIT will work the same way you  mentioned ?? means goto SE37 --> type Variable Name --> get that exit.
    Regards,
    Komik Shah

  • Raising an expection in variable exit: exit_saplrrs0_001

    Hi,
    The SAP documetation states:
    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.
    My question, how do I raise an exepction in this function module, there doesn't seem to be any exepctions defined in the interface?
    Regards,
    Ola

    Hi,
    Eg: I have a requirement to restrict the user entry for a variable in report for any date range of 12 months window. In case, user entry is more than 12 months of date range then it should raise a message on report screen.
    CALL FUNCTION 'RRMS_MESSAGE_HANDLING'
              EXPORTING
                I_CLASS  = 'CD'
                I_TYPE   = 'E'
                I_NUMBER = '121'
                I_MSGV1  = 'Enter value for Created On'
             i_msgv2  = '<Message part 2>'
              EXCEPTIONS
                DUMMY    = 0
                OTHERS   = 0.
          RAISE NO_PROCESSING.
    http://help.sap.com/saphelp_nw70/helpdata/EN/1d/ca10d858c2e949ba4a152c44f8128a/content.htm
    How do you use i_step=3 in global variable user exit (EXIT_SAPLRRS0_001)
    RRMS_MESSAGE_HANDLING in I_STEP3 of User Exit
    Regards,
    Suman

  • ABAP  Code for SAP exit varaibles?

    Hi,
    i) Where can I find the abap code for SAP exit variables
    OP_KEYDT used for the net due date
    OP_KEYD2 used for the posting date
    OP_KEYD3 used for the clearing date, which are used in FI AR aging report(0FIAR_C03).
    Based on the Net Due Date, which is key date(0NETDUEDATE), entered by the user at runtime, the posting date and celaring date are populated.
    II) The problem is we want to simulate a similar scenario, but with key date, which user enters is based on the custom Net Due Date(ZNETDUEDATE).And this date is populated to posting date and clearing date variables.
    How do we acheive that.
    Thanks.

    Hi Kumar,
    Try this below mentioned example where default date is current date.
    Step1: Create a variable(ex: cur_date) on requrired characteristic with Processing type "Customer Eixt" and check the check box for ready for input(if this variable need in selection screen).
    Step 2: Goto T Code : CMOD and provide appropriate Project and choose components and click on display.
    Step3: Double click on exit "EXIT_SAPLRRS0_001" you can see include "ZXRSRU01", double click on include.
    Step4: Sample code to populate.
    WHEN 'CUR_DATE'.
    Data : l_p_range_SSS TYPE rrrangesid.
    IF I_STEP = 1.
    l_p_range_SSS-Low = sy-datum.
    l_p_range_SSS-Sign = 'I'.
    l_p_range_SSS-Opt = 'EQ'.
    APPEND l_p_range_SSS TO e_t_range.
    Endif.
    The following values are valid for I_STEP:
    · I_STEP = 1
    Call up takes place directly before variable entry
    · I_STEP = 2
    Call up takes place directly after variable entry. This step is only started up when the same variable could not be filled at I_STEP=1.
    · 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.
    · I_STEP = 0
    The enhancement is not called from the variable screen. The call up can come from the authorization check or from the Monitor.
    Also, refer this link..
    http://help.sap.com/saphelp_bw320/helpdata/en/1d/ca10d858c2e949ba4a152c44f8128a/content.htm
    Cheers,
    Allen

  • "Customer Exit", "SAP Exit"

    Hi,
    In BEx, while creating a new variable, I see the options such as "Customer Exit", "SAP Exit" etc. What is the purpose of these options and what functionality do they provide?
    Reg,
    Sbastian

    Customer exit are used to automaticcaly fill variable value.You can check the code as follows:
    GO to SE37
    Enter EXIT_SAPLRRS0_001
    Double Click ZXRSRU01 .
    Check where your varible's code is embedded. If you don't know where it is, try doucle clicking on the INCLUDEs and your code should start with WHEN <your variable name>.
    Hope it helps.
    Regards

  • Current Workday SAP EXIT variable not aligned with correct work days

    Hello,
    I am trying to use the Current Workday variable within a report so that the data will only be refreshed when the calendar day is Monday - Friday. Users look at this report every day, but when they get the report on Monday we would like for the date to be restricted to the previous Friday, and then switch back to Monday's date when they view the report on Tuesday. In order to do this we have placed the Current Workday variable from the Calendar Date characteristic with an offset of negative 1, but it is showing Sunday's date when they look at the report on Monday.
    My questions are:
    -Does this variable use the factory calendar that can define the work days?
    -If so, which Factory calendar does it use? I have gone to the Tcode SCAL but I can see there are many different factory calendars and I have no idea which calendar this variable pertains to. I have also transferred the global settings for the factory calendar from the source system, and I see no change within the variable.
    -How can I see the program name behind this SAP Exit variable? My thinking is that I could at least look at the code to see if perhaps I can find out the factory calendar ID the variable refers to from there.
    Any help on this would be greatly appreciated! Until this is fixed I have to manually adjust this report every Monday and Tuesday morning!! Not ideal.

    Hi Kelly,
    I am not sure whether this can be done by an SAP Exit variable.
    But you may try this using a Customer exit variable by using the Function module DATE_COMPUTE_DAY.
    The function module "DATE_COMPUTE_DAY" will return the day by 1 to 7 when you input date.
    Monday : System will return value = 1
    Tuesday : System will return value = 2
    Wednesday : System will return value = 3
    Thursday : System will return value = 4
    Friday : System will return value = 5
    Saturday : System will return value = 6
    Sunday : System will return value = 7
    So input sy-datum to this FM and find the number of day. If it is Monday, the number will be 1.
    If output is 1, then offset date by -3 to that of Friday, else offset by -1 to previous day.
    Hope this helps,
    Regards,
    Hari

Maybe you are looking for