View creation and populating key figure to datasource appended field

Hi
the data we want is like in 4 tables
J_3GVERSI  +  EQUZ + ILOA+ ANLC
HOW should i create a view on these four tables .
j_3gversi _ equnr
equz - equnr, iloan
iloa- iloan(key), comp code,asset no,asset subno
anlc- comp code asset no asset sub no
my two key figure values are in J_3gversi , and 1 more keyfigure i will append it to my datasource on this view and the value for this  will be obtained if i give 5 field values( from ANLC(table), compcode,asset no ,asset subnumbr, fiscal year and depreciatio area in where condition for select statement in cmod .)
to give these 5 values in the where condition in my cmod code for my datasource I tried to make this view.
i have linked
j_3gversi  with equz - using equnr
equz with iloa- using ILOAN ( since my asset no and asset sub number in this table is linked to equipment number  using ILOAN field)
ILOA with ANLC- using ( company code, asset number and asset subnumber)
though the field names are different for my asset number and subnumber in both the tables , they have same data element(component) -
IS it fine to join two tables with fields having different field names but same component.
asset number field name is  in ILOA-anlnr and ANLC-anln1 though component type is same - anln1 for both
similarly asset subnumber has like  ILOA- anlun and ANLC- anln2 with same component type-anln2
now in cmod for the function module i am writing select statement like this
code in cmod for transaction data
when mydatasource
loop c_t_data into lv_ctdata3
1.     SELECT SINGLE * FROM anlc WHERE bukrs EQ lv_data3-bukrs AND 
2.                                     anln1 EQ LV_DATA3-anln1 AND 
3.                                     anln2 EQ LV_DATA3-anln2 AND 
4.                                     gjahr EQ Lv_data-gjahr AND 
5.                                     afabe EQ  '01 ' . 
6.     IF SY-SUBRC EQ  0 . 
7.       CALL FUNCTION  'FI_AA_VALUES_CALCULATE' 
8.         EXPORTING 
9.           i_anlc = anlc 
10.         IMPORTING 
11.           e_anlcv = l_anlcv. 
12.     ENDIF. 
lv_data3-nbw =l_anlcv-nbw.
modify c_t_dat from lv_data3
end loop
Edited by: krishnav3.5 on Jul 8, 2011 2:07 PM

Hi ,
IS it fine to join two tables with fields having different field names but same component.
1.Yes we do this many times .We combine fields having different names but functionally they are the key values to match .
No issue with that untill they are in same format and you want to match data based on those fields .
HOW should i create a view on these four tables .
2.For view you can create view on 2-3 tables with matching fields and for complex logic you can populate additional fields via CMOD code .
Regards,
Jaya

