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.

Similar Messages

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

  • Using Virtual Key Figures/ Characteristics is possible to use in InfoSets

    Hi All,
    Is it possible Using Virtual Key Figures/ Characteristics is possible to use in InfoSets?
    I have tried all the possibilities using the BADI implementation RSR_OLAP_BADI without success.
    The VKF / Characteristics works fine when it is being used with a query based on the ODS however it is not populated when i am using the infoset. Moreover i have used the code for InfoSet as well it is not working.
    I would appreciate any help in this regard.
    Regards
    Noor

    Hi PV,
    r u sure about that, as i have tried all sort of permutation and combinations for using the same in RSR_OLAP_BADI without any luck.
    I have the got felling about the same however if you look into the following SAP note it puts me into doubt.
    Note 657690 - Virtual characteristics and key figures in InfoSets
    Note 618738 - Virtual characteristics or key figures and InfoSets.
    It describe about using the RSR00002.
    Many thanks for the information.
    Kind Regards
    Noor

  • Issue with Virtual Key Figures Using BADI

    Hi,
    We are populating values for a few virtual key figures in a query over a multiprovider through a BADI implementation(RSR_OLAP_BADI). On execution the VKF fields appear blank in the report.
    We tried debugging the methods of BADI by adding Break-Points in specific points. On doing so, we found that the values are properly updated in the 'Field-Symbols' used in the Compute method, but the same values do not appear in the report result and the fields are blank.
    Kindly provide any pointers or suggestions.
    Thanks.

    First check in <b>Technical Information</b> in <b>RSRT</b> , whether the
    <b>Virtual Char/Key</b> Fig is<b> Y</b> or <b>N</b>.

  • Virtual Key Figure ( Currency Problem)

    Hi All,
    I am facing one problem in virtual key figure using BADI. Need your help...
    Scenario: I have a DSO with all many fields. Requirement is to add one more VKF in DSO to get specific period balance of a GL from 0FIGL_O10 DSO and then display it as a column in Bex report. Added VKF is of type amount and unit/currency 0CURRENCY.
    Required Report Format:
    Material --- Col1 u2013 Col2 u2013 Col3(VKF)
    M1--$4, 00-$140, 00u2014<Balance form 0FIGL_O10 for a period>
    Work done so far:
    I have added a virtual key figure ZVKF_BAL in my ZSD_O06 of type amount unit/currency as 0CURRENCY. In RSR_OLAP_BADI I have added a new implementation ZVAR_IMPL.
    In class ZCL_IM_VAR_IMPL there are total three attributes.
    P_KYF_ZVKF_GL u2013 Virtual key figure
    P_CHA_0FISCPER u2013 Period is from ZSD_O06 for which we have to get the balance of a fixed GL account from 0FIGL_O10.
    Given is the code added in define method:
    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 'ZSD_O06'.
        l_s_chanm-chanm = '0FISCPER'.
        l_s_chanm-mode = rrke_c_mode-read.
        APPEND l_s_chanm TO c_t_chanm.
        APPEND 'ZVKF_GL' TO c_t_kyfnm.
      ENDCASE.
    No code added in initialize method
    Given is the code added in compute method:
    FIELD-SYMBOLS <fs_ZVKF_GL> TYPE ANY.
    FIELD-SYMBOLS <fs_0FISCPER> TYPE ANY.
    DATA :LV_FS_ZVKF_GL TYPE /BI0/OIBALANCE,  
    p_cha_0FISCPER = 8.  "ASSINGING POSITIONS TO THE FIELD AS THEY ARE NOT GETTING IT
    p_kyf_ZVKF_GL = 16.
    ASSIGN COMPONENT p_kyf_ZVKF_GL OF STRUCTURE c_s_data
                TO <fs_ZVKF_GL> .
    ASSIGN COMPONENT p_cha_0FISCPER OF STRUCTURE c_s_data
                TO <fs_0FISCPER>.
    Customized function module which will calculate the GL Balance.
      CALL FUNCTION 'ZGLBALANCE'
        EXPORTING
         FISCPER_I    = <fs_0FISCPER>
         GL_ACCOUNT_I = '0000476000'
        IMPORTING
          BALANCE_O    = LV_FS_ZVKF_GL.
    <fs_ZVKF_GL> = LV_FS_ZVKF_GL.
    Code of ZGLBALANCE:
    DATA: lv0_fiscal type /BI0/OIFISCPER.
    DATA :  X TYPE I VALUE 0,
    types: BEGIN OF ty_/BI0/AFIGL_O1000,
           FISCPER type /BI0/OIFISCPER,
           GL_ACCOUNT type /BI0/OIGL_ACCOUNT,
           BALANCE type /BI0/OIBALANCE,
           CURRENCY TYPE /BI0/OICURRENCY,
            END OF ty_/BI0/AFIGL_O1000.
    data: it_/BI0/AFIGL_O1000 type TABLE OF ty_/BI0/AFIGL_O1000, " Internal table
          wa_/BI0/AFIGL_O1000 type ty_/BI0/AFIGL_O1000.          " Work area
    select single FISCPER GL_ACCOUNT BALANCE CURRENCY from /BI0/AFIGL_O1000 into CORRESPONDING FIELDS OF TABLE it_/BI0/AFIGL_O1000 where GL_ACCOUNT eq GL_ACCOUNT_I and FISCPER eq FISCPER_I and CURRENCY = 'USD'.
    BALANCE_O = X .
    Problem:
    We are getting the balance values but it is coming with numeral with postfix ERROR.
    M1--$4, 00-$140, 00u201412,00 ERROR
    M2--$24, 00-$130, 00u201414,00 ERROR
    Is it something to do with currency? Please let us know what is worng in code?
    If yes please let me know how to get the currency along with the numeric values there in the report.
    Thanks & Regards,
    Mayank

    Hello mayankmishra135,
    Were you able to find a solution for this? I am facing the same issue (with the ERROR in the currency field), wuold appreciate your help.
    Best regards,
    Aleksander Dyl

  • Virtual Key Figure - Cumulation

    Hi all,
    I am trying to cumulate a virtual key figure for all fiscal periods one by one but I want to sort the Fiscal periods in the badi RSR_OLAP_BADI as if the fiscal periods are not sorted then the cumulation does not happen correctly.Could anybody please guide how to access the entire data set of the query in the badi COMPUTE method...What I am getting is only a record by record access in the method.
    Rgds
    Amit

    While Generating the Query it goes to the Break Point , but not where key figure is getting calculated.
    But after that if i execute Query still its teh same

  • Virtual Key figure not getting populated

    Hi All,
    I have included a virtual key figure in a multiprovider  on which the query is created and its underlying ODS.
    This issue is the virtual key figure is not getting populated . I am not sure what I am missing
    I did the following :
    1) Tried Debugging - Put a break point and execute the query in RSRT.It  did not go to the Exit. I also tried  generating the query from RSRT.
    I am using the BADI (RSR_OLAP_BADI) to populate the Vir Key Fig.
    Please guide me.
    Thanks,
    HM

    Hi All,
    Now that I am able to get the logic to come up in debug. I am faced with another issue.
    I am implementing  avery simple logic . I added a integer type key figure to the ODS and I am tryin to assign value 1 to the the key figure in the code (I am assigning 1 just ot check if the value is passed to query or not. I do have acomplex logic tha i need to implement).
    Here I am able ot see the value in the debug but in the qury the value is not populated.
    N ot sure what might be going wrong.
    code is
    l_z_avg = 1.
    <fs_zavglate> = l_z_avg .
    Appreciate help.
    Thanks,
    HM

  • Create Badi for Virtual Key Figure

    Hi experts,
    i have to create badi for virtual key figure in BIW for dat i m creating Badi in BI development but its asking for Access Key.
    Badi name is RSR_OLAP_BADI
    i want to know while creating classic Badi with Implementation Name do developer need access key or thr any othr way to develop Badi for Virtual Key Figure.
    Tell me for creating virtual key figure in biw we use Badi and for dat we have to create the Badi in BIW Dev. or in R/3 Dev.
    it first time dat i m creating BAdi.
    Ankit
    Edited by: ankit375 on Feb 3, 2011 11:14 AM
    Edited by: ankit375 on Feb 3, 2011 11:14 AM

    To see how to create this BADI see here:
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/90b2babc-15ad-2d10-c4b2-bd3af67d86b1
    You you need to be registered as developer (you have to have dev.key) to do the coding.

  • Type conflict with ASSIGN in BADI for Virtual Key Figures

    We get the below error dump in ST22 when executing BEx queries that contain virtual key figures.
    error message - 'Type conflict with ASSIGN in
    program "ZCL_IM_THR_RSR_OLAP_BADI======CP".'
    We have a BADI implementation that calculates few virtual key figures included in some infocubes & multiproviders. The error would arise if we execute two queries (containing common Virtual Key figures) one after the other without closing the first query.
    We found a note "Note 1237689 - Virtual chars. and key figures in input-ready querys" that could be relevant to our issue and wanted to apply this note but unfortunately the note is only applicable to SAPKW70016 to SAPKW70018 and we are support pack 15.
    Can you please advise what the problem could be/suggest corrections for the same.

    Hi Kulmohan,
    Did you fix your issue? We are facing the same issue. Could you please let me know if you have any solution for this issue,
    Thank you,
    Mike

  • Virtual Key Figure

    Hi all,
    Before implementing a virtual key figure, I'd like to make sure this will answer my need. I work for a brewery, and I am looking at our customer taps activity.
    Records in the cube:
    Trading Region A, Brand X, Customer 001, Action "Install": 1 "Tap action"
    Trading Region A, Brand X, Customer 002, Action "Install": 2 "Tap action" (<i>new taps</i>)
    Trading Region A, Brand X, Customer 002, Action "Removal": 1 "Tap action" (<i>old tap</i>)
    So what I want to have in my report is :
    Trading Region A Brand X: 2 "customer activity"
    I am thinking I could use a virtual key figure that will look in the cube and check if there was any activity for a customer on that brand and trading region, and then will allow me to aggregate the result in the query.
    But I am not sure because it seems to me that Virtual Key Figure are calculated at record level...
    Could any of you clarify this for me ?
    Many thanks for your help,
    Nicolas

    Thanks a lot !
    I don't know why I tried such a complicated solution...
    Tried to assign points and close the issue, let me know if it didn't work as this is my first post...

  • Problem with virtual Key Figure in a query

    Hi Experts,
    I would like to share my problem with the virtual key figure in a query:
    I have a query with a virtual key figure and when I eject the query by analyzer, the result sometimes is displayed and sometimes is not displayed (is equal to 0), with the same initials values. And when I eject the query by RSRT always display the result for the virtual key figure.
    Why don't always display the result?
    Thanks a lot

    Hi,
    I think that the problem is the level of support package. We have BI AddOn 7.X (based on 7.20) support package 0.
    What do you think?
    Regards

  • Problems with creating badi implementation for virtual key figures

    Hi,
    I'm running BI 7.0 (unicode).
    I have been trying to follow this blog to calculate the virtual keyfigure in my infoset - Using Virtual Key Figure and Characteris in an InfoSet
    My infoset includes 1 infocube, and 3 master data infoobjects. I have created everything the blog was referring to, and activated fine. However, it seems that when the field symbols are assigned from the c_s_data structure, they do not get referenced correctly, so that no correct memory area is assigned and instead the whole c_s_data structure is assigned to the field symbol, which prevents me from referencing the right mem area correctly.
    For example, in this statement
    ASSIGN COMPONENT P_CHA_ZMYINFOSET___F120 OF STRUCTURE c_s_data
                                                                           TO  <fs_ZMYINFOSET___F120>.
    the component p_cha_zmyinfoset___F120 of c_s_data supposed to be assigned to the field symbol (point to the correct place in structure c_s_data). In other words when this statement is executed, the program looks at structure c_s_data, finds the component zmyinfoset___F120 in it, and assignes the position of that component in the structure to the field symbol, so that it could be referenced in the code. However, the correct assignment does not happen.
    When I debug the code and view the structure c_s_data, I can never find any component with any of the names I can find in my BEX query like ZMYINFOSET___F120. All I see are the components that are named like these: Z____5179 (C_S_DATA-Z____5179), C_S_DATA-S____5150, etc. I see the correct values, but components all have weired names like that. I thought in Infosets the components are named in the following fashion: INFOSETNAME___FXXX which you can see from your BEX query designer. Why is this happening? Why don't I see the correct names in the c_s_data structure? If instead I try to assign those components with their weired names directly, I still get incorrect assignment.
    what am I doing wrong?
    I was reading abap help on this statement:  assign COMPONENT comp OF STRUCTURE struc
    and the following I found:
    With this expression for mem_area, the memory area of a component comp of a structure struc is assigned to the field symbol. While the structure struc is specified directly, a data object must be specified for comp. The evaluation depends on the data type of comp:
    If the field comp has a non-text, elementary type, the content is converted to the type i and interpreted as a position of the component in the structure. if the value for comp is 0, the storage area of the entire structure is assigned to the field symbol.
    From what it says above, my value for comp is always 0, so that the entire structure is always assigned to my field symbol instead of a specific position in that structure.
    please let me know what is wrong here.
    thanks.
    Edited by: AG on Oct 11, 2008 10:41 AM
    Edited by: AG on Oct 11, 2008 10:42 AM

    Hi,
    I am facing the similar issue. Can you please tell me how you solved this problem in more details?
    which sample code and how u can find that in SE24 and where to copy that code.
    Thanks in advance..
    vamsi.

  • Do we write variable customer exits for virtual key figures in Bex?

    Hi all,
    Am I thinking the right here " We write variable customer exits in CMOD for virtual key figures in BEx " or am I totally wrong. If thats the case where do we write it.
    Thanks,
    JB

    Nevermind

