Ranking - virtual keyfigure

Hello experts, please help make my life easier today !
Requirement: Need to create virtual keyfigure to calculating Rankings for all plants (cannot use thank ranking option in BEX cuz of sub-totals issue).
Issue: Seems like the virtual keyfigure is populating the value at the record level in the cube. I want to populate at the leve of query result based on the variable in query (days selection).
How could I take result of the query, possibly into an internal table and then calculate the rankings.
Please guide me through the code. Any guidance would be appreciated.

Any help ???

Similar Messages

  • Creation of virtual keyfigure.

    Hello All,
    Please lookinto the below requirement...
    my requirement is One keyfigure available in cube and one more key figure available in multiprovider.
    we need to calcule the total vale.
    For example total value menas in our case : SR_Co/SR_coff.
    we need this calcucation based on the company code.
    company code available in multiprovider and cube.
    sR_CO available in multiprovider.
    SR_coff availble in Cube this loaded throgh IP function.
    how to write virtual keyfigure on this case.
    regards,
    ch.

    Hi
    Yes i think this can be done using VKF which is similar to CKF but more dynamic as data populates at run time.
    Newly created VKF will be added to the cube , but it would nt have any mapping but would derive data at run time using a custome code. Add a new Virtual key figure and write the logic in Either CMOD ZXRSRU02 enhancement or you can try implementig a BADI. Once implemented you can use this in the query in Place of the CKF you were using earlier.
    Go through the following articles they shall help you in implementing the same:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e051fda8-71a9-2a10-ac9e-8d17414a8c8c?quicklink=index&overridelayout=true
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0aa5390-eb7c-2c10-06a1-908f4849ad2a?quicklink=index&overridelayout=true
    Regards
    Raj Rai

  • Using result of a Calculated Keyfigure as input for a Virtual Keyfigure

    Hi experts,
    is it possible, to use the result of a calculated keyfigure of a query for the input of a virtual keyfigure und use the virtual keyfigure within the same query?
    My problem: depending on drilldown, I have a different percentage within the calculated keyfigure. And depending on that value, I would like to read a score out of a DSO and fill a virtual keyfigure with that, and show the score in the same query. In my opionion, the only way to calculate the score is on the fly, depending on the navigation step I do. Maybe there is another approach that I do not know.
    I was glad for any ideas. Thank you in advance!
    Regards
    F.L.

    Hi,
    Sorry but a calculated key figure result cannot be used in a virtual key figure calculation. The reason purely being that the CKF calculations happen after the Virtual KF/ Char calculations (through BAdI or CMOD).
    The only solution i see here is that you will need to do the calculations in the VKF logic itself. Please do remember that VKF calculations and population happens for each record bein fetched into OLAP from the Infoprovider for the Filters put into the report.
    Hope it helps.
    Thanks,
    Abhishek.

  • Badi-Virtual keyfigure value not populating in query

    HI all,
    I am trying to populate a constant value into the virtual keyfigure when the query is executed but the value is not getting populated.
    I followed the steps how to do this by looking into the step by step process for keyfigure article which i found in SDN.
    When i execute my BADi in se19 i am able to get the value but not in the query.
    Is there a special way to create keyfigures or is it the same way as we create a normal keyfigure.
    Can someone tell me how to get the values in query.
    Thanks in advance.
    Regards,
    Harish

    Hi,
    why dont you debug the badi while executing the report from RSRT t-code. This will give you some idea.
    To debug, put a break point in 'define' as well as 'compute' function of your Badi-implementation, then go to RSRT t-code, enter your query name and then click generate. It will stop at the break-point. Here you can see what is the problem
    Regards
    akshay

  • Create Virtual Keyfigure using BADI

    Hi All,
    I Am tring to implement a virtual keyfigure using BADI, here is what i did created a Enhancement for BADI RSR_OLAP_BADI but i am not sure how to write the code for methods DEFINE and COMPUTE, i am just trying to populate value 100 for Virtual Keyfigure ZVIRT (Just testing) and i am using this keyfigure in my ODS.
    here is the define method i have:
    METHOD IF_EX_RSR_OLAP_BADI~DEFINE .
      DATA: l_s_chanm   TYPE rrke_s_chanm,
            l_kyfnm     TYPE rsd_kyfnm,
            l_s_chanm_used TYPE rschanm.
      FIELD-SYMBOLS:
            <l_s_chanm> TYPE rrke_s_chanm,
    CASE i_s_rkb1d-infocube.
    WHEN 'CUBEXYZ'.
    ENDCASE.
    ENDMETHOD.
    Compute Method:
    METHOD IF_EX_RSR_OLAP_BADI~COMPUTE .
    ENDMETHOD.

    found this code in other post thought this would be helpful for others, this works.
    The coding for DEFINE is
    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 'MYCUBE'.
    characteristic
    l_s_chanm-chanm = 'ZVIRTUAL'.
    l_s_chanm-mode = rrke_c_mode-no_selection.
    APPEND l_s_chanm TO c_t_chanm.
    l_s_chanm-chanm = 'ZPMORDER'.
    l_s_chanm-mode = rrke_c_mode-read.
    APPEND l_s_chanm TO c_t_chanm.
    The coding for compute is:
    field-symbols: <f_virt> type /bic/oizvirtual,
    <f_ord> type /bic/oizpmorder.
    if P_CHA_zvirtual > 0.
    assign component P_CHA_zvirtual of structure C_S_DATA to <f_virt>.
    if P_CHA_zpmorder > 0.
    assign component P_CHA_zpmorder of structure C_S_DATA to <f_ord>.
    <f_virt> = <f_ord>+2(3).
    else.
    clear <f_virt>.
    endif.
    else.
    clear <f_virt>.
    endif.

  • Virtual Keyfigures

    All,
    For a client we want to use virtual keyfigures in a query. Now we have a value in the user exit, but we cannot get the value back into the query. Does anyone have an example of ABAP or some documentation on this subject?

    hi,
    try to put 'break-point' and do debug.
    and check with RSRT->click 'technical information', see 'virtual char/key figures', it should 'yes'.
    and try to generate the query with RSRT1.
    take a look
    Extractors
    and let's know your email, can send you some how to docs.
    hope this helps.

  • Error in virtual keyfigure exit

    Hi All,
    I have written some code in customer exit for virtual keyfigure.
    There is no error in the code.
    But when i am trying to execute the query, the following exception error occurs.
    Please let me know how to correct this.
    Thanks in advance!

    Hi Ashish,
    The error is 'ESubroutine call failed. Could not find the form USER_EXIT_INIT.
    EAn exception with the type CX_SY_DYN_CALL_ILLEGAL_FORM occurred, but was
    I>> Row: 480 Inc: SRRK0F30 Prog: SAPSRRK0.
    Please help on this.

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

  • Virtual Key Figures

    I have already searched for and could not find the basic steps of Creating a Virtual KeyFigure, Can someone provide these?
    Thanks

    Hi,
        User Exit Virtual Characteristics and Key figures
    Example: InfoCube DEMOCUBE has the characteristic PRODUCT PRICE_TP and the key figure ACT_PRICE and QUANTITY. In the enhancement, the product from the current price for PRODUCT and the key figure QUANTITY should be determined. If successful, the characteristic PRICE_TP should contain the characteristic value '1'.
    The include ZXRSRU02: Definition
    INCLUDE ZXRSRU02
    DATA: L_S_CHANM TYPE RRKE_S_CHANM.
    CASE I_S_RKB1D-INFOCUBE.
    WHEN 'DEMOCUBE'.
    L_S_CHANM-CHANM = 'PRODUCT'.
    L_S_CHANM-MODE = RRKE_C_MODE-READ.
    APPEND L_S_CHANM TO E_T_CHANM.
    L_S_CHANM-CHANM = 'PRICE_TP'.
    L_S_CHANM-MODE = RRKE_C_MODE-NO_SELETION.
    APPEND L_S_CHANM TO E_T_CHANM.
    APPEND 'ACT_PRICE' TO E_T_KYFNM.
    APPEND 'QUANTITY' TO E_T_KYFNM.
    ENDCASE.
    The include ZXRSRTOP: global data
    INCLUDE ZXRSRTOP .
    DATA: G_POS_DEMOCUBE_PRODUCT TYPE I.
    DATA: G_POS_DEMOCUBE_PRICE_TP TYPE I.
    DATA: G_POS_DEMOCUBE_ACT_PRICE TYPE I.
    DATA: G_POS_DEMOCUBE_QUANTITY TYPE I.
    The Include ZXRSRZZZ: Changing the data
    INCLUDE ZXRSRZZZ .
    FORM USER_DEMOCUBE USING I_S_RKB1D TYPE RSR_S_RKB1D
    CHANGING C_S_DATA TYPE ANY.
    FIELD-SYMBOLS <L_PRODUCT>.
    FIELD-SYMBOLS <L_PRICE_TP>.
    FIELD-SYMBOLS <L_ACT_PRICE>.
    FIELD-SYMBOLS <L_QUANTITY>.
    ASSIGN COMPONENT G_POS_DEMOCUBE_PRODUCT
    OF STRUCTURE C_S_DATA TO <L_PRODUCT>.
    ASSIGN COMPONENT G_POS_DEMOCUBE_PRICE_TP
    OF STRUCTURE C_S_DATA TO <L_PRICE_TP>.
    ASSIGN COMPONENT G_POS_DEMOCUBE_ACT_PRICE
    OF STRUCTURE C_S_DATA TO <L_ACT_PRICE>.
    ASSIGN COMPONENT G_POS_DEMOCUBE_QUANTITY
    OF STRUCTURE C_S_DATA TO <L_QUANTITY>.
    Routine to get the price
    PERFORM GET_PRICE USING <L_PRODUCT>
    CHANGING <L_ACT_PRICE>.
    IF <L_ACT_PRICE> GT 0.
    <L_ACT_PRICE> = <L_ACT_PRICE> * <L_QUANTITY>.
    <L_PRICE_TP> = '1'.
    ENDIF.
    ENDFORM.

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

  • Subject : Problem with Virtual key figures for one scenario.

    Hi Gurus,
    I have implemented Virtual Keyfigures for my Bex report and it is working perfectly bUt for one scenario.
    If i give PLANT and MATERIALS in the selection  , The report calaculates the Virtual
    keyfigure value correctly But if i give Only PLANT
    and NO Materials ( A single plant can have 700 materials also!!), The report executes and after sometime
    gives me a messsage " Disconnecting from Server"
    I executed the report in RSRT . It gives me this error "exception with the type CX_SY_ARITHMETIC_OVERFLOW occurred"
    Since the Virtual keyfigure doesnot use Cache memory. Is it restricted by the Physical memory?.  How to overcome this
    problem?
    Please let know if anyone faced this issue and resolved It. Any help or guidance is really appreciated.

    Hi Oscar,
    Thanks for reply,
    How can i know the overflow and how can i use the catch for avoiding the short dump?
    thanks in advance.

  • Table for read virtual characteristic

    The table i_th_kyfnm_used if for read virtual keyfigures which is the table for virtul characteristics??
    Thanks In Advance
    Juan

    bump 
    Regards
    Juan

  • BW : Virtual key figures

    Hii  experts  ,
    What are virtual key figures .
    Plz explain .
    Thanks & regards ,
    Madhavi S Bichakal

    Dear Madhavi,
    Virtual Key figure
    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 .
    this keyfigure is not populated with the data by using update rules. but this virtual keyfigures will detemine the value only at the runtime of the query.
    nomally when we store the key figure value in the cube as we do it for a normnal keyfigure it gives us the fact(Fixed truth ) information but by using virtual keyfigures we can show the present truth in the report.
    for example :- let say we have a transaction on 01/01/2007 for material M100 @ price of 100 and on 02/01/2007 the price of material M100 has changed to 200.
    when we store price as a normal keyfigure in the cube it will give fact i.e, 100
    but if we design the price as a virtual keyfigure it will give out present truth as 200.
    Virtual characteristics and Key figures are useful if you want to dynamically pouplate data from the fact table to the field which doesn't have any data in the fact table and also used to build an internal security model before the data gets passed to DATA_PROVIDER.
    You can get more information if you review the documentation for enhancement RSR00002.Go to SMOD type in RSR00002 and select the documentation radiobutton..
    Some ABAB coding samples:
    Virtual Characterstics & Key Figures
    Virtual Characteristic problem
    how to read characteristic variable value into virtual characteristic
    How to implement Virtual Characteristics or Virtual key figures
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/59069d90-0201-0010-fd81-d5e11994d8b5#search=%22SAP%20Customer%20Exit%20virtual%20key%20figure%22
    For more info
    You can go through the following links.
    Virtual Key Figures
    sampel code for virtual key figures
    Virtual Key Figure - ZXRSRU02
    Virtual Keyfigures and Characterisitics
    How to implement Virtual Characteristics or Virtual key figures
    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
    Search for the keyword virtual keyfigure in the following link :
    https://www.sdn.sap.com/sdn/developerareas/bi.sdn?page=BW_How_To.htm
    Creating Virtual keyfigures
    you create virtual keyfigure just like create normal keyfigure (RSD2),
    populate not via transformation/transfer/update rules, but when query execution via user exit, take a look
    Virtual Characteristic problem
    virtual key figure
    http://www.bwexpertonline.com/downloads/Nissen.doc
    Also
    How to implement Virtual Characteristics or Virtual key figures
    Check post by Sree Rama Tata 
    Hope it helps
    Regards
    Bala

  • Displaying the Keyfigure values as characteristic/text

    Hi,
    Is there any option of displaying the values of a CKF/Formula as Text.
    If Result of the logic applied in CKF/Formula is >1 then it should be displayed as TRUE else it should be displayed as FALSE.
    How can i achieve this.
    Regards,
    Sandeep

    Hi,
    you got 2 options,  using boolean function in the calculated key figure/formula. then display either 0 or 1 for true and false.
    other option, if you wanted to display as text, true or false. you need to create a virtual keyfigure for this, populate true or false by using standard Badi implementation.
    go through the pdfs.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/60e34f63-f44c-2c10-488e-c89b04e0ca7c?quicklink=index&overridelayout=true
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/e051fda8-71a9-2a10-ac9e-8d17414a8c8c

  • Virtual KF and DSO

    Hi guys,
    I would like to understand why when we do a virtual key figure /Characteristic we need a DSO with this Characteristic.
    I have been looking information in the forum about that and all the post told about  you have to use a DSO or a transparent table but if you only use a infoCube with the Characteristics you don't need a DSO, do you?.
    Thanks a lot
    Best regards
    Ana
    Edited by: Ana Marí on Dec 11, 2008 5:10 PM

    Dear Ana,
    Virtual Key Figures (KF)/ Characteristics can be used to create the Query more dynamic. The value of Virtual KF/Characteristics does not store in the Data Target, it is calculated at runtime (At Query Execution time).
    A virtual characteristic / key figure can be used to derive values at query run time.
    The virtual characteristic / key figure must be added to the cube as a characteristic or key figure but not filled in update rules or transfer
    rules
    You can go through the following links.
    Virtual Key Figures
    sampel code for virtual key figures
    Virtual Key Figure - ZXRSRU02
    Virtual Keyfigures and Characterisitics
    How to implement Virtual Characteristics or Virtual key figures
    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
    Hope this helps u..
    Best Regards,
    VVenkat...