Similar Messages

  • Creation of restricted key figure

    hi experts,
    when i will create restricted key figure and calculated key figure for reporting.any one suggest that.
    regards,
    balu.

    Hi,
    Restricted Key fig:
    By using restricted key fig you can restrict only one key fig column based on the value of char.  Assume that you have a query with key figs Price, Qty and Revenue.If u  restrict Revenue based on chars i.e either time or customer Id or Material Id etc only that revenue key fig coulumn will be effected.
    Calculate Key Fig:
    Calculated Key fig is nothing but creation of new key fig using existing key figures. Assume that you have a query with key figs Price and  Qty only. If you want to find Revenue as 
    Revenue = Price * Qty, go for Calculated Key figure.
    Assign points if  it helps u.
    Cheers....
    Sk Babu

  • Dynamic Internal Table creation and population

    Hi gurus !
    my issue refers to the slide 10 provided in this slideshow : https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b332e090-0201-0010-bdbd-b735e96fe0ae
    My example is gonna sound dumb, but anyway: I want to dynamically select from a table into a dynamically created itab.
    Letu2019s use only EKPO, and only field MENGE.
    For this, I use Classes cl_abap_elemdescr, cl_sql_result_set and the Data Ref for table creation. But while fetching the resultset, program dumps when fields like MENGE, WRBTR are accessed. Obviously their type are not correctly taken into account by my program.
    Here it comes:
    DATA: element_ref             TYPE REF TO cl_abap_elemdescr,
          vl_fieldname               TYPE string,
                 tl_components         TYPE abap_component_tab,
                 sl_components         LIKE LINE OF tl_components_alv,
    linetype_lcl               TYPE REF TO cl_abap_structdescr,
    ty_table_type            TYPE REF TO cl_abap_tabledescr,
    g_resultset             TYPE REF TO cl_sql_result_set
    u2026
    CONCATENATE sg_columns-table_name '-' sg_columns-column_name INTO vl_fieldname.
    * sg_columns-table_name contains 'EKPO'
    * sg_columns-column_name contains 'MENGE'
    * getting the element as a component
    element_ref ?= cl_abap_elemdescr=>describe_by_name( vl_fieldname ).
    sl_components-name  = sg_columns-column_name.
    sl_components-type ?= element_ref.
    APPEND sl_components TO tl_components.
    * dynamic creation of internal table
    linetype_lcl = cl_abap_structdescr=>create( tl_components ).
    ty_table_type = cl_abap_tabledescr=>create(
                      p_line_type = linetype_lcl ).
    u2026
    * Then I will create my field symbol table and line. Code has been cut here.
    CREATE DATA dy_line LIKE LINE OF <dyn_table>.
    u2026
    * Then I will execute my query. Here itu2019s: Select MENGE From EKPO Where Rownum = 1.
      g_resultset = g_stmt_ref->execute_query( stmt_str ).
    * Then structure for the Resultset is set
      CALL METHOD g_resultset->set_param_struct
        EXPORTING
          struct_ref = dy_line.
    * Fetching the lines of the resultset  => Dumpu2026
      WHILE g_resultset->next( ) > 0.
        ASSIGN dy_line->* TO <dyn_wa>.
        APPEND <dyn_wa> TO <dyn_table>.
      ENDWHILE.
    Anyone has any clue to how prevent my Dump ??
    The component for MENGE seems to be described as a P7 with 2 decimals. And the resultset wanna use a QUAN type... or something like that !

    Hello
    I have expanded your sample coding for selecting three fields out of EKPO:
    *& Report  ZUS_SDN_SQL_RESULT_SET
    *& Thread: Dynamic Internal Table creation and population
    *& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1375510"></a>
    *& NOTE: Coding for dynamic structure / itab creation taken from:
    *& Creating Flat and Complex Internal Tables Dynamically using RTTI
    *& https://wiki.sdn.sap.com/wiki/display/Snippets/Creating+Flat+and+
    *& Complex+Internal+Tables+Dynamically+using+RTTI
    REPORT  zus_sdn_sql_result_set.
    TYPE-POOLS: abap.
    DATA:
    go_sql_stmt       TYPE REF TO cl_sql_statement,
    go_resultset      TYPE REF TO cl_sql_result_set,
    gd_sql_clause     TYPE string.
    DATA:
      gd_tabfield      TYPE string,
      go_table         TYPE REF TO cl_salv_table,
      go_sdescr_new    TYPE REF TO cl_abap_structdescr,
      go_tdescr        TYPE REF TO cl_abap_tabledescr,
      gdo_handle       TYPE REF TO data,
      gdo_record       TYPE REF TO data,
      gs_comp          TYPE abap_componentdescr,
      gt_components    TYPE abap_component_tab.
    FIELD-SYMBOLS:
      <gs_record>   TYPE ANY,
      <gt_itab>     TYPE STANDARD TABLE.
    START-OF-SELECTION.
    continued.

  • "new selection", restricted key figure and basic key figure

    Hi,
    I have a test report and i have a basic keyfigure "ZRevenue" and "restricted key figure"(its defined over "ZRevenue") and
    a "new selection"(its defined over "ZRevenue").
    Now that i have "material number" and "material color" and "request id" in the rows. ("Material color" is a navigational attribute of material number).
    In the column level i have a basic key figure  "ZRevenue" and "restricted key figure"(its defined over "ZRevenue")  and
    a "new selection"(its defined over "ZRevenue") .
    In a "restricted key figure" or "new selection", we can include a basic key figure or new formula or calculated key figure or an already restricted key figure into it, then we restrict it, with one or more characteristic values. In the report output we get KF values only for those characteristic values, with which it has been restricted. Please correct me if my understanding is wrong.
    Initially i restricted the "new selection" (with material number 1 to 3) and "restricted key figure" (with material number 1 to 4).
    In the cube i have material numbers 1 to 11. Now all the values were displayed from 1 to 11, but for the
    "new selection" (with material number 1 to 3) and "restricted key figure" (with material number 1 to 4) i got values only for 1 to 3 and values for 1 to 4 respectively. This is as expected and is working fine.
    Now i tried to restrict the basic keyfigure  "ZRevenue" with material number 1, the output was only until the material number 4 (this is the greatest value of the material number defined over the "restricted key figure").
    Then i tried to restrict the "new selection" (with material number 1 to 9) , then the output was from 1 to 9 material numbers.
    If i remove the restriction over the basic keyfigure  "ZRevenue" , then i get all the material numbers from 1 to 11, for "new selection" i get values for the material number 1 to 9 and for "restricted key figure" i get values for the material numbers 1 to 4.
    Can some one explain me why this behavior?
    Edited by: sapbi enthusiastic on Jan 31, 2012 11:48 AM

    Hi,
    This is where set theory comes in handy
    So what you have is a basic KF (BKF), a selection (SEL), and an RKF.
    When producing an output, BEx seems to be looking for the union of all the restrictions you place on these. So when your BKF is not restricted, the union comes out to everything in the underlying DSO. When you restrict the BKF for material number 1, this is how the restrictions might have been processed internally
    BKF: Restriction on material 1
    RKF: Restriction on material 1-4
    SEL: Restriction on 1-3
    Union of these three: 1-4
    When you remove the BKF restriction and make SEL restricted to 9, this is how it plays out
    BKF: NO Restriction on material
    SEL: Restriction on material 1-9
    RKF: Restriction on 1-4
    Union of these three: everything.
    As the union ends up giving you everything, you get 11 records. However, as SEL is restricted for 1-9, the SEL will have values for the materials 1-9. Likewise for RKF, you'll get values only for materials 1-4. Hope this clears things up!
    Regards,
    Suhas

  • How  use non cumulative key figure and noncumulative key figure screenshot

    how  use non cumulative key figure and noncumulative key figure screenshot

    Hello,
    Please see this docs for Non-Cumulative and Snapshot scenario,
    [How to Handle Inventory Management Scenarios in BW (NW2004)|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f83be790-0201-0010-4fb0-98bd7c01e328]
    [Non-Cumulative Values / Stock Handling|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e0b8dfe6-fe1c-2a10-e8bd-c7acc921f366]
    Thanks
    Chandran

  • Multi provider objects and restricted key figure definition

    I have the following scenario:
    1. I have a multi provider which is used as a template to build a second multiprovider the difference being one of the part provider cubes is replaced by a new cube
    2. There is a query built off the original multi provider which consists of a restricted key figure.  The definition of the restricted key figure is as follows
        Characteristic 1 - restricted to records with value 'A'
        Characteristic 2 - restricted to records with value 'Blue'
        Key Figure - Total Amount
    3. If I go to the original multiprovider and look at how the characteristics are identified and the key figure assigned the details are as follows
         Characteristic 1 - identified from all part providers including the part provider to be replaced
        Characteristic 2 - identified from all part providers including the part provider to be replaced
        Total Amount - assigned from two part providers (which are also involved in the identification of   Characteristic 1 and 2)  not including the part provider to be replaced
    4. In the new multi provider the details are as follows
    Characteristic 1 - identified from all part providers excluding the replacement part provider
        Characteristic 2 - identified from all part providers excluding the replacement part provider
        Total Amount - assigned from two part providers (which are also involved in the identification of   Characteristic 1 and 2)  not including the part provider to be replaced
    My thoughts are that it does not matter that Characteristic 1 and 2 cannot be identified from the new part provider since as long as the two part providers which are used to assign Total Amount are available in the new multi provider the values shown from the restricted key figure will be the same.  Is this correct? Thanks

    Hi,
    Yes this is correct. As long as you are reporting on Total Amount, the replacement cube will not make a difference because you never identified total amount from it. Did you face any issues?

  • Relation between progress and stastical key figure

    Dear Experts,
                 Is there any relation between progress and stastical key figure?
                 If there please let me know.
             Thanks in advance.
    Best Regards,
    Punith.

    Hi Raj,
        I am new to PS functionality. I am testing one functional module for "Progress Read" and its not woring fine. As I reported the issue, I got an reply saying relation with SKF should be configured first.
       Even, I believe there is SKF and progress were different.
    Rgds,
    Punith.

  • APODPDANT and Auxiliary Key Figures

    Hi All,
    Please help me when i am creating planning book how can i add APODPDANT Key Figures and tell me what is Auxiliary Key Figures how can i use this in planning book.

    Hi
    IF u want to add the apodpdant keyfigure in to planning book forst it has to be defined in the planning area that u create.
    please look at /sapapo/msdp_admin --->planning area -->details.IF u dnt find it add it in planning area then to planning book.
    Auxilary key figures are used when u want to perform some calculations and store for temporary basis.Use it again to display the final key figure.Mostly auxilary key figures are used in macors and in statistical forecsting techniques.
    For ex:
    U have to calculate total demand for forecast +  corrected forecast + additional forecast. Then u use this key figure as total demand and use for further calculations.
    The data in auxillary key figures are not saved in demand planning.U can add this key figure in data view as auxillary keyfigure tab with necessary description
    HOpe am clear
    Thanx

  • Creation of new key figure at report level depending on the month range

    Dear All,
    I have a requirment where user wants to see the dollar values for the Amount key figure. Data is stored in the INR value in the cube.
    Exchange rate values keep on changing depending upon the quarter. For all four quarters we have four different exchange rate.
    Now system has to identify the applicable exchange rate and show a new column with the USD value just beside the INR values column.
    How best we can achieve this.
    Thanks & Rgds,
    Anup

    Hi
    You can have currency translation at query level for achieving this.
    https://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/600157ec-44e5-2b10-abb0-dc9d06ba6c2f&overridelayout=true
    Translation in Query
    Regards
    Ravi
    Edited by: Ravi Naalla on Aug 17, 2009 11:56 AM

  • Non Cumulative and Cumulative Key Figure

    Hi all:
       Can anyone clarify difference between Non cumulative KF and Cumulative KF.What is the use of these two and when we go for this.?
    Please send me if any docs [email protected]
    Rgds
    MSK
    Note: Points to be reward.

    Hi,
    Check this Link:
    http://help.sap.com/saphelp_bw32/helpdata/en/80/1a62dee07211d2acb80000e829fbfe/frameset.htm
    take a look to https://websmp105.sap-ag.de/bw -> SAP BW InfoIndex -> Non-cumulatives
    here you can find:
    Non-Cumulative Values 3.x (pdf)
    Also Check this:
    Cumilative and non Cumilative
    Non cumulitive Key figures
    Bye
    R.Ravi

  • Virtual provider and cumulative key figure

    Hi guru,
    Is it possible to use a cumulative key figure in a virtual provider?
    Thanks a lot

    Hi
    Non cumulative key fig is not a part of Fact table ,it is a part of Infocube defination which is calulated on the basis of inflow and out flow whic are essentialy KF avail in the factable of the Infocube
    NonCumulative kF Is calculated within InfoCube defination using exp. Agg. on last value  and last inflow substracting outflow .
    Inview of the above VP will not be able to contain NCkey Figure

  • Query with characteristics and NO Key figures

    Hi Everyone,
    I need to create a query with 3 char ... customer segment, customer type, climate zone. All are characteristics and there are no key figures.
    I went through the forum reading similar posts but couldn't figure out the best way.
    It can be done using Replacement path, Create formula variable with replacement path of your characteristic. Some posts also talked about writing some code.
    Like to know the best way of making this query.
    Can you please give me step by step procedure.
    Thanks,
    Kumar.

    I thought, if there are no key figures the query designer might give an error while saving, like "no key figures defined" or something like that. Thats why I came up with the question.
    I still have to document the detail requirement of user and he is not available. So just figuring out all the possibilities.

  • IO settlement and statistical key figures

    Hi experts,
    Is it possible to make settlement based on statistical key figures (ex: M2) for internal order? as it is possible for the cost center (via cycle) i wondered if there is a way to do it for internal order.... Or the settlement with statistical key figures is only possible via cycle and thus only for CC??
    Thanks in advance,
    Chris

    Hi Chris
    This is possible, but in a slightly different way
    Settlements cant happen based on SKF.. however, you can use Internal Orders as senders in assessment cycles.. For this refer note Note 605281.... It has a program which will allow you to use IO as senders in assmt cycle along with CC as senders
    Then you can allocate from Internal orders based on SKF.. You need to define cycle in KSU1 and execute from KSU5... KO88 wont come into picture
    Regards
    Ajay M

  • Dynamic component creation and population

    I'm trying to create a page such that , based upon some backing bean, a different component would be rendered and populated based upon a property in that bean.
    For instance
    public class MyBean {
      private int type;
      private String data;
      getters/setters...
    }Say the type can be sex (a radio button component), level of user (selectOne with the values of gold, platinum and silver) or location (a textfield) (these are an example of the type of data--there are many more entries that are of one of these three component types that need to be handled). I have a list of these beans that could go in a dataTable or whatnot, so I'd like to be able to dynamically generate the components. Does anyone have any suggestions or input?
    My guess is a component will need to be returned from the bean that describes how it should be rendered--I'm just looking for a jumpstart on the best way to do this, see if anyone has code snippets, references, etc.
    TIA.
    P.S. Apologies if this is posted twice...some errors when I tried to post this the first time...

    So, are you saying to have all three types of components in a given line of the datatable, wire each up to do have the appropriate values (male/female or silver/gold/platinum) and then have a rendered argument read a bean property such as isRadio, isSelect or isText and just render the appropriate one?

  • Materialized View - creation and schedule (To automate Refresh)

    Hi All,
    I have one table based on SQL Query (multiple tables) and loading data every day through procedure.
    When I execute the procedure is taking lot of time to load data. That’s why I am planning to create Materialized view to refresh the data in a table every day at some point of time (ex:-9.00 am).
    Exclude procedure and materialized view are there any ways to refresh the data?
    Can you and all please help me to create materialized view and schedule (Automate refresh).
    begin
    insert into CLAIMS_PRODUCT_TAB
    select
    substr(at.ATN_VOUCHER_NUMBER,1,6) as BRANCH,
    t.MONTH_NAME as MONTH,t.FISCAL_YEAR as YEAR,
    bb.ACC_ACCOUNT_TYPE as TYPE,
    aa.ACC_DEPARTMENT_CODE as DEPT,
    pr.PRODUCT_NAME as PRODUCT,
    case bb.ACC_ACCOUNT_TYPE when '1301' then 'Claims Paid' when '5383' then 'Claims OS' end as HEAD,
    case aa.ACC_DEPARTMENT_CODE when '31' then 'OD' when '32' then 'TP' when '39' then 'TP Pool' end as DEPT_NAME,
    count(distinct at.CLAIM_ID) as CLAIMS,
    --count( distinct at.POLICY_ID) as POLICIES,  
    sum(atd.ATD_CREDIT_AMOUNT - atd.ATD_DEBIT_AMOUNT) as totals
    from
    ACCOUNTING_TRN_DETAIL atd,time t,
    ACCOUNT bb,
    ACCOUNT aa,claim c, policy p,product pr,
    accounting_transaction at
    where bb.ACC_ACCOUNT_ID = aa.ACC_ACC_ACCOUNT_ID
    and at.CLAIM_ID = c.CLAIM_ID
    and c.POLICY_ID = p.POLICY_ID
    and p.PRODUCT_ID = pr.PRODUCT_ID
    and aa.ACC_ACCOUNT_ID = atd.ACC_ACCOUNT_ID
    and atd.ATN_ACCOUNTING_TRANSACTION_ID = at.ATN_ACCOUNTING_TRANSACTION_ID
    and trunc(at.ATN_TRANSACTION_DATE) = t.CAL_DATE
    and (bb.ACC_ACCOUNT_TYPE in ('1301','5383'))
    group by substr(at.ATN_VOUCHER_NUMBER,1,6)
    ,t.MONTH_NAME
    ,t.FISCAL_YEAR,bb.ACC_ACCOUNT_TYPE
    ,aa.ACC_DEPARTMENT_CODE
    ,pr.PRODUCT_NAME
    , case bb.ACC_ACCOUNT_TYPE when '1301' then 'Claims Paid' when '5383' then 'Claims OS' end
    ,case aa.ACC_DEPARTMENT_CODE when '31' then 'OD' when '32' then 'TP' when '39' then 'TP Pool' end );
    end;
    Thanks and Regards
    Venkat

    Is the MV and the source tables on the same database? If this is a remote MV, then check the source site if there are any issues (TEMP, UNDO space issues).

