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

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

  • 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

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

  • Calculating count of orders using virtual key figures

    Hi All,
    In my report, i need a counter for the number of distinct orders.
    1ROWCOUNT didnt work for me as i want the count of distinct orders alone.
    I am planning to use virtual key figure for this..
    However, i donno how to code this in ZXRSRU02 and ZXRSRZZZ.
    Any help on this would be great!!
    Thanks!
    - Arun KK

    Shana,
    I dont understand your question.
    I'll give an eg.
    this is how the cube is.
    Order | Desc | Location
    101  |   'X'  | loc01
    101  |   'X'  | loc02
    102  |   'Y'  | loc01
    103  |   'Z'  | loc01
    102  |   'Y'  | loc02
    in the report, i need the o/p to  be.
    Order | Desc | count
    101  |   'X'  | 1
    102  |   'Y'  | 1
    103  |   'Z'  | 1
    i cant use 1rowcount as that counts each row and not the service orders.
    Hope this answers your question.
    Please let me know if there is a solution for this.
    Thanks!
    ~ Arun KK

  • Using Variable values to populate virtual key figure

    Hi Gurus,
    I want to populate virtual key figure in my report. I am using BADI for this. To populte VKF I want to use the variable values in my calculation. For eg. variable name is ZCAL_MON based on 0CALMONTH. When the user enters some value in this variable say 03.2010 I want to populate VKF for the last 12 months (sum for a period 04.2008 to 03.2009). I have written a customer exit in CMOD for variables but for vkf I am using BADI. Can anyone tell me how do I pass the variable value in populating vkf and also how do I total for the last 12 months?
    Utpal

    Hi,
    Did you find a solution. I'm just looking for the same thing.
    best regards..

  • 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

  • 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

  • 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 figures problem?

    Hi Gurus,
    what is Virtual key figures? at what scenerio you go for that.
    please guide me ASAP.
    In advance i appreciate you
    RK

    Hi
    Virtual key figures are used when you want to determine the value of a key figure at runtime , the key figure is not populated in the load process ie its value is not stored in the cube. The logic for populating the keyfigures is written in an SAP Exit RSR00002.
    Since the values are computed at run time, it affects the query performance if you have too many VKF or too many records in your cube.
    There is a how to guide on the steps for working with virual key figures/ characteristics.
    To give an example suppose you need an aging report where you want to show how many orders are delayed by 30 days , how many 30 to 60 days and so on based on todays date, So this number needs to change dynamically based on the date the report is run , you could use VKF in this scenario...There might be other ways of doing but just giving an example to explain the concept.

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

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

  • BEX - Virtual key-figure

    Hi gentlemen,
    I am facing a problem with a BADI that I created for populating a virtual key figure.
    I simply want to read a masterdata table and populate a key figure. When executing the query, a dump occurs with a very explicit explanation. Unfortunately, I don't know how to solve it.
    Dump:
    You attempted to assign a field to a typed field symbol,
    but the field does not have the required type.      
    Attributes in the BADI:
    P_CHA_0PLANT     Instance Attribute     Private     Type     I     Plant
    P_KYF_ZSHPQTEUT     Instance Attribute     Private     Type     I     Shipment quantity EUT
    See below.
    Define:
    method IF_EX_RSR_OLAP_BADI~DEFINE.
    DATA: l_s_chanm like line of c_t_chanm.
    DATA: l_kyfnm TYPE rsd_kyfnm.
    CASE i_s_rkb1d-infocube.
        WHEN 'ZFM_M01'.
          l_s_chanm-chanm = '0PLANT'.
          l_s_chanm-mode  = rrke_c_mode-read.
          APPEND l_s_chanm TO c_t_chanm.
    l_kyfnm = 'ZSHPQTEUT'.
    APPEND l_kyfnm TO c_t_kyfnm.
    endcase.
    ENDMETHOD. "if_ex_rsr_olap_badi~define   "
    Compute:
    METHOD if_ex_rsr_olap_badi~compute .
      FIELD-SYMBOLS: <fs_ZSHPQTEUT> TYPE /BIC/OIZSHPQTEUT.
      FIELD-SYMBOLS: <fs_0PLANT> TYPE /BI0/OIPLANT.
      ASSIGN COMPONENT P_CHA_0PLANT OF STRUCTURE c_s_data
      TO <fs_0PLANT>.
      ASSIGN COMPONENT P_KYF_ZSHPQTEUT OF STRUCTURE c_s_data
      TO <fs_ZSHPQTEUT>.
      SELECT /BIC/ZSHPQTEUT
      INTO <fs_ZSHPQTEUT>
      UP TO 1 ROWS
      FROM /BI0/PPLANT
      WHERE PLANT = <fs_0PLANT>.
      ENDSELECT.
    ENDMETHOD.
    Thank you in advance.
    Jacques

    Hi Jacques,
    Please include 2 changes:
    1. As suggested by Jen, declare Field Symbols with type ANY.
    2. Instead of directly using Field symbol values in the select query, create 2 temporary variables of type string and use them.
    After changes the method COMPUTE would look like below:
    METHOD if_ex_rsr_olap_badi~compute.
    FIELD-SYMBOLS: <fs_ZSHPQTEUT> TYPE ANY.
    FIELD-SYMBOLS: <fs_0PLANT> TYPE ANY.
    ASSIGN COMPONENT P_CHA_0PLANT OF STRUCTURE c_s_data
    TO <fs_0PLANT>.
    ASSIGN COMPONENT P_KYF_ZSHPQTEUT OF STRUCTURE c_s_data
    TO <fs_ZSHPQTEUT>.
    DATA tp_shpqty type string.
    DATA tp_plnt  type string.
    IF <fs_0PLANT> is ASSIGNED.
    tp_plnt = <fs_0PLANT>.
    ENDIF.
    SELECT SINGLE  /BIC/ZSHPQTEUT
    INTO tp_shpqty
    FROM /BI0/PPLANT
    WHERE PLANT = tp_plnt.
    IF <fs_ZSHPQTEUT> is ASSIGNED.
    <fs_ZSHPQTEUT> = tp_shpqty.
    ENDIF.
    ENDMETHOD.
    Regards,
    Hemant Khemani

  • 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

Maybe you are looking for

  • OPM Error while opening excel files

    When I open the excel file of my rule, it gives the following error. Oracle Policy Modeling An error occurred while opening the document 'C:\Documents and Settings\HCHATURV\Desktop\Customer Service\OPA\Development\Rules\Raise.xls': Unable to set the

  • While Idoc to File  XI processing : data format change

    Hi All, need help. I am processing  idoc to file in a sscenario. Here we have one  field in  Idoc is "Miscdata"   Where we are passing one String with multiple spaces" While this String goes to XI it remove the multiple space and make single space. I

  • Need help with XML response to refresh document with context and prompts

    I've been working with the Restful api for a few weeks now and have been able to figure out most of what I need to automate testing of our reports. However, one task that I have not been able to figure out is how to refresh a document that contains b

  • Problem_in_horizontal_scroll_bar

    Hi all, i have developed a form, wherein i have designed the canvas a little short than the total length of the entire columns. i want that the user should scroll it to the right when he has to... Problem is that the scroller of the scroll bar does n

  • Event Viewer Error Report ID: 23

    Source:        Microsoft-Windows-Eventlog Date:          06/04/2014 06:39:34 Event ID:      23 Task Category: Service startup Level:         Error Keywords:      Service availability User:          LOCAL SERVICE Description: The event logging service