Calculated virtual characteristic

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

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

Similar Messages

  • How to create Virtual InfoProvider with Services - Virtual Characteristic

    Hi all,
    I need to create a virtual infoprovider that also fills a virtual characteristic in order to display custom characteristics and calculated values based on user selection.
    Basicaly what I want to do is send a variable in a virtual characteristic equal to the values I want to fill in the characteristic.  So for instance if my base cube contains the infoobjects Brand, Product Line, Region and Country I want a  have a new infoobject that has no data, but fills itself with the vales of the infoobject I specify at query time on the virtual cube.
    The reason for this is I am trying to create a WAD using the delta chart (waterfall graph) that will show the difference between the plan and actual totals for a specific characteristic in Profitibility analysis.
    I have a document that explains the situation.  Send me your mail address and I will send you the document.
    Kind Regards

    We found a way to build the structure for this.
    Regards

  • Creation of virtual characteristic

    I have to create a virtual characteristic (ZVCDOCNO) same as another object (Document Number - ZDOC_NO).
    This virtual characteristic should have same data as Document number but should contain values that begin with 11.
    I have checked the forum and found some good inputs, but all of them have been done using BADIs.
    Is there any other method other than BADIs?
    Solution suing BADI
    [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/60e34f63-f44c-2c10-488e-c89b04e0ca7c?QuickLink=index&overridelayout=true]
    [http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b04be008-86cc-2c10-4bad-e517ea3f4c80?QuickLink=index&overridelayout=true]
    Using BADIs what will be the DEFINE and COMPUTE codes.

    I created and interface.
    In the Class interface
    Attributes tab
    Attribute          Level              Visibility     Typing    Associated Type
    P_CHA_ZDOC_NO      Instance Attribute      Public         Type      VBELN
    P_CHA_ZVCDOCNO     Instance Attribute      Public         Type      VBELN
    In Methods tab
    IF_EX_RSR_OLAP_BADI~DEFINE
    method IF_EX_RSR_OLAP_BADI~DEFINE.
      CASE i_s_rkb1d-infocube.
        When 'ZBKDSO'.
          Append 'ZVCDOCNO' to c_t_chanm.
      ENDCASE.
    endmethod.
    IF_EX_RSR_OLAP_BADI~COMPUTE
    method IF_EX_RSR_OLAP_BADI~COMPUTE.
    FIELD-SYMBOLS <fs_zdoc_no> TYPE /BI0/OIZDOC_NO.
      FIELD-SYMBOLS <fs_zvcdocno> TYPE /BIC/OIZVCDOCNO.
    If P_CHA_ZDOC_NO is not initial.
    ASSIGN COMPONENT P_CHA_ZDOC_NO OF STRUCTURE c_s_data to <fs_zdoc_no>.
    IF <fs_zdoc_no>(2) = '11'.
    <fs_zvcdocno> = <fs_zdoc_no>.
    ENDIF.
    endif.
    endmethod
    I still find some logic missing.  What are the changes to be done to code?

  • Add new virtual characteristic in report writer

    Dear gurus,
    I would like to add a new virtual characteristic 'ZZWKDT' (work done date) so that I can filter my report with this selection criteria. This field has been added to structure "CI_CCR1S". But I don't have any idea on where should I code my program in order to tell the system to fill the "Work done date" from the data I retreived and filter tthose record which not meet with user selection from being displayed.
    Pls guided me accordingly asap.
    Thanks & regards,
    LOI

    Dear gurus,
    I would like to add a new virtual characteristic 'ZZWKDT' (work done date) so that I can filter my report with this selection criteria. This field has been added to structure "CI_CCR1S". But I don't have any idea on where should I code my program in order to tell the system to fill the "Work done date" from the data I retreived and filter tthose record which not meet with user selection from being displayed.
    Pls guided me accordingly asap.
    Thanks & regards,
    LOI

  • Urgent:   Net due date virtual characteristic.

    Hi,
    We are implementing net due date virtual characteristic. Could some please provide the coding for implementing this in ZXRSRZZZ program. Its very urgent.

    Hi shiva,
    sent to ur mail
    hope it helps
    bhaskar

  • Hierarchy in BEx using a virtual characteristic

    Hello BW Experts,
    I encountered a problem with the display of a virtual characteristic in context with a hierarchy.
    The goal is to display a weighted rating (the virtual characteristic) for each hierarchy level individually.
    What I get:
    IAS Category Weighted Rating Ratio Weighted MV / MV
    Level 1 A 5
    AAA 2
    Level 2a A 5
    AAA 1
    Stock 1 A 5
    Stock 2 AAA 1
    Level 2b AAA 1
    Stock 3 AAA 1
    What I'd like to get:
    IAS Category Weighted Rating Ratio Weighted MV / MV
    Level 1 AA 3
    Level 2a A 2
    Stock 1 A 5
    Stock 2 AAA 1
    Level 2b AAA 1
    Stock 3 AAA 1
    Level 2 is the lowest level in the hierarchy and Level 1 a text node. The weighted rating is determined in a SAP Exit (include ZXRSRZZZ) in a mapping ODS whereas the ratio Weighted Market Value / Market Value (a virtual key figure) is the lookup key. The solution might be something like the declaration of the aggregation level for the virtual characteristic in the SAP Exit.
    Any suggestions would by highly appreciated.
    Thanks in advance.
    Cheers,
    Manuel

    Hello,
    why do you not using an Hierarchy with Characteristics and Attributes? This should be much easier.(use a balanced hierarchy)
    I do not believe, that you have a chance to do the rating for the levels with a virtual characteristic.
    Another possibility is to use an virtual InfoPovider with Services and do the data collection by your own.
    Kind reg.
    Michael

  • Simple logic - virtual characteristic

    I'm writing a code for a virtual characteristic, but need a couple pieces to get in place. please help with the following problem:
    In my logic, I have an internal table itab1 whose contents are as follows:
    plant sale
    1001 100
    1001 50
    2001 300
    First I want to aggregate multiple rows like below:
    plant sale
    1001 150
    2001 300
    Second, I want to create another internal itab2 which ranks plants as follows:
    plant sale rank
    1001 150 2
    2001 300 1
    Please help with logic.

    Hello,
    1) When you select values in the internal table make you select statement as below;
    select plant sum( sales ) as sales from table into corresponding fields of table itab1 group by plant.
    This will give output as:
    plant sale
    1001 150
    2001 300
    2) For ranking, i believe you want them to be ranked based on the sales they have. For that do the foll:
    data: count(3) type n.
    itab2[] = itab1[].
    sort itab2 descending by sales.
    count = 1.
    loop at itab2 into wa2.
    wa1-rank = count.
    modify itab2 from wa2.
    count = count + 1.
    endloop.
    clear count.
    Regards,
    Shashank

  • Batch Creation Date  as a Virtual Characteristic in 0IC_C03 Inventory Cube

    Dear Experts
    Currently we have a Stock Aging report based on Document date. But our management requirement is Batch date wise.
    Currently I am having Batch Creation date as an Attribute of 0Material info Object.
    Is it possible to create a Virtual Characteristic for Batch Date and Include in the Cube?
    If Possible please explain me the Procedure to Create Characteristic.
    Thanks in Advance.
    Viru
    Edited by: Lankem-IT on Apr 15, 2011 3:43 PM

    Refer link
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/30f15839-0cf1-2b10-c6a7-ebe68cc87cdc?QuickLink=index&overridelayout=true
    & check ur e-mail.

  • BADI for Virtual Characteristic

    Hi,
    I am able to use BADI to populate Virtual Key Figure, but getting an error when I use similar code for Virtual Char.
    Following are the details
    Characteristic InfoObjects IO_MATRAL, IO_PLANT, IO_CMATRL (virtual char)
    I want to assign the value of IO_MATRAL to IO_CMATRAL using BADI.
    Attributes are
    P_CHA_IO_CMATRL  associated type I (level: instance, visibility: private)
    P_CHA_IO_MATRL   associated type I (level: instance, visibility: private)
    DEFINE method
    method IF_EX_RSR_OLAP_BADI~DEFINE.
      DATA: l_s_chanm   TYPE rrke_s_chanm,
            l_kyfnm     TYPE rsd_kyfnm.
      FIELD-SYMBOLS:
            <l_s_chanm> TYPE rrke_s_chanm.
    CASE i_s_rkb1d-infocube.
       WHEN 'IC_SEKH'.
        l_s_chanm-chanm = 'IO_MATRL'.
        l_s_chanm-mode = rrke_c_mode-read.
        APPEND l_s_chanm TO c_t_chanm.
        l_s_chanm-chanm = 'IO_CMATRL'.
        l_s_chanm-mode = rrke_c_mode-read.
        APPEND l_s_chanm TO c_t_chanm.
    ENDCASE.
    ENDMETHOD.                    "if_ex_rsr_olap_badi~define
    INITIALIZE method
    method IF_EX_RSR_OLAP_BADI~INITIALIZE.
      DATA: l_global_name TYPE string.
      FIELD-SYMBOLS:
            <l_global>    TYPE i,
            <l_s_sfc>     TYPE rrkg_s_sfc,
            <l_s_sfk>     TYPE rrkg_s_sfk.
    there's no need to change this method
    Just create attributes for each charactersitic
    with name P_CHA_<characteristic> TYPE i.
    and constants for each key figure with name
    P_KYF_<key figure> TYPE i.
      CLASS cl_exm_im_rsr_olap_badi DEFINITION LOAD.
    get field postions for characteristics in structure
      LOOP AT i_th_sfc ASSIGNING <l_s_sfc>
           WHERE user_exit NE rrke_c_mode-none.
    field name in structure is keyreturnnm
    name of the global variable
        CONCATENATE 'P_CHA' <l_s_sfc>-chanm
            INTO l_global_name
            SEPARATED BY '_'.
    fill the global variable
        UNASSIGN <l_global>.
        ASSIGN (l_global_name) TO <l_global>.
        CHECK <l_global> IS ASSIGNED.
        <l_global> = cl_exm_im_rsr_olap_badi=>get_field_position_d(
                                           i_fieldnm = <l_s_sfc>-keyreturnnm
                                           i_s_data  = i_s_data ).
      ENDLOOP.
    endmethod.
    COMPUTE method
    method IF_EX_RSR_OLAP_BADI~COMPUTE.
      FIELD-SYMBOLS: <fs_io_cmatrl>   TYPE ANY,
                     <fs_io_matrl>    TYPE ANY.
      ASSIGN COMPONENT p_cha_io_matrl  OF STRUCTURE c_s_data TO <fs_io_matrl>.
      ASSIGN COMPONENT p_cha_io_cmatrl OF STRUCTURE c_s_data TO <fs_io_cmatrl>.
      <fs_io_cmatrl> = <fs_io_matrl>.
    endmethod.
    I am not getting any value in IO_CMATRL in the query.
    Even when I assign hardcoded value like 's', in compute method, it's not showing the value in the query result.
    Can you guys please suggest what am I missing here? (similar code works for Virtual keyFig. implementation)
    Thank you,
    Lakshmi

    Hi,
    In DEFINE Method
    l_s_chanm-chanm = 'IO_MATRL'.
    l_s_chanm-mode = rrke_c_mode-read.
    APPEND l_s_chanm TO c_t_chanm.
    l_s_chanm-chanm = 'IO_CMATRL'.
    l_s_chanm-mode = rrke_c_mode-read.
    APPEND l_s_chanm TO c_t_chanm.
    If u2018IO_CMATRLu2019 is your virtual characteristic u2026try changing the read mode to  rrke_c_mode-no_selection
    Thanks,
    Advait

  • How to fulfill the virtual characteristic value into report

    Hi Experts,
          I am working on one reporting requirement that needs to add reference date (virtual characteristic) field to report.
          I have added reference date field to query and able to display the field in report.But I am not able to display reference date field runtime data in to report output.
        Could someone please help me on this how to display this virtual characteristic values into report.where the runtime variable values are stored.How to fill the data etc.
    Thanks in advance.
    Best Regards,
    Hari.
    Edited by: k hari on Jan 29, 2008 6:22 AM
    Edited by: k hari on Jan 29, 2008 6:24 AM

    You can achieve this using Customer Exit or BADI. Check the folllowing link.
    http://help.sap.com/saphelp_nw70/helpdata/en/ac/ef1f43daac9a448f0150a02e3a7aba/content.htm
    If you are using BADI
    You can create Virtual CHAR in BADI using transaction SE19
    In this transaction you can create a new or display the existing BADI.
    There you can see two tabs
    The Attribute Tab we need to give the name of the Multiprovider on which the query with the virtual char is getting executed.
    The Inerface Tab has three following sections. Need to write the ABAP code for all the three.
    Define : Defind all the characteristics and virtual char that will be used for populating virtual char
    Initialize : Initialize them
    Compute : Here you will have to write the logic for populating the virtual char.
    Once the logic is written then you can use this char in your query .
    Hope this helps.

  • Filter a query based on virtual characteristic

    Hi,
    I have a query with a virtual characteristic.
    I need to filter the query based on the results in that characteristic.
    Can it be done?
    If not, can I delete records after the stage where the characteristic is filled and before the result of the query appears?
    Thanks,
    Hagit

    Hi Hagit,
    To filter a query on the value of a virtual characteristic value directly would not be possible.
    Please check the below Forum topic and see if the note 1088469 helps you find a solution to your problem.
    Virtual characteristics or key figures load data with BIA/BWA?
    Alternatively, you can think about using a query viewwith filter to filter the virtual characteristic value. Do not have a refined solution suggestion, but you can think in that direction, I guess.
    Hope it helps.
    Thanks,
    Abhishek.

  • If statement in calculated batch characteristic (dependencies)

    I have a little problem with calculating a certain batch characteristic.
    The situation is the following:
    I have batch char A, batch char B and batch char C. Batch char C is the result of the sommation of char A and B. The problem I have now is that batch char C only should be calculated when batch char A and B are different from 0.
    I have a custom build interface that imports QM data to the batch chars. Default, all my batch chars are set to 0 so if I just say $self.charC = $self.charA + $self.charB, I always get a value.
    Is it possible to some sort of IF statement to check if the value is different from 0?

    Dear,
    You need to try with variant table
    take all the combination and enter in a variant table and see the result...it works
    example
    A     B      C
    0      0      space
    0      1      sapce
    1      1      space
    I hope you got it

  • Virtual Characteristic value not populating in the query output

    Hi Experts,
    I am new to BAPI and I am using this to populate the values of virtual characteristics.
    I wrote the below code to populate if an order status got some status value then i need to populate the flag y if not n.
    I got the order value in the reprot. I need to go to order master data and should get the status and then i have to do the comparision and populate the flag zww_teco in the report.
    The below is the compute method of my implementation class.
    FIELD-SYMBOLS :
    <fs_0cs_order> TYPE ANY,
    <fs_zww_teco> TYPE ANY,
    <fs_status>  TYPE ANY.
    if p_cha_0cs_order > 0.
      ASSIGN COMPONENT p_cha_0cs_order OF STRUCTURE C_S_DATA to <fs_0cs_order>.
    endif.
    if p_cha_zww_teco > 0.
      ASSIGN COMPONENT p_cha_zww_teco OF STRUCTURE C_S_DATA to <fs_zww_teco>.
    endif.
    Select single /BIC/ZSYSTATUS
        from /BI0/PCS_ORDER into <fs_status>
       where CS_ORDER = <fs_cs_order>.
    if <fs_status> CP 'TECO'.
      <fs_zww_teco> = 'Y'.
    else.
        <fs_zww_teco> = 'N'.
    endif.
    But I am not sure why the values are not populated. But when i debug , i could see the values for
    P_cha_0cs_order = 35
    p_cha_zww_teco = 54
    But i could get the values of <fs_0cs_order>, <fs_zww_teco> after assign component statement.
    And it is firing me a dump in select statement. Also when I click c_s_data i am getting S____274, S____505 fields like that in the structure but i could see p_cha_0cs_order
    Can you please guide where i am missing ...
    Thanks
    Vamsi
    Edited by: vamsi talluri on Nov 9, 2011 6:14 PM

    Hi Sushant,
      RSRT --> Enter Query Name
    Click on Technical Information --> If " Virtual Char./Key Figures " = Y
    In my case , even then i clciked generate report,
    even after that P_CHA_0CS_ORDER = 35
    and after assign component P_CHA_0CS_ORDER of structure c_s_data to <FS_0CS_ORDER>.
    the <FS_0CS_ORDER> is nothing , here i should get the value of cs_order value of that record but it is coming empty which i am not able to rectify. How should i change or i need to put any other setting to get the value populated into my <FS_0CS_ORDER>.
    Can you please guide me .
    Thanks
    Vamsi

  • 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

  • How to show "calculated" InfoObject / characteristic with-in query level

    Dear Expert:
    I have infoObject which is a CHAR(1) and contain only 3 values
    "1"
    "2"
    "3"
    But I want the query to show only CHAR(1)
    "1" as "N"
    "2" as "N"
    "3" as "Y"
    Is there any way to do this ?
    Points will be rewarded
    Regards,
    Ahmad.

    Hi William:
    The display attribute is another InfoObject right ? So I have to create an update rule to update the infoObject from whatever InfoSource I have ...
    Am I correct ?
    If I were correct, then It's quite an expensive process as I have to do some development and prepare a lot of documentation
    Thank you for your time anyway

Maybe you are looking for