Maybe you are looking for

  • Where is par file of UWL ?  I need to modify UWL description

    Hello guys, We have a egent requriement to modify the description of UWL . e.g, "Tracking" change to "Sendbox(In Chinese)" , "Task " change to "Inbox(In Chinese)" . And there are serval descriptions of buttons and dropdown list item need be customize

  • ME57 transaction with possibility to show in ALV layout

    Hi experts, I need change the alv grid in  the transaction ME57. To this, I copied the program RM06BZ00 (scree, includes... ) When I try execute the program with ALV layout the message ''Scope of list ALV not defined (please correct)" shows. To resol

  • What is this file

    I am in the process of moving pictures off my PC to my Mac. I am using a USB Memory Stick. Each time I move pictures a file also appears in the folder "thumbs.db" With an ICON View, its a gray box with the word 'exec' inside. Right clicking for info,

  • Please explain me constructor

    Hello all, could you please exaplain me the meaning of the following constructor: public class Details {     Hashtable mapping = new Hashtable();     Vector values = new Vector();     char optionChar;     public Details() {         this('/'); }Thakns

  • MIR4 Screen Layout

    Hello Experts Client wants one new layout which is not available in standard view.The new one would consist only specific columns which can be found in any layout e.g. - PO, PO quantity , PO text, Amount, unit, item , Material, GR Qnty, IR Qnty and s