Virtual KF & CHA (RSR_OLAP_BADI )

HI Gurus,
I implemented the BAdI RSR_OLAP_BADI  to fill virtual keyfigures and characteristics. But somehow it does not work. I coded an endless loop in badi to check if and what it is doing. But apparently the BAdI is not executed when I run the query. Did I missed any step?
Thanks for your support
Aban

Hi.
Have you seen some How-To [like this |http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e051fda8-71a9-2a10-ac9e-8d17414a8c8c?quicklink=index&overridelayout=true] ?
Regards.

Similar Messages

  • Creating BADI for Virtual Key fig: Error: RSR_OLAP_BADI does not exist

    Hi,
    I am following some instructions to test the implementation of virtual key figure and came to the point to create the BADI.
    Intructions on page 5:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e051fda8-71a9-2a10-ac9e-8d17414a8c8c
    SE19
    Create Implementation; New BADI; Enhancement Spot:    RSR_OLAP_BADI
    At this point I get an error that RSR_OLAP_BADI does not exist.
    I then chose at random APB_LAUNCHPAD but this works in the sense that it took me to the next screen
    1. What does it mean by RSR_OLAP_BADI not existing?
    2. I know the instructions points to choose RSR_OLAP_BADI, but why that particular program and how does one gets to know that it is the one to use for virtual key figure/char implementation?
    3. When I tested with APB_LAUNCHPAD, I did not get the same screen on page 5 of the link, is it different for BI 7? Or, am I missing a point?
    Thanks

    Hi,
    thanks for the guidance.
    Yes, I tried to implement exactly as in the article.
    Yes, I defined the filter for the Infoprovider, as ZV*
    Are you suggesting that at this point, if in the method  if_ex_rsr_olap_badi~define, I change the value of
    "ZV_ZIPER" to my DSO or Cube, I should now see the virtual key figure in my query?
    Based on this understanding, I modified the method as follows, (my cube name is 2LIS_11_VASCL):
    method IF_EX_RSR_OLAP_BADI~DEFINE.
      DATA: l_s_chanm TYPE rrke_s_chanm,
      l_kyfnm TYPE rsd_kyfnm.
      FIELD-SYMBOLS:
      <l_s_chanm> TYPE rrke_s_chanm.
    Insert Code
      CASE i_s_rkb1d-infocube.
    CASE i_s_rkb1d-2LIS_11_VASCL.
          WHEN '2LIS_11_VASCL'.
          l_s_chanm-chanm = 'ZVAR_SHPR'.
          l_s_chanm-mode = rrke_c_mode-read.
          APPEND l_s_chanm TO c_t_chanm.
          l_s_chanm-chanm = 'ZVARDT'.
          l_s_chanm-mode = rrke_c_mode-read.
          APPEND l_s_chanm TO c_t_chanm.
          APPEND 'ZV_20DV' TO c_t_kyfnm.
      ENDCASE.
    endmethod. "if_ex_rsr_olap_badi~define
    After activation, I checked the query and still I am not seeing the virtual key figure in the query for selection.
    Any more ideas?
    Thanks
    Edited by: Amanda Baah on May 24, 2009 8:01 AM

  • Virtual Key Figure on Multicube (RSR_OLAP_BADI)

    I've created a virtual key figure (using RSR_OLAP_BADI) for number of days in month [zdays_month].  Everything works perfectly when it's used in a query on a cube cube.  BUT, when I try to use it in  aquery on a multi-cube, it doesn't.  The multi-cube query returns a number = the number of days in the month * the number transactions in that month. 
    Anyone know how I can force the VKF to execute after the data is returned?  I would prefer to not mess with exception aggregation, or key figure properties.  I need to keep this VERY SIMPLE for my query developers.
    Your assistance is greatly appreciated,
    Kenneth

    hi,
    first try to check whether the query access virtual kf or not, use transaction rsrt, type in the query name, and click technical info or properties, there will some line 'virtual char/kf'.
    i think the query may never access the code in BadI because in the code it's set with condition infoprovider technical name, it will cover only the infoprovider, when we access query from multiprovider, which join from one of the infoprovider, it's not automatically have the virtual kf/char, we have to specified the multiprovider name in the BadI, you may change the code as following :
    hope this helps.
    CASE i_s_rkb1d-infocube.
        WHEN '[your infocube name]'.
    ENDCASE.
    to
    IF i_s_rkb1d-infocube = [your infocube name] or
       i_s_rkb1d-infocube = [your multiprovider name].
    ENDIF.
    for other infoproviders
    CASE i_s_rkb1d-infocube.
        WHEN '[other cube name]'
    ENDCASE.

  • RSR_OLAP_BADI for virtual characteristics not getting triggered!!!

    I am facing a strange problem and am a little pressed for time to solve the same. Any help/guidance related to this will be highly appreciated.
    I am working on BI 7.0. I have two implementations of the BADI RSR_OLAP_BADI for virtual characteristics,
    (1) say A, that we implemented as a proof of concept with filter as multiprovider M1
    (2) say B, that in implemented with filter as multiprovider M2
    Both were working fine and I was able to put breakpoints inside the code and debug whenever required. I had used it till last week and everything was fine.
    Today, I had to change implementation B due to a new requirement. So a new characteristic was added to M2 and the code in B was extended at appropriate places to fill this new virtual characteristic also. However, even though the change was successfully activated and the BADI looked fine, it was not triggered when the query was executed. I checked with another query on M2 which was the query for which the implementation was initially made. For that also the BADI is not getting triggered. I put break points in the define, initialize and compute methods but none are hit during the query execution!
    I further ran the queries on M1, which shud have called the implementation A. Then also the BADI is not getting triggered. Please note that implementation A, multiprovider M1 or the queries on it were not changed at all.
    I really need to fix this issue at the earliest. What am I missing? Why are the BADIs not getting triggered eventhough the implementations are active, the BADIs are error free and the filters are correctly defined?
    Are there any global settings that can turn off all BADIs?
    Please help.
    Thanks,
    Sarath

    Further, when I created a fresh BADI implementation in a different system (a sandbox system), the BADI is working fine.
    But in the Development system the BADIs are still not getting triggered. I made the exact same implementation as the one which worked in the different system.
    Another point - when I see the Technical Information tab of queries from RSRT, or RSRT2  they have Virtual Characteristics/Key Figures "NO" in the development system.
    For the queries in the prototype system in which the BADI is working this field in "Y".
    Any idea how this is decided and how it can be changed to Y from NO?
    One more strange thing is that there are other active implementation of this BADI used by other teams here and none of them are getting triggered. They are all active and were all working fine till the last few days!
    Any help will be highly appreciated.
    Thanks,
    Sarath

  • Virtual Key Figures using RSR_OLAP_BADI

    Hi gurus,
    We have been using the RSR_OLAP_BADI to generate some virtual key figures for our queries, now we have a problem creating a virtual key figure...
    We have got 4 key figures in the query, 1 is a normal KF and the last 3 are virtuals, one of the virtuals uses the normal KF and splits it between the total of the same KF. The point here is that the calculations are not coming ok because the COMPUTE method does not bring the information summarized as the KF is defined, because in the same structure of the query ther are some formulas that have the same KF restricted to another level of information.
    If we remove from the query this formulas, the virtual KF works perfect because the normal KF is delivering the information summarized.
    The question is... is it normal that this happened or there may be something wrong in our definition?
    Thanks and best regards to all!!!

    Hi,
    You can get number of threads in SDN search.
    Check in the following blog
    IF_EX_RSR_OLAP_BADI~DEFINE
    https://forums.sdn.sap.com/click.jspa?searchID=23657256&messageID=6776739
    https://forums.sdn.sap.com/click.jspa?searchID=23657256&messageID=6788064
    http://sapbikk.blogspot.com/2008/05/writing-virtual-characteristics-or-key.html
    Thanks
    Reddy
    Edited by: Surendra Reddy on Mar 18, 2009 4:29 AM

  • Virtual Key Figures in RSR_OLAP_BADI COMPUTE Method not recalculated

    Hi,
    Please clarify why is the COMPUTE METHOD of RSR_OLAP_BADI not always 
    triggered or executed.
    For instance, my query is drilled down by customer and
    material by default. Upon opening the query and after entering
    the appropriate selections, the virtual key figures that I have
    used in the query are correct .
    However, if i make any change to the query and run it in RSRT, the BADi method COMPUTE is not executed.
    Is this really the normal behavior of the said BADI? Why is
    it unstable?

    Hi Rohit,
    I have a similar problem the compute method is not trigerring and i am trying to debug it but it is not breaking at all, although when i generate from rsrt it breaks at a breakpoint of define method however i have defined another break at compute method but not breaking.
    I am using the infoobject inside the query but and tried to hard code it  for testing in the compute method but doesnt seem to be getting executed.
    Please help.
    Cheers,
    Jad

  • Virtual Key Figures in RSR_OLAP_BADI not re-calculated correctly

    Hello BW/BI Experts!
        Please clarify why is the COMPUTE METHOD of RSR_OLAP_BADI not triggered or executed
    if you remove a drilldown to a certain characteristic.
        For instance, my query is drilled down by customer and material by default. Upon
    opening the query and after entering the appropriate selections, the virtual key figures
    that I have used in the query are correct .
        However, if you remove the drilldown by customer(for example), the virtual key figure
    is not re-computed. I was able to verify this by setting break-point in the COMPUTE
    method. However, if you drilldown by customer again, the re-calculation for the virtual
    key figure is correct likewise, if you refresh query, the results will be correct.
         Is this really the normal behavior of the said BADI? Why is it unstable? If I will
    use RSR00002(the user exit version), will I not have the same issue?
    Thanks in Advance!

    If I will use RSR00002(the user exit version), will I not have the same issue?
    I dont see any reason why this wouldnt behave the same way.
    I assume from ur post that you need to read ur customer and material to derive ur virtual KF in the BAdi. When you remove the drilldown the customer value is no more available for the exit to calculate  the KF, thats when it throws out a wrong number. I havent seen a work around for this. Please update the form if you find a solution to get the customer values into the exit even after removing the drill down.

  • Virtual Key Fig/Char RSR_OLAP_BADI/ RSR00002

    Hi guru's,
    I am trying to switch from the customer exit RSR00002 to then new RSR_OLAP_BAPI functionily. However, I can't get it working. What I did:
    1. Created Implementation (SE19) ZTEST
    2. Assigned the infocube
    3. Following code in DEFINE:
       METHOD if_ex_rsr_olap_badi~define .
      DATA: l_s_chanm   TYPE rrke_s_chanm,
            l_kyfnm     TYPE rsd_kyfnm.
      FIELD-SYMBOLS:
            <l_s_chanm> TYPE rrke_s_chanm.
      CASE i_s_rkb1d-infocube.
        WHEN 'ZBBC4W_VK'.
    *     characteristic
          l_s_chanm-chanm = 'Z_TESTJK'.
          l_s_chanm-mode  = rrke_c_mode-no_selection.
          APPEND l_s_chanm TO c_t_chanm.
      ENDCASE.
    ENDMETHOD.
    4. Didn't do any thing in INITIALIZE
    5. Following code in COMPUTE:
    METHOD IF_EX_RSR_OLAP_BADI~COMPUTE .
    field-symbols <l_Z_TESTJK> TYPE ANY.
    if P_CHA_Z_TESTJK > 0.
      assign component P_CHA_Z_TESTJK of structure C_S_DATA to <l_Z_TESTJK>.
      <l_Z_TESTJK> = 'TEST'.
    endif.
    ENDMETHOD.
    6. Assigned the following attribute to the Class in (SE24):
    P_CHA_Z_TESTJK Static Attr Private TYPE i.
    7. Included in the Characteristic Z_TESTJK in the cube
    8. runned the report and expected to see TEST for the CHAR. Instead I get # Not Assigned
    Where did I go Wrong????

    Stephan,
    Thanks for your response. Yes I did but it didn't work.
    I defined it as Private because this is the same as in the SAP document: How to… Realize summarized display of stock values on storage
    Any other tips?

  • Calculated virtual characteristic

    Hello,
    I need to create a characteristic which is calculated virtual runtime of the query.
    This must be calculated from an input variable that is associated with the feature query Date Mat., (Which is the condition of the filter (>=)) therefore take out the query all records in the cube whose date of CBs is> = the date entered on screen) and the expiration date of the records obtained at the office.
    As you can see the calculation is done with the same property but using the input variable.
    The code would be:
    No. days = date input variable Mat - date vto.registro read.
    No if days> = 0 or n º days <= 30.
    characteristic virtual = '0 - 30 '
    endif.
    This code is to be implemented in this project or the expansion RSR00002 RSR_OLAP_BADI badi, but what is not very clear to me is like I can read the value of the input variable ..
    Sincerely,

    Hey.  The way I have done this in the past is to catch the variable value in the variables user exit and then store that value to be used/looked up later in the virtual object user exit.
    What you will want to look at is doing an export to memory on the variable value entered (that you get in the variable user exit) and then an import from memory in the virtual exit.  I believe the code syntax is something like...
    EXPORT TO MEMORY xxx ID yyy
    IMPORT FROM MEMORY zzz ID yyy
    Here, xxx and zzz are the fields you are dealing with.  I'm going from memory here, so the syntax may be a little different but the idea is the same.
    Thanks

  • Short Dump ASSIGN_TYPE_CONFLICT in Virtual KF implementation

    Hi
    Iam getting a short dump in my virtual KF code. Here is the code that I have written. If I have only bill date it works fine. The minute I add company code it gives the short dump. Can you pls let me know what is it that Iam doing wrong. any help will be greatly useful. Thanks.
    INCLUDE ZXRSRU02
    DATA: L_S_CHANM TYPE RRKE_S_CHANM.
    DATA: L_SUBRC1 TYPE SY-SUBRC. "execute only, if key figure really used
    CASE I_S_RKB1D-INFOCUBE.
       WHEN '0SD_C03'.
                L_S_CHANM-CHANM = '0BILL_DATE'.
                L_S_CHANM-MODE  =  RRKE_C_MODE-READ.
                APPEND L_S_CHANM TO E_T_CHANM.
                L_S_CHANM-CHANM = '0COMP_CODE'.
                L_S_CHANM-MODE = RRKE_C_MODE-READ.
                APPEND L_S_CHANM TO E_T_CHANM.
                APPEND 'ZCOUNT1' TO E_T_KYFNM.
    ENDCASE.
    *Include ZXRSRTOP*
    DATA : G_POS_0SD_C03_0BILL_DATE TYPE I.
    DATA : G_POS_0SD_C03_0COMP_CODE(4).
    DATA : G_POS_0SD_C03_ZCOUNT1 TYPE I.
    Include ZXRSRZZZ
    FORM USER_0SD_C03 USING I_S_RKB1D TYPE RSR_S_RKB1D
      CHANGING C_S_DATA TYPE ANY.
      DATA: l_zcount1 TYPE int4.
      FIELD-SYMBOLS <L_0BILL_DATE>.
      FIELD-SYMBOLS <L_0COMP_CODE>.
      FIELD-SYMBOLS <L_ZCOUNT1>.
      ASSIGN COMPONENT G_POS_0SD_C03_0BILL_DATE
      OF STRUCTURE C_S_DATA TO <L_0BILL_DATE>.
      ASSIGN COMPONENT G_POS_0SD_C03_0COMP_CODE
      OF STRUCTURE C_S_DATA TO <L_0COMP_CODE>.
      ASSIGN COMPONENT G_POS_0SD_C03_ZCOUNT1
      OF STRUCTURE C_S_DATA TO <L_ZCOUNT1>.
      IF <L_0COMP_CODE> = 'AB99'.
        CALL FUNCTION 'ZCALC_WDAYS_BETWEEN_DATES'
          EXPORTING
            P_DATE1  = <L_0BILL_DATE>
            P_DATE2  = SY-DATUM
            P_CAL_ID = 'Z1'
          IMPORTING
            P_DAYS   = l_zcount1.
        <L_ZCOUNT1> = l_zcount1.
      ELSEIF <L_0COMP_CODE> = 'DC99'.
        CALL FUNCTION 'ZCALC_WDAYS_BETWEEN_DATES'
          EXPORTING
            P_DATE1  = <L_0BILL_DATE>
            P_DATE2  = SY-DATUM
            P_CAL_ID = 'Z2'
          IMPORTING
            P_DAYS   = l_zcount1.
        <L_ZCOUNT1> = l_zcount1.
      ENDIF.
    The short dump:
    ASSIGN_TYPE_CONFLICT
    "CL_IM_RSR_OLAP_BADI===========CP" or "CL_IM_RSR_OLAP_BADI===========CM002"
    "IF_EX_RSR_OLAP_BADI~INITIALIZE"
    get field postions for characteristics in structure
    LOOP AT i_th_sfc ASSIGNING <l_s_sfc>
         WHERE user_exit NE rrke_c_mode-none.
    field name in structure is keyreturnnm
    name of the global variable
      CONCATENATE '(SAPLXRSR)G_POS' i_s_rkb1d-infocube <l_s_sfc>-chanm
          INTO l_global_name
          SEPARATED BY '_'.
    fill the global variable
      UNASSIGN <l_global>.
    >>>>>>>>  ASSIGN (l_global_name) TO <l_global>.

    My suggestion is that you review the how-to papers on SDN regarding exit RSR00002 or RSR_OLAP_BADI.  These are alternative methods of accomplishing virtual characteristics and key figures.  The code you have given is for exit RSR00002 (although it is full of syntax errors so is not executable), but the short dump you are getting refers to RSR_OLAP_BADI, so you must have implemented that Class as well, but incompletely. 
    Which method are you attempting to use?

  • (Request for:) Best practices for setting up a new Windows Server 2012 r2 Hyper-V Virtualized AD DC

    Could you please share your best practices for setting up a new Windows Server 2012 r2 Hyper-V Virtualized AD DC, that will be running on a new WinSrv 2012 r2 host server.   (This
    will be for a brand new network setup, new forest, domain, etc.)
    Specifically, your best practices regarding:
    the sizing of non virtual and virtual volumes/partitions/drives,  
    the use of sysvol, logs, & data volumes/drives on hosts & guests,
    RAID levels for the host and the guest(s),  
    IDE vs SCSI and drivers both non virtual and virtual and the booting there of,  
    disk caching settings on both host and guests.  
    Thanks so much for any information you can share.

    A bit of non essential additional info:
    We are small to midrange school district who, after close to 20 years on Novell networks, have decided to design and create a new Microsoft network and migrate all of our data and services
    over to the new infrastructure .   We are planning on rolling out 2012 r2 servers with as much Hyper-v virtualization as possible.
    During the last few weeks we have been able to find most of the information we need to undergo this project, and most of the information was pretty solid with little ambiguity, except for
    information regarding virtualizing the DCs, which as been a bit inconsistent.
    Yes, we have read all the documents that most of these posts tend point to, but found some, if not most are still are referring to performing this under Srvr 2008 r2, and haven’t really
    seen all that much on Srvr2012 r2.
    We have read these and others:
    Introduction to Active Directory Domain Services (AD DS) Virtualization (Level 100), 
    Virtualized Domain Controller Technical Reference (Level 300),
    Virtualized Domain Controller Cloning Test Guidance for Application Vendors,
    Support for using Hyper-V Replica for virtualized domain controllers.
    Again, thanks for any information, best practices, cookie cutter or otherwise that you can share.
    Chas.

  • What Virtual Characterstic and How to Create it.

    Hi Experts,
    My Requirment is to calculacte age based on DOB at run time.
    One expert in this forum gave me an idea and required code how to achieve it.
    Could you please specifie me on how to
    1) Create Virtual Characterstic
    And he asked me to in SMOD .....how can i do it...please explain me in a bit detail
    Thanks

    Hi,
    Virtual key figures: Will not be stored in the cube. Will be computed at run time when he query is executed. The are virtual in nature and not physical. When you view the cube's contents in listcube, you will not see it there. This is not the same as calc key figures. example: to store sales in your cube and this has o be allocated to all the group companies with a business logic, in this scenario you can code the logic in an exit and derive these virtual key figures. Another example is, when you report on no of days outstanding of your debtors. This will vary depending on when you the run the report. So, a exit can be coded to compute this run time. This is classical example of virtual key figure.
    Virtual characteristics: Same as above. Here you will derive the characteristics while report is run.
    Depending on the requirements, you must decide when to code for a virtual kf or cha and when to store them in the cube physically.
    Virtual characteristics and Key figures are useful if you want to dynamically pouplate data from the fact table to the field.
    Virtual key figures are key figures within an InfoProvider that are not filled with data. Instead the key figure value is determined at runtime of the query using custom ABAP coding
    Check "how to" doc for virtual characteristic/key figure details.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/biw/g-i/how%20to%20use%20variable%20time%20references%20in%20currency%20conversion
    Virtual key figures and charecteristcs are populated at query execution time.
    These virtual objects should be included in the modelling level itself,so that it can be used in the query while using exit in that.
    check this step by step doc:
    https://websmp106.sap-ag.de/~sapdownload/011000358700009299362001E/HOWTOIDENTIFYCOMPRESULTS.DOC
    Regards,

  • Assigning variable values in the virtual key figures Badi

    Hi,
    I'm currently using the virtual chars and key figures RSR_OLAP_BADI to calculate days late as 0NETDUEDATE - sy-datum. This works fine, but the query actually uses variable 0P_KEYDT to determine the key date (set in restricted key figures so not directly).
    I want to use this key date variable value rather than the system date to calculate Days Late in the CALCULATE method of the Badi. In the old user exits I could have retrieved the value from internal table i_t_var_range in the variables user exit ZXRSRU01 and stored it globally.
    Does anyone know how to get a query variable value within the RSR_OLAP_BADI Badi? I've tried using BAPI_REPPROV_GETVARIABLES but don't know how to pick up the session id to make it work. Is there a BADI equivalent of EXIT_SAPLRRS0_001?
    I'm sure one of you out there has the answer!
    Thanks,
    Stuart

    Hi József
    Yes I have, I think using SAP's white paper on virtual characteristics and key figures.
    My only outstanding question would be: is there a replacement BADI for the variables user exit and if not why not, since BADIs are supposed to be the preferred way now?

  • RSR_OLAP_BADI  or RSR00002 --not getting triggered from RSRT --Please Help

    Hi All
    Quick reposnse is highly Appreciated and rewarded.
    I wanted to implement a Virtual Key Figure .I have implemented RSR_OLAP_BADI .But when i execute query through RSRT .This BADI is not getting triggered infact its not reaching the Break Point which i have set in DEFINE and COMPUTE methods. I tried setting break point in user exit RSR00002 too but not working.
    Is there any attribute or properties or any technical setting that have to be done for Query to trigger this BADI.Or any settings in BADI required ?
    I am using infocube 0SD_C03 as the filter in BADI attributes.

    Hi!
    Check attributes for you implementation class.
    In DEFINE method set rrke_c_mode-no_selection for your virtual char.
    after that generate query in rsrt (if you set break in INITIALIZE method - you can debug)
    then run the query (if you set break in COMPUTE method - you can debug if query return some data).

  • BAdI "Virtual Characteristics and Key Figures in Reporting"

    Hello,
    When I execute a query in RSRT, the BAdI don't running.
    I create a Implementation ZVTOL_OLAP_BADI for the Definition RSR_OLAP_BADI. I activate them with the filter for my MultiProvider.
    I found the note 538897, but there is no answer.
    When I generate the query, the debugger stopped in the DEFINE-method.
    I have includes in the INITIALIZE und COMPUTE-method a endless-loop.
    => it don't work.
    I see the query result, but my keyfigure is empty, because the abap-code was not executed.
    Sven

    Hi,
    Is your virtual key figure available on multiprovider or underlying virtual provider.
    I don't see any option to add a virtual key figure on the top of a multiprovider.
    I do have the same scenario but virtual key figure is on virtual cube, not on multiprovider.
    regards
    rajesh

Maybe you are looking for