Maybe you are looking for

  • How to create/assigh Target Group while creating Marketing Plan in CRM 6.0

    Hi all, I am new to this field  and would like to know that how can we assign the Target Group ( business Partners ) in the Campaign while creating a Marketing plan. It will be really handy for me if I get the detail steps to execute. Regards, Zen

  • Getting Lync enable users who are modified after specified time

    Getting Lync enable users who are modified after specified time Hi, I need to get all the Lync enabled users from Lync 2010 server who are modified after specified time. I have written a client with this below code for my purpose string dateString =

  • How do I get backed up Aperture files into my new iMac correctly?

    Here's the deal.  My 4 year old iMac HD failed.  My the Time Machine backup software in the Time Capsule was somehow corrupted so I could't just restore or Migrate the files to my new iMac.  I was able to retrieve the actual "Pictures" folder from my

  • How to stop the goo.gl Skype virus

    Not sure if this is the right place to post this. So recently got this virus sending this message to all my friends, "we made 4936 this month using -link not permitted-" the message sometimes changes, but it's always the same link. So I looked up how

  • Converting mp3 files to Creative Zen To

    I'm trying to convert mp3 files to the Creative Zen Touch,I've plugged in the device via USB2.0, but I cant find the Creative Zen touch in the source screen.... http://img200.imageshack.us/img200/684/czs4ie.jpg What should I do?Message Edited by Nico