Virtual Key figures and Chars

Can someone explain me what are virtual key figures and how to populate data for them.
Regards
Kunal

AHP,
Thanks for the help, one last question, i posted same on sdn week back, there was no proper response. I have standard LO datasource and enhanced with around 25 fields, the major problem is none of these fields are delta capable and they are coming from 13 diff tables, with great difficulty i could tie the relation between them. Most of the fields change and none them are picked,
is there anyway i can write a program for all this fields for delta enabling. The last option which iam left is to load the data every week as full load though data volume is less, which is not practiced.
Regards
Kunal

Similar Messages

  • Virtual Key Figs and Virtual Chars......Perf

    Hi,
    Can anybody please brief me on Performance Factor will it increase or decrease when you use virtual chars and virtual key figures?
    Thanks,
    JB

    Hi,
    Perofrmance decreases with the use of virtual key figures and chars as the values of the objects are calculated at the runtime of the query.
    It affects worse if the amount of data thast is going for query processing is huge.
    Since using VKF is like calculating at the runtime of the queires by applying the logic needed.
    It is only reccomended in the case when the users are having no issue with the performance of the queries and are ready to wait for the output.
    Go for it when you have no other option.
    Hope it helps
    Thanks

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

  • 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

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

  • Virtual key figure BADI - does not change value

    I wrote a badi for virtual key figure according to guidelines from an SDN doc on how to create virtual chars and kf's.
    However, the value of the key figure is not changed at all. Below is my code. Please see what I'm doing wrong
    method IF_EX_RSR_OLAP_BADI~DEFINE.
       APPEND 'ZRANKS' TO c_t_kyfnm.
    endmethod.
    method IF_EX_RSR_OLAP_BADI~COMPUTE.
      if P_KYF_ZRANKS > 0.
        assign component p_kyf_zranks of structure c_s_data
        to <fs_ranks>.
        <fs_ranks> = '1.0'.
      endif.
    endmethod.

    There is something you need to do which I have not seen described in any of the documention here.
    You need to copy the source code for the INITIALIZE method directly from the code given in the example class CL_EXM_IM_RSR_OLAP_BAPI. That is where the P_KYF<object> and P_CHA<object> attributes are assigned their values. If you do not copy this code into your own implementation, these attributes have no value in the COMPUTE method and your code will probably not work.
    Bryan

  • Access on aggregated levels with virtual key figures

    Hi all,
    I need access to the aggregated view of a BEx report within user-exit RSR00002 for processing virtual key figures. Currently I only get access to the lowest non-aggregated level.
    My requirements in detail:
    I get certain key-figures (250 historical values)on the lowest aggregation level - so-called folders. Then I have to aggregate this vector of values at the next hierarchy level up to the top-level, say along-side a company's business department structure. Drill-down, slice&dice should be possible. So far so good - this is done easily with standard BEx features.
    Then, on each aggregation level, i.e. hierarchy node, I need to get the third lowest of the 250 aggregated values to assign this to my vkf. This is not an issue of the algorithm but of the internal data representation or access to the OLAP processor because I don't get this vector on the same aggregated level such as I could see it in my BEx report but on the lowest non-aggregated folder level.
    The question is now:
    a. Is data access on aggregated levels and drill-downs because of the internal representation generally not possible within this user-exit and would I have to supply the aggragation logic myself or
    b. do I have overlooked something critical - did I miss the trick?
    Every idea or hint is deeply welcome!!
    Thanks a lot,
    Michael
    Message was edited by: Michael Kronenberger

    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 Figures - How are they triggered?

    HI,
    I am trying to implement the Virtual Key Figure user-exit. I have created all the necessary coding and activated the user-exit.
    My cube contains data but the VKF in question has not been populated with any data because I have set the update rules to "NO UPDATE", so the VKF is completly empty.
    I've defined my query to use the VKF, but when I execute it, the user-exit is not triggered.
    <b>How does BW determine if a query should call the user-exit?</b> I though it was to do with creating the variables in ZXRSTOP in line with the cube/kf name as I have done (<b>DATA: g_pos_0IC_C03_zfcstwk   TYPE i.</b>).
    I'm using BW 3.5 by the way if this makes any difference.
    Here is the code I have created in the various includes:
    <u><b>ZXRSTOP</b></u>:
    *   INCLUDE ZXRSRTOP                                                   *
    DATA  g_pos_0ic_c03_fcstwk.
    **Global fields for virtual characteristics -                          *
    DATA: g_pos_0IC_C03_0plant   TYPE i.
    DATA: g_pos_0IC_C03_0material   TYPE i.
    DATA: g_pos_0IC_C03_0calday   TYPE i.
    DATA: g_pos_0IC_C03_zfcstwk   TYPE i.
    * End Program ZXRSRTOP                                                 *
    <u><b>ZXRSRZZZ</b></u>:
    * Includes for specific subroutines for each avriable
    Include: zxrsrf01,     "Common Subroutines
               zxrsrf02,     "Fiscal Period / Year Variables
               " zxrsrf05,     "Fill selections from Variable value table
               zxrsrf04.     "Fill virtual chars + KF
    FORM USER_0IC_C03 USING i_s_rkb1d TYPE rsr_s_rkb1d
      CHANGING c_s_data TYPE any.
      DATA: lsgid LIKE i_s_rkb1d-genuniid. "query ID
    * Define ODS temp table
      DATA: l_zic_forc_itab LIKE STANDARD TABLE OF /bic/azic_forc00.
    * Define cooresponding work area
      DATA: l_zic_forc_wa LIKE /bic/azic_forc00.
    * field symbols definitions
      FIELD-SYMBOLS <l_plant>.
      FIELD-SYMBOLS <l_material>.
      FIELD-SYMBOLS <l_calday>.
      FIELD-SYMBOLS <l_zfcstwk>.
      CASE i_s_rkb1d-infocube.
        WHEN '0IC_C03'.
    *      Which Query are we deriving for ?.
          CASE i_s_rkb1d-compid.
            WHEN 'Z0IC_STKVAL'  OR
                 'Z0I_EXP_DAT' OR
               'Z0IC_PCM_STKVAL'.
    *          Assign object values to field symbols
              ASSIGN COMPONENT g_pos_0ic_c03_0plant
                OF STRUCTURE c_s_data TO <l_plant>.
              ASSIGN COMPONENT g_pos_0ic_c03_0material
                OF STRUCTURE c_s_data TO <l_material>.
              ASSIGN COMPONENT g_pos_0ic_c03_0calday
                OF STRUCTURE c_s_data TO <L_CALDAY>.
              ASSIGN COMPONENT g_pos_0ic_c03_zfcstwk
                OF STRUCTURE c_s_data TO <l_zfcstwk>.
              SELECT * INTO TABLE l_zic_forc_itab
                 FROM /bic/azic_forc00
                 WHERE material = <l_material>
                   AND plant = <l_plant>.
              IF sy-subrc NE 0.
    *             no sort required
              ELSE.
    * Fill the VKF by reading the itab and locating the first record that exists >= 0calday
                SORT l_zic_forc_itab BY calday ASCENDING.
                LOOP AT l_zic_forc_itab INTO l_zic_forc_wa
                        WHERE calday <= <l_calday>.
                  IF sy-subrc EQ 0.
                    <l_zfcstwk>  = ''.
                  ELSE.
                    <l_zfcstwk>  = l_zic_forc_wa-/bic/zfcstwk.
                    EXIT.
                  ENDIF.
                ENDLOOP.
              ENDIF.
          ENDCASE.
      ENDCASE.
    ENDFORM.                    "user_0IC_C03
    * End Program ZXRSRZZZ                                                 *
    <u><b>ZXRSRU02</b></u>:
    * ZXRSRU02    Exits for Virtual chars and Key Figs                    *
    DATA: l_s_chanm TYPE rrke_s_chanm.
    DATA: l_s_kyfnm TYPE rsd_kyfnm.
    *   Which cube are we deriving for ?.
    DATA: l_stop(1) TYPE c VALUE 'Y'.
    WHILE l_stop = 'Y'.
    ENDWHILE.
    CASE i_s_rkb1d-infocube.
      WHEN '0IC_C03'.
    *        Which Query are we deriving for ?.
        CASE i_s_rkb1d-compid.
          WHEN 'Z0IC_STKVAL'  OR
               'Z0I_EXP_DAT' OR
               'Z0IC_PCM_STKVAL'.
    *             set up the chars to be used or abused. (based on mode)
            l_s_chanm-chanm = '0MATERIAL'.
            l_s_chanm-mode  = rrke_c_mode-read.
            APPEND l_s_chanm TO e_t_chanm.
            l_s_chanm-chanm = '0PLANT'.
            l_s_chanm-mode  = rrke_c_mode-read.
            APPEND l_s_chanm TO e_t_chanm.
            l_s_chanm-chanm = '0CALDAY'.
            l_s_chanm-mode  = rrke_c_mode-read.
            APPEND l_s_chanm TO e_t_chanm.
            l_s_kyfnm = 'ZFCSTWK'.
            APPEND l_s_kyfnm TO e_t_kyfnm.
        ENDCASE.
    ENDCASE.
    * End Program ZXRSRU02                                                 *

    hi Peter,
    try to check with RSRT, put in your query technical name,
    and click 'technical information', check info on 'virtual char/keyfigures', it should have 'Y' and a list of virtual char/kf. and also check 'execute+debug', mark checkbox 'display sql', after that check the sql statement if your virtual kf is in select statement.
    try in RSRT menu 'environment'->delete old abaps.
    if you want the virtual kf only run for certain query,
    you can restrict in ZXRSRZZZ, using
    if I_S_RKB1D-compid = 'your query technical name'.
    ... your logic for virtual kf ...
    endif.
    hope this helps.

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

  • Virtual Key Figures - Field Symbol

    Dear guru's,
       We had obtained an ABAP error in the execution of a query when obtaining a virtual key figure. We analyzed the problem and identified the error. We fixed it in our dev system and tested ok.We then transported the includes ZXRSRU02, ZXRSRTOP, ZXRSRZZZ to our quality system and the problem persisted. The error occurs because the structure c_s_data has not updated to include the added object and therefore assigns the structure to the field symbol and not its value.
       I have checked the versions of these includes and they are identical. What could be the possible causes for this problem and solutions?
    Thanks and Kind Regards,
    Alex

    We transfered many times the corrected code and still the probem persisted. If my understanding is correct the structure c_s_data is created by BW according to the appends you make in the code (...RU02).
    The problem was resolved when we regenrated the queries. If anyone can explain why this is so, please let me know so that I may have a better understanding of this process.
    Thanks and Kind Regards,
    Alex

  • Use of Key Date in Virtual Key Figure Calculation

    I have a virtual key figure whose value depends in part on the key date entered by the user.  I have the VKF set up with a dummy calculation, and it is working OK.
    How do I refer to the value of the key date in the code that assigns the VKF value?
    Thanks,
    DP

    Found the answer, thanks to another thread:
    Function RRS_VAR_VALUE_FROM_MEMORY_GET with I_VNAM equal to the key date variable returns the value of the key date.
    DP

  • Problems using virtual key figures

    Hi experts,
    I have got 2 questions regarding virtual key figures, by using the OLAP BADI
    1. Is there a chance to get the variable values out of the variable selection screen in the BADI implemtentation? If so, how?.
    2. In the compute method the assign does not work because the Attributes (p_kyf_ZIMCREDAY, p_cha_0material,p_cha_0calday)  are 0 all the time.
        How does the attribute get a correct assignment to a component name? See my coding of the define and compute method below.
    Thanks and Regards, Mario
    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 'ZD_IMC001'.
    l_s_chanm-chanm = '0MATERIAL'.
    l_s_chanm-mode = rrke_c_mode-read.
    APPEND l_s_chanm TO c_t_chanm.
    l_s_chanm-chanm = '0CALDAY'.
    l_s_chanm-mode = rrke_c_mode-read.
    APPEND l_s_chanm TO c_t_chanm.
    APPEND 'ZIMCREDAY' TO c_t_kyfnm.
    ENDCASE.
    IF_EX_RSR_OLAP_BADI~COMPUTE
    FIELD-SYMBOLS <fs_ZIMCREDAY> TYPE ANY.
    FIELD-SYMBOLS <fs_material> TYPE ANY.
    FIELD-SYMBOLS : <fs_calday> TYPE ANY.
    ASSIGN COMPONENT p_kyf_ZIMCREDAY OF STRUCTURE c_s_data
    TO <fs_ZIMCREDAY>.
    ASSIGN COMPONENT p_cha_0material OF STRUCTURE c_s_data "p_cha_0material
    TO <fs_material>.
    ASSIGN COMPONENT p_cha_0calday OF STRUCTURE c_s_data "p_cha_0calday
    TO <fs_calday>.

    Regarding 1.
    I checked in debugging the variable I_TH_SFC in the initialize method, but there is no information regarding the selections in the variable popup.
    Can you please explain in detail how to access the variable values.
    Regarding 2.
    I changed l_s_chanm-mode to rrke_c_mode-no_selection according to your recommendation.
    Unfortunately it´s still the same. The attributes still does have the value 0. Therefore the assign does not work correct.
    The attributes are defined with type i. But the component names are like 'K____132'. Is this the cause of the problem?
    Thanks, Mario

  • 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

Maybe you are looking for

  • Resolved: Use value from select list in pl/sql block

    Hello, I have a form with a select list: P18_BONUSTYPE, the values of which come from a LOV. When the user clicks a button, a page process is used to insert a row into a table. When I use the :P18_BONUSTYPE bind variable in my insert statement I get

  • How can i overcome this problem...in applet

    my applet will read in a file for data, when i compile using JCreator, it work... but when i open the html file to run, problems occur, state that loading java applet failed. the message shown in java console: java.security.AccessControlException: ac

  • Projects dont appear in "Open Recent"

    Ever since i started to save my files and projects to my external Firewire HD (Projects and Media files), my projects dont show up in the "open recent" tab. The Projects that i saved on my internal HD do, but any project i start on my external drive

  • Why my contacts have been deleted

    This morning all my contacts had been deleted from my iPhone why did that happen and how can I get my contacts back on my phone.

  • SCJP 1.4 or 1.5?

    Which one is better to take? which is better recognised? I have checked Sun's website and the only thing I know is: 1) Various changes in topic that will be examined 2) 1.5 is newer (obviously) yet, there are still many people choosing to take 1.4 in