About Replacement Path, Text Variables & Cusomer Exit?

Hi
Please explain along with examples youwhen we use Replacement Path
                                               Text Variables and
                                               Customer Exit
Please search the forum before posting a thread
Edited by: Pravender on Apr 18, 2011 3:48 PM

Hi,
1. Customer EXIT :
Business Scenario:
The business department wants to check if the orders from the customers for a  certain week (e.g. 6 weeks from now) are already transmitted into their system. Therefore they run a report with a variable, that is calculated automatically.
Note: Of course this is not the only suitable solution, but it will show you how the exit works.
Step by Step Solution:
A.You should create a variable on the info object 0CALWEEK like this:
 1.Technical Name: WS_FWEEK
2.Description: Workshop Future Week
3 Interval
5.Mandatory variable entry
6.Processing: Customer Exit
7.NOT ready for input
B.Call transaction CMOD for the definition of the customer exit.  
C.Create a new project, maintain the short text and assign a development class.  
D.Go to Enhancement Assignments and assign RSR00001. Press the button components to continue.  
E.Double-click on EXIT_SAPLRRS0_001.  
F.For documentation place the cursor an RSR00001 and use the menu GoTo => Display documentation.   
G.Then double-click on ZXRSRU01.  
H. If the include does not exist, you have to create it; assign a development class and a transport request
Enter this code:
INCLUDE ZXRSRU01                                        *
  data: l_idx like sy-tabix,
        workdate(8) type d,
        futureweek(6) type c.
  DATA: L_S_RANGE TYPE RSR_S_RAGESID.
case I_vnam.
when u2018WS_FWEEKu2019.
if i_step = 2          u201C after pop-up
Calculate Current day plus 6 weeks:
  workdate = sy-datum  + 42 .
Calculate the week of this day
  CALL FUNCTION 'DATE_GET_WEEK'
    EXPORTING
      DATE               = workdate
    IMPORTING
     WEEK               = futureweek
EXCEPTIONS
  DATE_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.
  l_s_range-low = futureweek.
l_s_range-high =
  l_s_range-sign = 'I'.
  l_s_range-option = 'EQ'.
  append l_s_range to l_t_range.
  p_subrc = 0.
ENDIF.
ENDCASE.
I.Save and activate the codie 
J.Activate the project. (Very important!)
K. Define a query using the above created variable.
L.For displaying the variable values in the executed query you also may define two text variables. These should, if necessary, be able to show the lower and the upper value calculated by the customer exit.
2 Replacement Path :
Example for filling variable values depending on an other variable /
Deriving one variable value from another variable
Business scenario.
A query should show in one column the value for one period. The period should be entered by the user. In the second column the accumulated vale from the beginning of the year to the period of the first column should be displayed. The InfoCube contains only the InfoObject 0CALMONTH (Month/Year) and not single InfoObjects for period and year.
Solution:
For this scenario we need four variables: two variables for the column text and two variables for the period values. One of these period variables is defined as a variable with a customer exit
Step by Step Solution:
Create an input variable u201CMONTHu201D (you need this specific information for the coding example below). The variable is based on the InfoObject 0CALMONTH. Set the following attributes:
Single Value
Ready for input
Mandatory variable entry 
Create a variable  u201CCUMMONTHu201D (you need this specific information for the coding example below) with a customer exit as a processing type. The variable is based on the InfoObject 0CALMONTH. Set the following attributes:
Interval
NOT ready for input!
Mandatory variable entry
Create two text variables. Both variables use the u201CReplacement Pathu201D as processing type. The first text variable is filled with the text from the u201Cfrom valueu201D. The second is filled with the text from the u201Cto valueu201D.
Enter this code
INCLUDE ZXRSRU01                                        *
DATA: L_S_RANGE TYPE RSR_S_RAGESID.
DATA: LOC_VAR_RANGE LIKE RRRANGEEXIT.
case I_vnam.
when u2018CUMMONTHu2019.
if i_step = 2          u201C after pop-up
LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
          WHERE VNAM = u2018MONTHu2019.
     CLEAR L_S_RANGE.
l_t_range-low = loc_var_range(4).  u201Cgetting current year
l_t_range-low+4(2) = u201801u2019 u201Csetting 1st period in cur. year
l_t_range-high = loc_var_range-low u201Chigh value=input value
l_t_range-sign = 'I'.
l_t_range-option = 'BT'.
append l_s_range to e_t_range.
exit.
endloop.
endif.
endcase.
Save and activate the code.
Activate the project.
Define a query containing all the variables.
Regards
CSM Reddy

