Adding a field to materialized view

I have a materialized view called DEVICE which gets it's data from a table called device in another database (asset3). A new field was added to the device table in the asset3 database. In order to add that field to the materialized view, will I need to drop the materialized view and recreate it or can I run an alter command to add the field?
SQL> select MVIEW_NAME,QUERY from DBA_MVIEWS where OWNER='DWH' and MVIEW_NAME='DEVICE';
MVIEW_NAME
QUERY
DEVICE
select * from device@asset3Thanks
Ravi

You have to recreate materialized Views
Example(REFRESH FAST ON COMMIT):
SQL> CREATE MATERIALIZED VIEW LOG ON B with rowid;
SQL> CREATE MATERIALIZED VIEW MV_B REFRESH FAST ON COMMIT with rowid AS select * from B;
SQL> alter table B add k number;
SQL> ALTER MATERIALIZED VIEW LOG ON B add (k);
SQL> drop MATERIALIZED VIEW MV_B;
SQ> CREATE MATERIALIZED VIEW MV_B REFRESH FAST ON COMMIT with rowid AS select * from B;Edited by: Surachart (HunterX) on Jun 17, 2009 11:11 PM

Similar Messages

  • Adding custom fields to table view assignment block

    Hi All,
      I want to add two news fields to 'Service Contract Item Level' in 'Object List' assignment block. How can i add these two custom fields to table view assignment block using AET. I have tried to add new fields using AET but there is no business object supports to my requirement.
    Thanks & Regards
    Nitish

    Hi Nitish,
    As naveen sadid use Cutomer_i object . I guess it will be more appropriate.
    And following link will be helpful for AET creation.
    CRM 7.0 How to --4 Adding Custom Fields With The New Application Enhancement Tool (AET)
    Regards
    Loks

  • Adding new field in Database view

    Hi,
            I am adding a new field to existing database view so only adding is enough or shall I use database utility. Please let me know.
    Thanks & Regards,
    Joseph

    Views are basically, collection of fields from diffrent databse tables.You can define extra selections for fields in a selection view at runtime using dynamic selections. The extra selections are sent to the database and help to minimize the number of database accesses. This works as long as the database tables in the selection include of the logical database are defined for dynamic selections, and that the database program is programmed accordingly.
    You can go to SE11, type the name of the view and add the additional field present in any of the tables and activate the view. Once activated the view will reflect the new field added and you can use this for selection purposes.
    Regards
    Vasu

  • Adding new field in a view

    Hi,
    I have added one additional field in an existing view through se11 as the table on which the view was created contains this additional field.
    After adding it in the view , i have regenerated it through se54.
    Now the field is coming in the maintainence view, but its contents are not there.
    Is there anything else I am missing out here?
    Thanks & Regards,
    Soumya.

    Hi,
    Join condition is proper and as per the condition the field contents should come.
    Regards,
    Soumya.

  • Adding Custom Fields in Standard View - How to save data to Table

    Dear Experts,
    One View is having UI elements from a standard table /RPM/ITEM_D. Added 2 custom fields in this table using enhacement. Now enhanced that standard View and added these 2 custom fields. When I am saving the application, these 2 fields values aslo should be saved. In the context all fields are present from table /RPM/ITEM_D except the custom one. Can you please help me out how to acheive this.
    Thanks and Regards
    Sumesh

    Hi Sumesh,
    What you need to do is :
    1) add these two new fields in the same context node where the field from table /RPM/ITEM_D are added.
    2) in your UI , bind values to these new attributes.
    If current application is using and BAPI / Class method to update the table ,
    this new fields will also be passed to that bapi and will update table.
    Regards,
    Ashish Shah

  • Adding Flex-field to Custom View in the Worklist

    Hi,
    I am using OAS10133. I have mapped a SIMPLE_TYPE payload attribute to a flex field label in the worklist. I created a custom view. I want to display this playload attribute as a column in custom view and want to make it searcheable. But when I create the custom view, then at the time of selecting the columns, I do not find the name of this label listed in the dropdown.
    I have also made an entry in WorkFlowLabels.properties file.
    Can anyone please let me know if I need to follow any other step to display the flex field label as a column in custom view?
    Thanks in advance.
    -sam

    Hi Pete,
    There are two exits that were used.
    A user exit IMRC0001 (MeasPoint/MeasDoc: Exit before update (after COMMIT WORK) /  FM: EXIT_SAPLIMR0_001) for the transaction IK11 to enter the value for the custom field. When the measuring document is saved a pop up appears wherein the value for the custom field can be entered.
    A menu exit IMRC0003 (MeasDoc: Menu exit for customer-specific function / FM: EXIT_SAPLIMR0_003) for the transaction IK12 in order to change the custom field.

  • Adding a field for a view on SM30

    We would like to add a field to a standard table and use it as maintanable via SM30.
    This standard table gets gets is data entries usually when  4-5 views are maintained through IMG customization/SM30. We would like to add one more fields on any of those 4-5 views such that the data maintained using SM30 gets saved in this table.
    We have used the append structure to add the custom field in the standard table. Not quite sure how it be brought on the views on SM30 ?
    Any inputs ?

    hi,
       There is a concept called append structures, where in these serve as and enhancement to the current sructure
    Modification is not recommended as it creates lots of problem in case of upgrades
    you can use the Append structure tab in the application tool bar of SM30
    regards,
    shiva

  • Custom fields on Material Master - ECC6.0

    Hello
    We have added custom fields on material master basic data screen following these steps :
    1) Copied Func. grp MGD1 to Z Fgrp via Spro -> Logistics General ..
    2) Created a subscreen in Z fungrp by copying screen from original program.
    3) Deleted the unwanted fields and added new fields to the layout and Fields in PAI.
    4) Attached the subscreen in screen sequuence via SPRO
    We are now able to see the new fields on the baisc data screen and also able to input data in these fields , but on SAVE the data is not getting saved to database table MARA.
    We have also referred to OSS note 44410 but with no help.
    Are we missing something , is there anything additional that needs to be done in ECC6.0 ?
    Thanks

    Hi Kalidas,
    In your customized subscreen, did you update the PAI to include your custom field?
    process before output.
    *                      Verarbeitung vor der Ausgabe
      module init_sub.
      module get_daten_sub.
      module feldauswahl.
      module sonderfaus.
      module sonfausw_in_fgruppen.
      module feldhistorie.                         "Aenderungsdienst
      module bildstatus.
      module zusref_vorschlagen_b.
      module refdaten_vorschlagen.
      module zusref_vorschlagen_a.
      module set_daten_sub.
    process after input.
      module get_daten_sub.
    * Put your custom fields here to copy to structure for saving
      field: mara-zzcustom.
      module set_daten_sub.

  • Adding fields in costing view of material master

    Hi gurus,
    I need to add 4 fields in costing view of material master. I have followed the steps in SPRO, for configuring customized screen in material master.
    1) Created a function group YMMCO and copied the screen 2904 from program SAPLMGD1.
    2) Added 4 fields in my customized screen.
    3) Created copy of 01 ( Screen reference ) to z1 in OMT3B.
    Since 2904 is not there in the sequence . I changed one 0001 sequence at the end to 2904 . I also assigned my program
    SAPLYMMCO to it. I can see the changed fields in data screen and subscreen.
    4) Then I assigned the SSq to z1 in transaction OMT3E.
    But unfortunately, when I go to MM01 to create a material , I am not able to view the fields I added in costing view.
    I have checked the screen for the previous field, it shows 2904 only.
    Two days back, I did the same thing in basic data view 1 , it was working properly. As per client's suggestion I put it in
    costing view, it is not working . Please give me suitable suggestions.
    Thanks in advance.
    D. Mallick

    Hi,
    I also need to add custom fields to Basic data view. After copying & changing the screen sequence in Config, I could able to see the custom fields in Basic Data view.
    I have appended structure with custom fields to MARA table.
    But the values I enter in the screen is not getting updated to the table MARA.
    Can you please let me know the code, I should have have in PAI (Process After Input) module in the Sub Screen to update the values?
    Thanks,
    Dasa

  • MM - Material master data - move standard field to another view

    Hi everyone,
    ÉCC 6.0 - release 7.0.
    I've been adding many custom fields in Material master data MM01/02/03. Now I got a problem because we have to use a standard field in another view.
    The field MARA-HERKL is set up to 'SV'(attribute V_130F-PSTAT):
    Warehouse management = S
    Sales = V
    I want to add 'K - Basic data' in this field's attribute at OSMR Tcode , but this attribute is disactivated. I can not change this value.
    I've check this note 306966 that mention: You cannot create new entries and delete entries in client 000. This client contains only the entries delivered by SAP which are used for distinguishing customer-specific fields and SAP standard during the maintenance of the other clients.
    Is there any problem whether I delete this field and afterwards create it with the new values?
    I'm not in client 000. So, I want to just make sure I will do a legal change.
    thank you in advance,
    Alexandre

    None tips, Closed.

  • Materialized view fast refresh with date field

    I have a situation where I need to create a materialized view worth of 6 months of data with fast refresh option from the master table. Somehow whenever I have the where clause added with the date field then it craps out with "ORA-12015: cannot create a fast refresh materialized view from a complex query".
    Here is what I am trying to do. Please let me know if there is any other way to accomplish this.
    create table test (id number, date_time DATE);
    CREATE MATERIALIZED VIEW LOG ON test WITH ROWID;
    CREATE MATERIALIZED VIEW cms.scoreboard_statistics_mv
    BUILD IMMEDIATE
    REFRESH FAST
    WITH ROWID
    AS
    SELECT * from test
    WHERE date_time >= sysdate - 180;
    ORA-12015: cannot create a fast refresh materialized view from a complex query
    Thanks,
    Raj

    It's crazy but a new time Metalink help us into the Note:179466.1
    The restrictions that prevent snapshots from being fast refreshed depend on
    the version of Oracle being used, a full list of these by version is included
    in section 3. In all cases the snapshot defining query should:
    - refer to fully qualified table names rather than to partial table names.
    - refer to remote tables only, not to remote master views or synonyms.
    - not generate context sensitive data. For example, do not create a simple
    snapshot with a query that uses the SQL functions :SYSDATE, UID or USER.

  • Adding Z field in Opportunity search and result view BT111S_OPPT/Search

    Hi,
    I have been searching this forum on adding Z fields in search and result view but couldnt find the precise information.
    We have Z field in ultimately residing in BUT000.
    Now when this field is used in BP_HEAD_SEARCH for search and result, it could be easily done via configuration. (since the field was added to CRMT_BUPA_IL_HEADER_SEARCH during EEWB extension.
    Now, the requirement is to add the fields in Opportunity BT111S_OPPT/Search & BT111S_OPPT/Result.
    I am confused with regard to the approach we need to use to get this field in search and result.
    I thought the easiest option is to add the Model node and and give the BOL attribute. This works fine but I can't see this field (with dynamic getter/setter) in the UI configuration.
    During the attribute creation wizard, I gave BOL entity as BTQROpp (system defaulted) and the relation was
    BTADVSOpp/BTOrderHeader/BTHeaderPartnerSet/BTPartnerAll/BTBusinessPartner/ZZZGEOG_REGI
    is this correct? or am I doing something wrong?
    Why can't I see the fields in configuration?
    So alternatively I created a field through AET and i could see this field is in the structure and in UI config, but what logic I need to put to retrieve the value?
    Any advice?
    Many thanks in advance for your help
    Rakesh

    Hi Rakesh,
    Please follow below steps:
    1. Append your custom field to structure associated with your search/result structure.
    2. After you append this field to structure, this field would be available in context node.
    3.  Check if the field is reflected in available fields in configuration.
    4. If field is not present in configuration then please follow steps stated by me in:
    Re: New Column can not be added in chtmlb:configTable
    5. Once you add this field to design layer, you would be able to configure it to your search query. Check if your query works with this field.
    If not then please go through below forum :
    Re: BADI for Claims search in trade promotion management
    Let me know if this helps.
    Regards,
    Bhushan

  • Adding field in Maintenance view of table

    Hi,
    I am trying to create a custom maintanable table.  Now the requirement is I need to add one more extra  field in the maintenace view of the table which should not be in the table fields and is for display only in the maintencae view.
    I tried adding a cloumn by editing the screen program generated by the table maintenance generator. I get the the display in the maintenance view of that extra field. But I dont get the values populated.
    Can you please let me know in which PBO or PAI i should write the module programe ..
    Help will be rewarded with points.

    Hello Bluesh
    Normally the extra field should be from a table that has a foreign-key relationship to your main table. Thus, add this additional table to the list of tables for the view. If it does not have a suitable relationship you cannot add it to the list of tables.
    Afterwards add the required field to the list of view fields and set its property to 'R' = read-only.
    If correctly defined there is no need at all to modify the screen(s) or the coding of the PBO/PAI modules.
    Example: your z-table contains field KUNNR (value table KNA1) and you want to add the NAME1 field to your maintenance view
    add table KNA1 to the list of tables
    add field NAME1 to view fields
    set its property to 'R'
    regenerate function modules and screens
    Regards
      Uwe

  • Unable to refresh Materialized view group when an Mview is added

    Hi,
    I have 8 MVs present in my DB and added them to a MV refresh group. But I am getting the error below when I try to refresh the group.
    SQL> exec DBMS_REFRESH.refresh('MVRFRSHGRP_EAIGHD');
    begin DBMS_REFRESH.refresh('MVRFRSHGRP_EAIGHD'); end;
    ORA-12048: error encountered while refreshing materialized view "MYUAT"."MV_EAI_PJRM_EMP_ALLOC_DTLS"
    ORA-12018: following error encountered during code generation for "MYUAT"."MV_EAI_PJRM_EMP_ALLOC_DTLS"
    ORA-00942: table or view does not exist
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2563
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2776
    ORA-06512: at "SYS.DBMS_IREFRESH", line 685
    ORA-06512: at "SYS.DBMS_REFRESH", line 195
    ORA-06512: at line 1
    SQL> Actually the view MV_EAI_PJRM_EMP_ALLOC_DTLS exists and MVlog$ are present at source site.
    When I remove this view from the group, I am able to refresh it successfully.
    I destroyed the group, recreated and added all the views and tried. But no luck.
    Can some one suggest what could be the problem?
    Regards
    Deep

    Hi,
    You didn't leave a version (Again), so I can only guess.
    You may be suffering from
    Bug 10096159 ORA-12048 error message raised by DBMS_REFRESH.REFRESH is not corrrect
    Meaning it could be a different MV that fails to refresh.
    Regards
    Peter
    Edit:
    Versions confirmed as being affected      (There could be others, mind)
    11.2.0.1
    11.1.0.7
    10.2.0.5
    10.2.0.3
    Edited by: Peter on Sep 4, 2012 8:45 AM

  • Materialized view, problem in selecting a particular field

    Hi,
    can anyone please help me with this issue.
    I have table which contains data for 3 different years. It usually contains data for the current year, the next year and the previous year i.e the calender current year.
    YEAR TL JN Q
    2006     1 1 30
    2007 1 1 6
    2008 1 1 4
    2006 1 2 5
    2008 1 2 4
    This is how my table looks like. For this table i have created a view which looks like this
    TL JN Q1 Q2 Q3
    1 1 30 6 4
    1 2 5 50
    The view is a summary for the table.
    The problem now is that the Master table on which the view is based keeps getting updated. In some cases it may so happen that the table can contain data for a year other than the calender current year, previous year and next year.
    In this case how do i identify the year to create the view.
    For example the table can get populated with records for the year 1999, in this case how can i identify the year .
    This is the code i have written to create the view
    create view vw_summary(TL,JN,Q1,Q2,Q3)
    AS SELECT TL.,JN,
    MAX(DECODE(YEAR,TO_CHAR(SYSDATE,'YYYY'),Q,NULL)Q1,
    MAX(DECODE(YEAR,TO_CHAR(SYSDATE,'YYYY')-1,Q,NULL))Q2,
    MAX(DECODE(YEAR,TO_CHAR(SYSDATE,'YYYY')+1,Q,NULL))Q3
    FROM TABLE GROUP BY TL,JY
    CAN ANYONE PLEASE HELP ME.?
    I am creating a materialized view for the table

    one more opint to be added is that inside this procedure, i am checking for athe value of column "FLAG" in an other table param. if this flag is set to Y then i wil populate the table(on which the view is based) according to the parameter passed to the procedure. But if the flag value in the table params is set to N then i am suppose to check an other column called ACHYR in the table params. This column holds a year value say 1999.
    In this case the procedure should populate the table with the records for the year 1999.
    But how do I check this parameter in the view?

Maybe you are looking for