Dimension and fact table with a fact table between them

Hello all,
Here is my problem. As seen in the image, I have a fact table linked to the two dimensions.
I would have the number of Id from Cube_Requirements by variant including 'unknown" variant if no linked variant.
How is it possible ? How to create the dimension ? As my fact table has two fields, if i want to use reference as dimension usage, it doesn't work.
Thanks for your help.

Hi, this looks a many to many relationship scenario, follow these steps:
- drag extractid from cube_applicability onto measures area, so this table becomes a fact
- you will have count of Extractid measure after you perform above step
- Assuming Variant is already a dimension, go into dimension usage tab, link variant dimension with cube_requirement fact using many to many relationship and selecting cube_applicability
process cube, you should be able to get count of id by dragging and dropiping id from variant dimension..
Regards
Rakesh

Similar Messages

  • LrBinding.andAllKeys and LrBinding.orAllKeys - with optional property-table param (optObject): anybody ever got that to work?

    LrBinding.andAllKeys and LrBinding.orAllKeys - with optional property-table param (optObject): anybody ever got that to work?
    If so, please share your secret.
    I may have it figured out by the time you post, but so far it has never worked for me - bug? or am I not doing something right?

    I guess this is a bug
    Lightroom SDK 5: LrBinding.andAllKeys and orAllKeys in conjunction with optional bind-to object param - doesn't work, or…

  • Table with in a table Popin

    Hi,
    I need to put a table with in a Table pop in. I am able to achieve the table but the I am unable to display different data for each pop in. action.
    Example.
    Table has 3 records
    Row 1
    Row 2
    Row 3
    On expanding Row1 using pop in I am able to display the table.
    On expanding Row 2, leaving Row 1 expanded, changes the data in both the Areas, showing data  of Row 2.
    Could you please help in resolving the issue.

    Hi Prasanth,
    To display different data inside the table popin, create child node inside the parent node.
    Parent_node(0....n)
         Child_node( 0....n )
    Create a supply function for CHILD_NODE and on select of any row in parent table, write the logic to fill data of child node . Bind this child node to TABLE_POPIN's table
    Now, if you select row1, you can fill child node in supply function and it populates the data,
    similarly, it works for other rows as well
    Hope this helps you.
    Regards,
    Rama

  • The table with Name of 'Table Name' does not exist.An error occurred when loading the Model.

    The table with Name of 'Table Name' does not exist.An error occurred when loading the Model.
    We get this error when we try to check the properties of an analysis server using SQL Server Management studio(right click the instance name
    and check properties). We have resolved this issue twice by Stopping the SQL Server analysis service,removing db folders from Analysis Server Data folder and starting the services back on. The db folder that we removed was advised by the BI team.
    The SQL Server Analysis Server is 2012 SP1

    Hi RB_ORIPW,
    The table with name of 'XXX' doesn't exist.
    An error occurred when loading the model(Micorsoft.AnalysisServices)
    If I understanding correctly, you encounter the error randomly, now what you want it that avoid this issue completely, other than stop the services, detele the db filder and restart the services, right?
    The error might be caused by that the data file is corrupted. However, we cannot give you the exact reason that cause this issue. You can troubleshoot this issue by using the Windows Event logs and msmdsrv.log.
    You can access Windows Event logs via "Administrative Tools" --> "Event Viewer".  SSAS error messages will appear in the application log.
    The msmdsrv.log file for the SSAS instance that can be found in \log folder of the instance. (C:\Program Files\Microsoft SQL Server\MSAS10.MSSQLSERVER\OLAP\Log)
    Here is a blog about data collection for troubleshooting Analysis Services issues, please see:
    Data collection for troubleshooting Analysis Services issues
    Besides, here is fix that describe the similar issue, and it was fixed in Cumulative Update 7 for SQL Server 2012 SP1, please refer to the link below to see the details.
    http://support.microsoft.com/kb/2897263/en-us
    Regards,
    Charlie Liao
    If you have any feedback on our support, please click
    here.
    Charlie Liao
    TechNet Community Support

  • Combining two tables without any distinct columns between them

    Folks,

    Hi sidy2j,
    According to your description, we need to verify your table structures, and the actual results which you want to get from your tables. Please post more information for analysis.
    Assume, if you want to a one to one record mapping between  two tables without any common column between them for joining, you can refer to the following scripts to implement your requirement. For more information, see:
    http://sqlhints.com/2013/09/07/joining-two-tables-without-any-common-column-between-them-sql-server/
    If you want to match every row in the first table with every row in the second table, you can refer to the following detail.
    http://stackoverflow.com/questions/1198124/combine-two-tables-that-have-no-common-fields
    Hope it can help you.
    Regards,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • My text messages go to everyone except to my daughters. she has an iphone but with bell and mine is with rogers.  she receives them when she is at home or say at chapters/tim hortons where they have wifi, but if she is walking somewhere or at somewhere wi

    my text messages go to everyone except to my daughters. she has an iphone but with bell and mine is with rogers.  she receives them when she is at home or say at chapters/tim hortons where they have wifi, but if she is walking somewhere or at somewhere without wifi, it isn't working? i don't understand.  she has a text plan.  her phone is an iphone 4s  can anybody assist me if you know what the problem may be? thanks so much.

    Have her go to Settings>Cellular and make sure Cellular Data is turned to On.  If she's having trouble with regular sms messages, check her carrier to be sure her messaging plan is properly provisioned.

  • Join  a Parent Table with 2 Child table based on a value

    Dear Guru's
    We have a Parent Table and 2 Child table . The Parent Table has a column like seqtype with only 2 possible values C and S . If the Value is C , then the details are available in Child 1 table and if the Value is S then the Details are in Child 2 table
    How can we query the Data from this type of arrangement ? I am little bit confused and hit a road block
    Will the following query will work ?
    Select
    from Parent P , Child C1, Child C2
    where P.seqtype = C1.Seqtype
    and P.seqtype = C2.Seqtype
    With Warm Regards
    ssr

    You didn't mention the column names in two child tables. Whether the columns are same in 2 tables of these are different.
    If the columns are same better to go and change your design to have only one child table. However if stiil business stops you having one table you can use UNION ALL (Assuming you want to fetch same column information from two child tables) like below:
    SELECT p.col1
          ,c1.col2
          ,c1.col3
          ,c1.col4
      FROM parent     p
          ,child      c1
    WHERE p.seqtype = c1.seqtype
    UNION ALL
    SELECT p.col1
          ,c2.col2
          ,c2.col3
          ,c2.col4
      FROM parent     p
          ,child      c2
    WHERE p.seqtype = c2.seqtype Regards
    Arun

  • Master table with two child tables in ADF Framework

    Hi,
    I'm trying to implement single master with two detail tables using oracle adf framework of Jdev 11.1.1.4.0. I'm able to do single master-detail by using view link but unable to achieve nested details block i.e., master with nested child blocks.
    I created Query based view object of Master and two query based view objects as details. Then I created two view link for master with first child and another view link for master with second child. Even then in my data controls I see as two different components which is incorrect.
    Please let me know how to create a data control for an example shown below:
    Fruits [MASTER]
    --- Details of Fruits as adf table
    -- Apples [FIRST CHILD]
    ---- Details of Apples as adf table
    -- Oranges [SECOND CHILD]
    ---- Details of Oranges as adf table
    Regards,
    Amar.

    You need two viewLinks
    Fruits->Apples
    Fruits->Oranges
    Then in the data model you pick the Fruits entry that has:
    Fruits
    |--->Apples
    You stand on Fruits and you shuttle the Oranges to be under it from the left.
    If you'll use the default HR schema you'll see this type of relation for Employees:
    https://blogs.oracle.com/shay/entry/master_with_two_details_on_the

  • Dynamic table with field type table

    Hi,
    I´m using "cl_alv_table_create=>create_dynamic_table" to create a dynamic table for ALV Grid.
    But...I need to use colors in ALV, then I need to declare a field type LVC_S_SCOL in dynamic table from "cl_alv_table_create=>create_dynamic_table".
    How can I declare this in fieldcat?
    The code:
    Creating dynamic table
    DATA: table_agrup TYPE REF TO data,
            line_agrup  TYPE REF TO data.
    CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog           = t_fieldcat
        IMPORTING
          ep_table                  = table_agrup
        EXCEPTIONS
          generate_subpool_dir_full = 1
          OTHERS                    = 2.
        ASSIGN table_agrup->* TO .
    Printing ALV
      CALL METHOD obj_grid->set_table_for_first_display
        EXPORTING
          is_variant                    = w_variant
          i_save                        = 'A'
          is_layout                     = w_layout
        CHANGING
          it_outtab                     =
          it_fieldcatalog               = t_fieldcat
          it_sort                       = t_sort
        EXCEPTIONS
          invalid_parameter_combination = 1
          program_error                 = 2
          too_many_lines                = 3
          OTHERS                        = 4.
    Thanks.

    It is not possible with the  METHOD cl_alv_table_create=>create_dynamic_table to include another table inside that newly generated table.
    I have tried to do it with the code and I got the dynamic table created after at the end of the program.
    In the code,
    <DYN_TABLE> has same effect as your <table> variable
    <DYN_WA> has same effect as your <HEADER>
    REPORT  ZTEST_NP_DYNAMIC.
    DATA: DY_TABLE TYPE REF TO DATA,
          DY_LINE  TYPE REF TO DATA.
    FIELD-SYMBOLS: <DYN_TABLE> TYPE STANDARD TABLE,
                   <DYN_WA>,
                   <DYN_FIELD>.
    FIELD-SYMBOLS: <FS> TYPE ANY.
    * To generate the Dyanmic table with the COLOR
    DATA: LS_SOURCE TYPE STRING.
    DATA: LT_SOURCE LIKE STANDARD TABLE OF LS_SOURCE WITH HEADER LINE.
    DATA: L_NAME LIKE SY-REPID.
    DATA: L_MESSAGE(240) TYPE C,
          L_LINE TYPE I,
          L_WORD(72) TYPE C.
    DATA: L_FORM(30) TYPE C VALUE 'TABLE_CREATE'.
    LT_SOURCE = 'REPORT ZTEST_SUBROUTINE_POOL.'.
    APPEND LT_SOURCE.
    LT_SOURCE = 'FORM  TABLE_CREATE USING I_FS TYPE ANY.'.
    APPEND LT_SOURCE.
    LT_SOURCE = 'DATA: BEGIN OF LT_GENTAB OCCURS 0.'.
    APPEND LT_SOURCE.
    LT_SOURCE = 'DATA: BUKRS TYPE BUKRS. '.
    APPEND LT_SOURCE.
    LT_SOURCE = 'DATA: BKTXT TYPE BKTXT. '.
    APPEND LT_SOURCE.
    * you can add your fields here.....
    LT_SOURCE = 'DATA: COLOR TYPE lvc_t_scol. '.
    APPEND LT_SOURCE.
    LT_SOURCE = 'DATA: END OF LT_GENTAB.'.
    APPEND LT_SOURCE.
    LT_SOURCE = 'DATA: POINTER TYPE REF TO DATA.'.
    APPEND LT_SOURCE.
    LT_SOURCE = 'CREATE DATA POINTER LIKE STANDARD TABLE OF LT_GENTAB.'.
    APPEND LT_SOURCE.
    LT_SOURCE = 'I_FS = POINTER.'.
    APPEND LT_SOURCE.
    LT_SOURCE = 'ENDFORM. '.
    APPEND LT_SOURCE.
    L_NAME = 'ZTEST_SUBROUTINE_POOL'.
    CATCH SYSTEM-EXCEPTIONS GENERATE_SUBPOOL_DIR_FULL = 9.
      GENERATE SUBROUTINE POOL LT_SOURCE NAME L_NAME
               MESSAGE L_MESSAGE LINE L_LINE WORD L_WORD.  "#EC CI_GENERATE
    ENDCATCH.
    IF NOT L_MESSAGE IS INITIAL.
      MESSAGE E000(0K) WITH L_MESSAGE L_LINE L_WORD.
    ENDIF.
    ASSIGN DY_TABLE TO <FS>.
    PERFORM (L_FORM) IN PROGRAM (L_NAME) USING <FS>.
    ASSIGN DY_TABLE->* TO <DYN_TABLE>.
    * Create dynamic work area and assign to FS
    CREATE DATA DY_LINE LIKE LINE OF <DYN_TABLE>.
    ASSIGN DY_LINE->* TO <DYN_WA>.
    Write: 'bye'.
    Regards,
    Naimesh Patel

  • Import table with a different table name!

    Dear All,
    I have backup all users in my database using exp command.
    Now i want to import 2 tables from this backup, as tables already exists i want to import table with different table name.
    Is it possible with exp command? If not what else is the solution.
    Thanks, Imran

    Hi..
    Now i want to import 2 tables from this backup, as tables already exists i want to import table with different table name.Is it possible with exp command? If not what else is the solution.
    >
    Well, its not possible.You can import those two tables in some test database, rename them and then take the export and import in the database you want.
    Or,
    You can import those 2 tables in some other schema in your database, rename them again take the export and them import it.
    Anand

  • Join 2 tables with a reference table

    I have two large tables that I am trying to join together by two columns. Below are the tables with two samples in each table, the reference table and also the final result that i want. Can anyone help me and any pointers. Thank you so much. 
    Join on xAlias = mAlias 
    Join on xValue =mValue
    And if xValue =mValue is null then look at xRefValue = mRefValue
    Result

    Please provide example data in tables. For an example of this, see the top of the code.
    Try this:
    DECLARE @1stTable TABLE (xitem VARCHAR(15), xAlias VARCHAR(30), xvalue VARCHAR(30))
    INSERT INTO @1stTable (xitem, xAlias, xvalue)
    VALUES
    ('HGJ53456FCN','Finish/Coating', 'Black Oxide'),('HGJ53456FCN','Series/List', '8301'),('HGJ53456FCN','Material', 'High Speed Steel-E'),('HGJ53456FCN','Number of Flutes', '3'),('HGJ53456FCN','Overall Length (Inch)', '3-19/32'),
    ('HGJ53456FCN','Threads Per Inch', '12'),('HGJ53456FCN','Thread Limit', 'H3'),('HGJ53456FCN','Shank Diameter (Inch)', '0.429'),('HGJ53456FCN','Thread Size (Inch)', '9/16-12'),('HGJ53456FCN','Chamfer', 'Plug'),
    ('HGJ53456FCN','Thread Direction', 'Right Hand'),('HGJ53456FCN','Thread Length (Inch)', '63/64'),('HGJ53456FCN','Thread Standard', 'UNC'),('LOP65986','Finish/Coating', 'Black Oxide'),('LOP65986','Series/List', '5303S'),
    ('LOP65986','Material', 'High Vanadium High Speed Steel'),('LOP65986','Number of Flutes', '4'),('LOP65986','Overall Length (Inch)', '38078'),('LOP65986','Threads Per Inch', '10'),('LOP65986','Thread Limit', 'H3'),
    ('LOP65986','Shank Diameter (Inch)', '0.59'),('LOP65986','Thread Size (Inch)', '3/4-10'),('LOP65986','Chamfer', 'Bottoming'),('LOP65986','Thread Direction', 'RIGHT Hand'),('LOP65986','Thread Length (Inch)', '2'),
    ('LOP65986','Thread Standard', 'UNC')
    DECLARE @2ndTable TABLE (mItem int, mAlias varchar(30), mValue varchar(50))
    INSERT INTO @2ndTable (mItem, mAlias, mValue)
    VALUES
    (53456, 'Manufacturer''s Part Number', NULL),(53456, 'Chamfer', 'Plug'),(53456, 'Finish/Coating', 'Oxide'),(53456, 'Material', 'Vanadium High Speed Steel'),(53456, 'Material Application', 'Carbon Steel; Hardened Steel; Stainless Steel'),
    (53456, 'Number of Flutes', '3'),(53456, 'Overall Length (Inch)', '3-19/32'),(53456, 'Oversize (Yes/No)', 'No'),(53456, 'Series/List3', '00'),(53456, 'Shank Diameter (Decimal Inch)', '0.4290'),
    (53456, 'Square Size (Decimal Inch)', '0.3220'),(53456, 'Thread Direction', 'RIGHT Hand'),(53456, 'Thread Length (Inch)', '1-21/32'),(53456, 'Thread Limit', 'H3'),(53456, 'Thread Size (Inch)', '9/16-12'),
    (53456, 'Thread Standard', 'UNC'),(53456, 'Through Coolant (Yes/No)', 'No'),(65986, 'Manufacturer''s Part Number', NULL),(65986, 'Chamfer', '2-1/2'),(65986, 'Finish/Coating', 'Oxide'),
    (65986, 'Material', 'High Speed Steel'),(65986, 'Material Application', 'Cast Iron; Ductile Iron; Steel'),(65986, 'Number of Flutes', '4'),(65986, 'Overall Length (Decimal Inch)', '4.2500'),(65986, 'Overall Length (Inch)', '4-1/4'),
    (65986, 'Oversize (Yes/No)', 'No'),(65986, 'Shank Diameter (Decimal Inch)', '0.5900'),(65986, 'Thread Direction', 'RIGHT Hand'),(65986, 'Thread Length (Decimal Inch)', '2.0000'),(65986, 'Thread Length (Inch)', '2'),
    (65986, 'Thread Limit', 'H3'),(65986, 'Thread Size (Inch)', '3/4-10'),(65986, 'Thread Standard', 'UNC'),(65986, 'Through Coolant (Yes/No)', 'No')
    DECLARE @refTable TABLE (aliasName VARCHAR(30), xRefValue VARCHAR(40), mRefValue VARCHAR(50))
    INSERT INTO @refTable (aliasName, xRefValue, mRefValue)
    VALUES
    ('Finish/Coating','Black Oxide','Oxide'),('Finish/Coating','SH47 Oxide Nitride','Oxide'),('Finish/Coating','Steam Oxide','Oxide'),('Material','High Speed Steel-E','Vanadium High Speed Steel'),('Material','High Vanadium High Speed Steel','Vanadium High Speed Steel'),
    ('Material','High Vanadium High Speed Steel-E','Vanadium High Speed Steel'),('Material','High Vanadium High Speed Steel-E-PM','Vanadium High Speed Steel'),('Material','High Speed Steel','Vanadium High Speed Steel'),('Material','Carbide','Solid Carbide'),('Material','Powdered Metal Cobalt','Powdered Metal'),
    ('Material','High Vanadium High Speed Steel','High Speed Steel'),('Material','High Carbon Steel','High Speed Steel'),('Material','High Speed Steel-E','High Speed Steel'),('Material','High Vanadium High Speed Steel-E','High Speed Steel'),('Material','High Speed Steel','High Carbon Steel'),
    ('Material','High Speed Steel-E-PMT15 Cobalt','Cobalt Vanadium High Speed Steel'),('Material','High Speed Steel Cobalt','Cobalt'),('Material','High Speed Steel-E Cobalt','Cobalt'),('Material','High Speed Steel-E-PMT15 Cobalt','Cobalt'),('Material','High Carbon Steel','Carbon Steel'),
    ('Material','Bottoming','2-1/2'),('Material','Taper','2-1/2'),('Material','Bottoming','1 to 3-1/2'),('Material','Taper','1 to 3-1/2')
    SELECT xItem, mItem, xAlias, xValue, mValue
    FROM @1stTable st
    INNER JOIN @2ndTable nd
    ON st.xAlias = mAlias
    AND st.xValue = mValue
    LEFT OUTER JOIN @refTable rt
    ON st.xAlias = rt.aliasName
    AND st.xvalue = rt.mrefValue
    ORDER BY xItem, xAlias

  • Create a table with all the months between two dates

    Hi all,
    I have a purchase table recording individual purchases. One of the fields is my Date field (date of purchase).
    I would like to create a table 'All_months' with two entries ('month_no' and 'month') which will be based on the first and last date in the purchase table. Assuming the first purchase recorded in my purchase table was on the 12th of January 2008, the table should have the following structure:
    month_no month
    1 12JAN2008
    2 12FEB2008
    3 12MAR2008
    It should continue in this fashion up-to the month where the last purchase was recorded.
    I have been struggling with creating the query that would do that for days now and can't find anything when asking Mr Google.
    Thanks,
    Chris

    Welcome to the forum!
    Here's one way:
    CREATE TABLE     all_months
    AS
    SELECT     LEVEL                    AS month_no
    ,     ADD_MONTHS ( first_date
                 , LEVEL - 1
                 )               AS month     
    FROM     (
              SELECT     MIN (date_of_purchace)     AS first_date
              ,     MAX (date_of_putchase)     AS last_date
              FROM     purchase
    CONNECT BY     LEVEL <= 1 + MONTHS_BETWEEN ( TRUNC (last_date,  'MONTH')
                                 , TRUNC (first_date, 'MONTH')
    ;Do you really need a table like this? Every time you change the data in the purchase table, you won't know if all_months is still accurate or not. You can derive all_months in a sub-query every time you need it, or make all_months a view instead of a table.
    Edited by: Frank Kulash on Jun 14, 2012 5:57 AM

  • Filling temporary table with two other tables.

    Hi everyone,
    In an start routine, I would like to do the following :
    read values in an internal table, save it in temporary table tab1.
    read values in an internal table (the same with a different request) and save it in temporary table tab2.
    save with no duplicate keys and in a sorted table tab3 the result of the two tables.
    I have coded like this, but it doesn't work, since the final table is empty.
    Indeed, the system says it is tried to insert a duplicate key. How is it possible using instruction INSERT ?
        DATA : t_agence_1 TYPE SORTED TABLE OF ty_agence
                       WITH UNIQUE KEY /BIC/C_AGENCE2
                       WITH HEADER LINE.
        DATA : t_agence_2 TYPE SORTED TABLE OF ty_agence
                       WITH UNIQUE KEY /BIC/C_AGENCE2
                       WITH HEADER LINE.
        DATA : t_agence TYPE SORTED TABLE OF ty_agence
                       WITH UNIQUE KEY /BIC/C_AGENCE2
                       WITH HEADER LINE.
    SELECT * FROM /BIC/PC_AGENCE2
          INTO CORRESPONDING FIELDS OF TABLE t_agence_1
          FOR ALL ENTRIES IN DATA_PACKAGE
               WHERE CALMONTH = DATA_PACKAGE-CALMONTH
               AND /BIC/C_AGENCE2 = DATA_PACKAGE-/BIC/C_AG1
               AND objvers = 'A'.
         IF sy-subrc = 0.
           INSERT LINES OF t_agence_1 INTO TABLE t_agence.
         endif.
       SELECT * FROM /BIC/PC_AGENCE2
          INTO CORRESPONDING FIELDS OF TABLE t_agence_2
          FOR ALL ENTRIES IN DATA_PACKAGE
               WHERE CALMONTH = DATA_PACKAGE-CALMONTH
               AND /BIC/C_AGENCE2 = DATA_PACKAGE-/BIC/C_AG2
               AND objvers = 'A'.
       IF sy-subrc = 0.
              INSERT LINES OF t_agence_2 INTO TABLE t_agence.
       endif.
    Thanks if you can help !
    regards
    fred
    Edited by: Christophe BELIN on Dec 5, 2008 3:43 PM

    Shanon,
    You would handle the parent with two child tables exactly the same way you would a parent with one child.
    1) Bring in all 3 tables through the Database Expert.
    2) On the Links Tab, place the parent table on the left of the window and the two child tables to the right (yes there is a reason for doing this).
    3) Delete any CR generated links between the tables.
    4) "Draw" a link that starts from the parent table to the 1st child table and then again, from the parent to the 2nd child.
    a. I'm assuming that you know which fields to link on.
    b. No links between children.
    5) Once you have both links in place right click them and change the "Link Type" to "Left Outer Join"
    a. The reason for doing this: It allows ALL of the parent records to come through, even if they do not have any matching records in
    one or both of the child tables.
    Hope this helps,
    Jason

  • Querying Nested Tables with Multiple other Tables

    I am trying to query columns from a table and it's nested table and do a join to another table.
    SELECT IM.*,
    IMP.PROGRAM_ID,
    S.STAGE_NAME
    FROM TB_ITEM_MASTER IM , TABLE(TB_ITEM_MASTER.PROGRAMS) IMP, TB_STAGE S
    WHERE S.STAGE_ID = IM.STAGE_ID
    AND IM.PROGRAM_ID IN(1,2);
    When running this query I receive the error:
    ORA-00904:"TB_ITEM_MASTER"."PROGRAMS": Invalid Identifier
    I actually copied this query straight from an Oracle Documentation, just replaced my table names with theirs. This query will almost be like a template to me as the program_id field in the Nested table is very cruicial to me. I will joining many tables to TB_ITEM_MASTER and using the where clause against program_id. What's the problem here?
    Please advise.
    ps. Did I mention how much I hate working with this Nested table stuff:(

    You must use the alias name, not the table name.
    SQL> create type employee_obj as object (empno number) ;
      2  /
    Type created.
    SQL> create type employees_nt is table of employee_obj ;
      2  /
    Type created.
    SQL> create table departments (deptno number(2), dname varchar2(20), employees employees_nt)
      2  nested table employees store as employees_table
      3  /
    Table created.
    SQL> insert into departments values (1, 'DEPT #1', employees_nt(employee_obj(2), employee_obj(3))) ;
    1 row created.
    SQL> insert into departments values (22, 'DEPT #2', employees_nt(employee_obj(22), employee_obj(33))) ;
    1 row created.
    SQL>
    SQL> SELECT IM.*,
      2  IMP.empno
      3  FROM departments IM , TABLE(IM.employees) IMP
      4  WHERE IM.deptno IN(1,2);
        DEPTNO DNAME
    EMPLOYEES(EMPNO)
         EMPNO
             1 DEPT #1
    EMPLOYEES_NT(EMPLOYEE_OBJ(2), EMPLOYEE_OBJ(3))
             2
             1 DEPT #1
    EMPLOYEES_NT(EMPLOYEE_OBJ(2), EMPLOYEE_OBJ(3))
             3
    2 rows selected.
    SQL>

  • How to modify DataBase Table with an internal Table

    Hi, Friends.
    I am coping Data from a Database table to an internal table after modifying data in the internal table I want to modify the db table according to the modification in the internal table. can some one help me out in this way, i am doing this modification in Table Control in Screen programing.
    My Code is as follow.
    MODULE zfsl_stinf_tc_init OUTPUT.
      IF tc_copy IS INITIAL.
        SELECT * INTO CORRESPONDING FIELDS OF TABLE it_zfsl_stinf FROM zfsl_stinf.
        tc_copy = 'X'.
        REFRESH CONTROL 'TC_FOR_ZFSL_STINF' FROM SCREEN '0001'.
      ENDIF.
    ENDMODULE.                 " zfsl_stinf_init  OUTPUT
    *&      Module  zfsl_stinf_tc_move  OUTPUT
          text
    MODULE zfsl_stinf_tc_move OUTPUT.
      MOVE-CORRESPONDING wa_it_zfsl_stinf TO zfsl_stinf.
    ENDMODULE.                 " zfsl_stinf_tc_move  OUTPUT
    *&      Module  STATUS_0001  OUTPUT
          text
    MODULE status_0001 OUTPUT.
      SET PF-STATUS 'ZFSL_SCREEN_1ONLY'.
    SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_0001  OUTPUT
    *&      Module  zfsl_stinf_tc_modify  INPUT
          text
    MODULE zfsl_stinf_tc_modify INPUT.
      MOVE-CORRESPONDING zfsl_stinf TO wa_it_zfsl_stinf.
      MODIFY it_zfsl_stinf FROM wa_it_zfsl_stinf INDEX tc_for_zfsl_stinf-current_line.
    _*"" here i have the modified internal table  " it_zfsl_stinf "*_
    ENDMODULE.                 " zfsl_stinf_tc_modify  INPUT
    Kind regards,
    Faisal

    Hi
    Here you are modifying your dbtable in module pool programming
    so  better to use work area to modify the database table
    example:
    data: itab type table of zfsl_stinf .
    data: wa_itab type itab.
    select single * from zfsl_stinf INTO itab WHERE <condition>
    (pass your values to wa_itab.)
    modify zfsl_stinf from values of wa_itab.
    Regards
    Srinivasu

Maybe you are looking for