Similar Messages

  • Text Variable(Customer Exit) displays variable name instead of its value.

    Hi Gurus,
    My requirement is to display the year(from variable) as the field name i.e Year end salary 2009.
    I was using the fields name as hardcoded values like 2009 but as per my requirement i need to display it from the variable.
    I tried using Text Variable using customer exit, but I'm getting variable name(zvariable) instead of value(2009).
    Please help me out, many thanks in advance.
    Regards,
    Ankur

    Hi,
    Actually I tried to create a Text Variable with Replacement Path.
    But here the problem is that we have a Characteristic Variable (Customer Exit) which is not listing in the selection box of Replacement Path.
    Hence we tried to create another Text Variable (Customer Exit) and refering to the same Customer Exit code.
    Regards,
    Ankur

  • Need some clarification on Replacement Path with Variable

    Hello Experts,
    Need some clarification on Replacement Path with Variable.
    We have 2 options with replacement path for characteristic variables i.e.
    1) Replace with query
    2) Replace with variable.
    Now, when we use  "Replace with variable" we give the variable name. Then we get a list for "Replace with" as follows:
    1) Key
    2) External Characteristic Value Key
    3)Label
    4)Attribute value.
    I need detailed explanation for the above mentioned 4 options with scenarios.
    Thanks in advance.
    Regards
    Lavanya

    Hi Lavanya,
    Please go through the below link.
    http://help.sap.com/saphelp_nw70/helpdata/EN/a4/1be541f321c717e10000000a155106/frameset.htm
    Hope this gives you complete and detailed explaination.
    Regards,
    Reddy

  • Query - Replacement Path for a Customer Exit Variable

    Hi
    New to the field and the board.  Any and All help is greatly appreciated.
    I have created a query which runs based on a date selection. The query have few customer exit variables whose values are set in ABAP. All Key Figures in the query are brought depending on the date ranges that each of the CE returns. Ex - one column is sales for first 10 days, 2nd for second 10 days, 3rd for first quarter, 4th for 2nd quarter and such.  There are about 20 - 25 columns with KF in the query and all are Customer Exit date driven.
    The challenge:- Each column heading should have the name of the month. I tried using Replacement Path. But it works when the selection is based on a constant value but not on value based on variable which is a customer exit. Ex - If I say restrict Cal/Month for July 2013, the replacement path for the Col Heading works fine. But if I say restrict Cal/Month for "ZVAR_SecondQtr_First_Month" the replacement path doesn't work.
    Help Please
    Thanks
    Vidya

    In the text variable that you are using , i guess you have a replacement path. In this instead of using your characteristic for specifying how the value has to replace, use the variable option and give the variable name there
    http://help.sap.com/saphelp_nw70/helpdata/EN/43/565cd22fc95f6ce10000000a1553f6/content.htm
    Hope it helps
    Regards,
    Rathy

  • Coloumn Headings replace with text variable

    Guys
    I have to display coloumn headings for my key figures to be able to match with the time period selection. Is it I need a text variable and if I do where do i create it and for what charachterstic.
    Also i need to ;pick a variable values  based on other variables in the same query. can i do it through replacement variable or any other ideas.
    thanks

    Hi,
    Yes, you are right you need a text variable in order to display the cloumn headings to match the time period selection.
    Text variables with the processing type Replacement Path are replaced by a corresponding characteristic value. The value of a text variable has to be a text.
    How to create & where to create a variable check here:
    http://help.sap.com/saphelp_nw04/helpdata/en/f1/0a56a7e09411d2acb90000e829fbfe/content.htm
    The Reference Characteristic you can use should be a time characteristic like "cal. year/month". Choose according to your query requirement.
    Hope this helps...
    Cheers,
    Habeeb

  • Replacement path in Variables?

    What is replacement path in reporting?

    Hi,
    There are many scenarios where we use Processing type as "replacement path".
    lets take one example for Formula Variable Replacement Path..
    we have a material price(KF) as display attribute of material. i.e. material price as KeyFigure attribute.
    now u need perform some calculations on material price...for this u rght clcik on u r KF structure --->new formula...but there only formula variables and keyfigures are available for calculations...eventhough matearial price is a Kf but it has been defined as attribute of a characteristic..so its not available for calculations...
    now go with?new formula variable->choose processing type as "replacement path">next->choose characteristc as "material"->next-> replace variable with as " attribute"->next>selct 'material price" from drop down menu.....
    now u have material price formula variable...drag and drop this matraial price into formula window and use it in calculations....
    Hope This Helps,
    Regards,
    rik

  • Replacement Path Formula variable

    Hi
    I have a doubt regarding formula variables created using Replacement Path .
    Suppose I create such variable on some characteristic say A then what will be the value in the variable when the value of characteristic A is '#'  ? Will it be 0 or something else?
    Also what will be the value in the formula variable when A is not equal to # and has some value in it?
    Thanks,
    Ninad

    For formula variable # will be 0.
    Other values are truncated based on your offset start and end of your ref char.
    Hope this helps.

  • Explain replacement path in variables. ,

    hi this is ramireddy.

    Hi ram,
    18. U check the data in the cube using manage option.
    19. When you find some records missing when deltas are running then instead of going for re-init and again deltas you can go for repair full request giving selection conditions for those missing records, without affecting your delta laods
    In Infopackage manage screen in menu bar you have the option to mark the request as repair full request and then you will have selection criteria also in IP.
    20. when one infoobject depends on other infoobject then we go for compounding ex : 0sourcesystem
    21.variableoffset: with variableoffsets u can get data of previous months & next months data from the current data.
    example:if u have six months data in cube.
    now create variable for 0calmonth.
    take offset value as-2&+2.then it gives u previous 2months data andnext 2month data from the current month.
    suppose if u enter 2005 as current month then it for specifying variable offsets it displays 2003&2007 data also.
    22.replacement path is used for trending reports.

  • Text Variables to show Start and End Date of Fiscal Year Period

    Hi,
    I am creating a query that has user enter a starting fiscal year period and posts information by Fiscal Year Period going back 14 periods.  I am able to put the fiscal year period in the heading for all periods, but would also like to add the start and end calendar day for each listed period.  Can that be done using a replacement path text variable or is that something more for a customer exit variable?
    Thanks in advance for any thoughts provided.
    Bill

    Hi,
    This is one of my exit that display the calmonth (offset -12). Usefull when I have to retrieve in a KF a complete rolling year depending one calmonth.
    S_VMUCMN is my selection variable
    S_TXTCMN_M12 is my text variable calmonth-12
    S_TXTCMN_M0 is my text variable for selected calmonth.
    WHEN 'S_TXTCMN_M12'.
        IF i_step = '2'.
          LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'S_VMUCMN'.
            CLEAR l_s_range.
            " First day of the selected month
            CONCATENATE loc_var_range-low '01' INTO l_calday.
            CALL FUNCTION 'YFRBW_FUM_CAL_DATE_IN_INTERVAL'
              EXPORTING
                date      = l_calday
                months    = 12
                signum    = '-'
              IMPORTING
                calc_date = l_calday.
            l_s_range-low = l_calday+0(6).
            l_s_range-sign = 'I'.
            l_s_range-opt = 'EQ'.
            APPEND l_s_range TO e_t_range.
            EXIT.
          ENDLOOP.
        ENDIF.
    Thus, in KF header you have to put the two text variable to display the complete period.
    Hope it helps,

  • Cal year Text Variable Offset

    If you have a text variable based on 0CALYEAR say ZT_CAL as user input, can you have column headings based on an offset from the user input value? For example, the user inputs 2004 and I have 2 columns (current year and prior year). The current year shows up fine based on &ZT_CAL& but I can't make the prior year show up as 2003 using &ZT_CAL-1& or &ZT_CAL&-1.

    Your approach does not work since my key figures are not RKF separately restricted by time. I am familiar with replacement path text variables working with restrictions.See the following typical example from APO:
    Sales - Current year xxx
    Sales - 1 Year Ago xxx
    Sales - 2 years Ago xxx
    All 3 key figures have the same 0FISCYEAR value. So when I run the query I need for the first row (or column) to say Sales - 2004, the 2nd row to say Sales - 2003 etc. based on a variable input of 2004.

  • Date formula variable with replacement path.

    Hi ,
    I have date formula variable with replacement path.
    Variable pop up with date format yyyymmdd. but i want dd.mm.yyyy.
    I have checked my user profile setting and it is dd.mm.yyyy.
    Can u please suggest it .
    Thanks
    Pramod

    Thanks for the rely , but basically i need a variable only for selection.
    thats why i have created formula variable processing my cutomer exit.
    But i think customre exit variable comes with text format .
    any1 has an idea for the same.
    Thanks
    Babu

  • Creating Variable with Replacement Path to get value from ANOTHER Variable

    Hi all,
        Is anyone has created the Variable with Replacement Path to get the value from another User Entry Variable, PLEASE ? 
    First created the User Entry Variable (ZV_X) and it accepts the date range like '01/01/2009 - 01/31/2009'. Next created the Characteristic variable (ZV_Y) of Replacement Path for which source variable will be ZV_X and we should get the 'FROM Date' (01/01/2009) from the selection (ZV_X) into it (ZV_Y).
    While creating the Characteristic variable (ZV_Y) of Replacement Path, I didn't find my newly created ZV_X variable in the list of available variables under 'Variable' header in 'Replacement Path' tab and it is causing the error 'Source to replace variable ZV_Y is not defined'. How could I create the Characteristic variable of Replacement Path for my requirement, PLEASE ?
    The following is from help.sap..com:
    Replace with Characteristic Value
    Text and formula variables with the processing type Replacement Path can be replaced with a corresponding characteristic value. In the variable editor, on the General tab page, you specify under Reference Characteristic the characteristic that is to be referenced by the replacement. On the Replacement Path tab page, you can choose whether the variable is replaced with the From or the To Value and with the Key or the Name of the characteristic value. You can also specify the Offset Start and Offset Length for the output.
    Replace with Variable
    Characteristic value variables, hierarchy variables, text variables, and formula variables with the Replacement Path processing type can take their values from a different variable.
    The following prerequisites need to be fulfilled:
    Variable
    ●      The variable must not be input-ready
    ●      The variable must represent a single value
    Source Variable
    ●      The source variable must not be a hierarchy node variable
    ●      The source variable must be input-ready
    ●      The source variable must be available in the query
    ●      The source variable must represent a single value or an interval
    In the variable editor, on the Replacement Path tab page, you specify the source variable from which the value is to be determined. The value is either determined from the key, the external attribute of the key, the description, or the attribute value. You can specify an Offset Start and an Offset Length for the output here. The variable is replaced on the variable screen upon each data release.
    Thanks,
    Venkat.

    Hi Eve,
    It is possible to connect the 2 queries using a Replacement Path characteristic variable. You would need to create the variable on the char whose values you want to pass from Q1 to Q2. The variable will be of type replacement path and you will need to enter the name of Q1 from which it will get the values. Make sure that you include this char in the query definition of Q1 and Q2. In Q2 you will restrict the characteristic using this variable. DO not use this variable (replacement path) in Q1.
    In your query properties check if you have turned on the checkmark for Release for OLE DB for OLAP (3rd tab). If the check mark is there, then remove it.
    We are using the scenario in a couple of places, and it works very well.
    Hope this helps...

  • Error when using replacement path variable in exception range

    I'm trying produce a check report that produces exception highlighting based on a range determined by the associated characteristic.
    eg.
    For Check 1, highlight cells in red where the associated key figure is between 1 and 999.
    For Check 2, highlight cells in amber where the associated key figure is between -999 and -1.
    Now, I know that the lower and upper limit of an exception can be populated by a formula variable. However, when I create a formula variable that uses a replacement path to fetch the limit values from the associated Check and use that in the exception, the query errors when I try to run it:
    System Error: 'Variable name ( technical name ) does not exist or is incorrectly used 4 New Exception.'
    The error long text suggests that the variable is being used incorrectly, even though it says for Formula variables:
    ... can be used in all cases. Note: Formula variables can have units or be without them. Incorrect use can also arise here since the system always calculates in accordance with the units. Formula variables can also be used to create the upper and lower limits in exceptions.
    In this case, the formula variable does not have units.
    Interestingly, but equally unhelpfully, if a regular constant is used instead of a formula variable for the lower limit, but a formula variable is still used for the upper limit, the error message changes to:
    System error in program SAPLRRI2 and form FAC_VAR_IN_VREP_INSERT-1-
    The query works if the formula variable simply holds a default value, so the problem clearly appears to be with replacement path. If BEx doesn't support replacement path formula variables in exceptions, then aside from the fact that it would be useful if that was stated in the errors, what alternatives, if any, deliver the functionality of exception ranges that change depending on the corresponding characteristic.

    I put in the curly brackets so my formula now reads
    "Total inquiries for " + {CnAttrCat_1.CnAttrCat_1_Description} + ": " + ToText({@InquiryTypeSubtotal})
    Now when I check the formula I get the error message "This field name is not known."
    Alec

  • Replacement path witth text

    hi,
    Here this is balaji.I have a need to work on reporting and reporting with replacement path with text.Anybody please explain me in details wt it does actually , how to use it and how to create it. If u found and have any documents regarding the same please sendit to my mail [email protected] it is an urgent requirement please respond with helpful answer ASAP.
    NOTE:Helpful answers ll be credited with points.
    regards
    balaji

    Hi,
    An application of Replacement path variable can be found here.
    http://www.sd-solutions.com/documents/SDS_BW_Replacement%20Path%20Variables.html
    Another application to get the Document Count: For example Number of Sales Orders.
    Query formula-Counter???
    Example for Replacement Path: Characteristic Variable.
    http://help.sap.com/saphelp_nw04/helpdata/en/2c/78a03c1178ad2ce10000000a114084/content.htm
    Variable Replacement Example
    http://help.sap.com/saphelp_nw04/helpdata/en/af/809528939d5b4fbff7e16a5bdc0d85/content.htm
    Example for Replacement Path: Formula Variable.
    http://help.sap.com/saphelp_nw04/helpdata/en/ca/5f9ac61a205a459d0e7ef313d10321/content.htm
    Hope this helps...Let me know
    Regards
    San!

  • Variable with Replacement Path

    Hi, I have two queries. The results of the first one should be the input for the second one. E.g. the first query shows a list of personnel numbers and additional information. These personnel numbers shall be overtaken by the second query. The personnel numbers belong to "Dimensions" in the Query Designer. I alread tried to create a variable with replacement path to the dimension personnel number. I implementet this variable in both the first and the second query (under: "rows"). It`s no "Formular variable" and no "Calculated Key Figure" but a "Characteristic Value Variable" of a Dimension. The problem is now that I cannot execute any of the two queries. The error "Abort the query cannot be released for OLE DB for OLAP. System error in programm CL_RSR_REQUEST and form PREPARE_VQUERIES:INVALID_
    What is my mistake? Thank you in advance! Eve

    Hi Eve,
    It is possible to connect the 2 queries using a Replacement Path characteristic variable. You would need to create the variable on the char whose values you want to pass from Q1 to Q2. The variable will be of type replacement path and you will need to enter the name of Q1 from which it will get the values. Make sure that you include this char in the query definition of Q1 and Q2. In Q2 you will restrict the characteristic using this variable. DO not use this variable (replacement path) in Q1.
    In your query properties check if you have turned on the checkmark for Release for OLE DB for OLAP (3rd tab). If the check mark is there, then remove it.
    We are using the scenario in a couple of places, and it works very well.
    Hope this helps...

Maybe you are looking for

  • My Ipod 4th Gen will not mount into Itunes

    Please anyone with technical knowledge HELP ME. The basic problem is that my 4th Generation Ipod will not mount into Itunes. Let me tell you what I have done so far this includes all the R's, I have also followed the advice of reinstalling itunes and

  • How can I copy songs from one iPod to another?

    I received a new iPod Classic (last generation) and I'm trying to transfer my songs from my old iPod Nano (also last generation). My iTunes library is also split up between my two parent's houses and I only have half the songs on my Nano in this comp

  • Is There a way I can make a free password protected website with iWeb?

    Hi! I've been thinking to myself, "I want to make a free website". But I want it passcode protected and free. I am a mac kind of person so is there a way I can make a free passcode protected website with iWeb? I knwo you use to be able to do it with

  • Use WS_DELIVERY_UPDATE_2 for Inbound Delivery HU Update?

    Hello all, I have used WS_DELIVERY_UPDATE_2 to successfully update Handling units to Outbound delivery and also perform batch split. Can the same FM be used to update Inbound delivery with Handling units. I will be uploading the HU's through excel fi

  • Syncing with iPad cord to new iPad (3)?

    Can I use my cord from my iPad 1 to sync my iPad (3)?