Maybe you are looking for

  • Site-specific error pages do not render images?

    A weird one, but here goes..... Does anyone have any idea why our site specific error pages (Network Error, Site Busy Error...) would not serve images? Our custom HTML and pages appear as desired, but our logo and other .gifs do not and appear broken

  • Garageband external

    Previuosly I had an iPad 3, with 30-pin connector. With a usb extender it was no problem to connect my KORG TR midi keyboard to it and use it with Garageband. Now i have an iPad 4 with lightning connector, and nothing seems to work to connect my midi

  • WBS element - Project System

    Hi Current project, MM integrated with PS . I need expert who involved MM – PS, please let me know the mail id and process. I need your help further lot of requirement and ideas from your end, Current requirement is : Is there any standard report for

  • Premiere Pro export issues. Unknown error messages, extremely slow export times, strange I/O & disk usage

    Hello, I'm hoping I can start getting answers to some big issues I've been having running Premiere pro. I've had similar issues with CS6 but it seems like with CC and every recent update, the problem hasn't been resolved, its even worse. The main iss

  • [SOLVED] Chromium will not launch

    After my my last system upgrade chromium won't launch. I get the following error: [1764:1764:0515/113901:ERROR:url_pattern_set.cc(240)] Invalid url pattern: chrome://print/* [1792:1792:0515/113901:ERROR:sandbox_linux.cc(343)] InitializeSandbox() call