Problem in creating a view over multiple tables

How do I create a View on top of the bCrelow tables. I have metioned the key fields of each table. How do i join the tables with common fields? I also need to create a Generic Extractor over the View later.
Z3PVR ( Custom Z table ):
Key Fields--> MANDT: Client; BUKRS: Company Code; WERKS: Plant; EBELN: Purchasing Document Number; ELNR: Accounting Document Number.
BSEG ( Cluster Table ):
Key Fields--> MANDT: Client; BUKRS: Company Code; BELNR: Accounting Document Number; GJAHR: Fiscal Year; BUZEI: Number of Line Item Within Accounting Document
CKIS ( Transparent Table ):
MANDT: Client; LEDNR: Ledger for Controlling objects; BZOBJ: Reference Object; KALNR: Cost Estimate Number for Cost Est. w/o Qty Structure; KALKA: Costing Type; KADKY: Costing Date (Key); TVERS: Costing Version; BWVAR: Valuation Variant in Costing; KKZMA: Costs Entered Manually in Additive or Automatic Cost Est.; POSNR: Unit Costing Line Item Number
BKPF ( Transparent Table ):
MANDT:Client; BUKRS: Company Code; BELNR: Accounting Document Number;
GJAHR: Fiscal Year
RV61A ( Structure ):
No Key
T001 ( Transparent Table ):
MANDT:Client; BUKRS:Company Code

Hi Chintai,
To create a view you can use Tcode SE11.
In the first screen of view creation you must introduce the tables for the view and the conditions of join, remember to introduce always the field MANDT.
You are introducing too much tables in your view and if I am not wrong you can not introduce Structures in a view.
As a suggestion start introducing in View only the tables that contain all char you need and also the tables with a reduced number of keys (as T001).
You can then obtain other fields from other tables via CMOD.
To built up a Generic extractor on this view you can use Tcode RSO2.
You can find under www.service.sap.com/bi an How to doc on Generic DataSource creation.
Ciao.
Riccardo.

Similar Messages

  • [ADF Help] How to create a view for multiple tables

    Hi,
    I am using Jdeveloper 11G and ADF framework, and trying to create a view to update multiple tables.
    ex:
    Table A has these fields: ID, Name
    Table B has these fields: ID, Address
    A.ID and B.ID are primary keys.
    B.ID has FK relationship with A.ID
    (basically, these tables have one-to-one relation)
    I want to create a view object, which contains these fields: B.ID (or A.ID), A.Name, B.Address.
    So I can execute C,R,U,D for both tables.
    I create these tables in DB, and create entity objects for these tables.
    So there are 2 entity objects and 1 association.
    Then I create a view object based on B and add fields of A into the view:
    If the association is not a "Composition Association",
    when I run the model ("Oracle Business Component Browser") and try to insert new data, fields of A can't edit.
    If the association is a "Composition Association", and click the insert button, I will get
    "oracle.jbo.InvalidOwnerException: JBO-25030: Failed to find or invalidate owning entity"
    If I create a view object based on A and add filed of B into the view:
    When I run the model and try to insert new data, fields of B can't edit, no matter the association is or is not a composition association.
    So... how can I create a view for multiple tables correctly?
    Thanks for any advices!
    Here are some pictures about my problem, if there is any unclear point, please let me know.
    http://leonjava.blogspot.com/2009_10_01_archive.html
    (A is Prod, B is CpuSocket)
    Edited by: user8093176 on Oct 25, 2009 12:29 AM

    Hi Branislav,
    Thanks, but the result is same ....
    In the step 2 of creating view object, I can select entity objects to be added in to the view.
    If I select A first, and then select B (the "Source Usage" of B is A), then finishing the wizards.
    When I try to create a new record in the view, I can't edit any properties of B (those files are disabled).
    If I select B first, and then select A in crating view object, the result is similar ...
    Thanks for any further suggestion.
    Leon

  • Create a view from multiple tables

    Hi all,
    I am a newbie, so sorry if this is a "basic" question.
    I had 3 tables TAB1, TAB2 and TAB3
    TAB1 has
    STU_ID(pk), NAME, GRADE, ADDRESS
    TAB2 has
    COURSE_ID(pk), STU_ID(fk), COURSE_NAME, ROOM_NUM, TIME, DAY
    TAB3 has
    MENTOR_NAME, TITLE, AVAILABLE_DAYS
    Now I want to create a view(or query) that returns STU_ID, COURSE_NAME, NAME, GRADE, MENTOR_NAME and TITLE.
    When I tried writing a query like
    SELECT a.STU_ID, b.COURSE_NAME, a.NAME, a.GRADE, c.MENTOR_NAME, a.TITLE
    FROM TAB1 a, TAB2 b, TAB3 c
    WHERE a.STU_ID=b.STU_ID
    I am getting multiple results..like I'm getting Mentor name 4 times, name 4 times like that.
    So can anybody help me in writing the query for this....a "VIEW" would be appreciated.
    Thanks In Advance
    Srra

    You query should return all the columns in the select list once for each and every row that meets the specified join condition, how does this differ from what you are getting?
    So if tableA is the student table with only one row per student you would expect to see the student data duplicated once for every matching course row found in tableB, and so on when tableC is added in.
    If you need help please post partial results and then explain what results you want.
    HTH -- Mark D Powell --
    PS as sb mention you forgot your join condition to tableC which would multiply tableC by the other tables.
    Edited by: Mark D Powell on Feb 3, 2010 9:18 AM

  • Problem in creating Maintenance Order with multiple operations

    Hello all,
    I am facing problem while creating Maintenance Order with multiple operations and sub-operations. I am using BAPI : BAPI_ALM_ORDER_MAINTAIN.
    For single operation it is working fine,but i am unable to create MO with multiple operations and sub-operations.
    Please, provide me the inputs required,
    I have used methods :
    ORDER        CREATE,
    OPERATION CREATE
    and SAVE.
    Regards,
    Siddhartha

    Hi,
    The FM you are using is a perfect one. This FM is bit tricky to use. You need to perfectly pass the Reference number field. which links various input table parameters of this FM.
    Thanks & Regards,
    Navneeth K.

  • CREATING A FORM UTILIZING MULTIPLE TABLES

    I'd like to know if it's feasable to create a form using multiple tables and if so, how?
    Thanx

    sgtmaj,
    It's feasible. You'll have to create the form manually. This part of the documentation describes how that's done.
    http://download-west.oracle.com/docs/cd/B19306_01/appdev.102/b16373/bldapp.htm#sthref960
    Sergio

  • Problem with creating "updatable" view. Any ideas?

    Hello to nice people!
    I'm trying to create plain, simple updatable view such as:
    CREATE OR REPLACE VIEW v_admin_maint
    (from_addrs,mail_invoice_addrs,auth_off,location_cd) AS SELECT
    A.from_addrs, A.mail_invoice_addrs, A.auth_off,
    A.location_cd FROM admin_maint A, sysusers B WHERE A.location_cd
    = B.location_cd and B.user_id = USER;
    TABLE admin_maint
    from_addrs,
    mail_invoice_addrs,
    auth_off,
    location_cd (PRIMARY KEY)
    TABLE sysusers
    USER_ID (PRIMARY KEY)
    FIRST_NAME
    LAST_NAME
    LOCATION_CD
    View works great as view-only, but I got an error on update
    statement "ORA-01779: cannot modify a column which maps to a non
    key-preserved table".
    UPDATE v_admin_maint SET from_addrs = 'test' where location_cd
    = 'HOME';
    TABLE admin_maint does have PK and this column included into
    VIEW.
    Any ideas? Please advice.

    You need to create a unique index on the location_cd column of
    the sysusers table, then re-create your view:
    SQL> ALTER TABLE sysusers
      2  ADD CONSTRAINT sysusers_location_cd_uk
      3  UNIQUE (location_cd)
      4  /
    Table altered.
    SQL> CREATE OR REPLACE VIEW v_admin_maint
      2    (from_addrs,
      3     mail_invoice_addrs,
      4     auth_off,
      5     location_cd)
      6  AS
      7  SELECT A.from_addrs,
      8         A.mail_invoice_addrs,
      9         A.auth_off,
    10         A.location_cd
    11  FROM   admin_maint A,
    12         sysusers B
    13  WHERE  A.location_cd = B.location_cd
    14  and    B.user_id = USER
    15  /
    View created.
    SQL> SELECT      column_name,
      2              updatable
      3  FROM        user_updatable_columns
      4  WHERE       table_name = 'V_ADMIN_MAINT'
      5  /
    COLUMN_NAME                    UPD
    FROM_ADDRS                     YES
    MAIL_INVOICE_ADDRS             YES
    AUTH_OFF                       YES
    LOCATION_CD                    YES
    SQL> UPDATE v_admin_maint
      2  SET    from_addrs = 'test'
      3  where  location_cd = 'HOME'
      4  /
    1 row updated.

  • Materialized view to ensure data integrity over multiple tables

    Hello,
    I have a problem and I am not able to solve it. Partially, It is because of my poor SQL skills. I have three tables and I am using one sequence to enter data into them.
    What I am tying to do is to create a materialized view ( complete or fast, whichever) with refresh on commit option to check that each table contains unique data in comparison to other.
    I am posting code so you can get along:
    CREATE TABLE table_1 (
    ID NUMBER PRIMARY KEY
    CREATE TABLE table_2 (
    ID NUMBER PRIMARY KEY
    CREATE TABLE table_3 (
    ID NUMBER PRIMARY KEY
    INSERT INTO table_1 VALUES (1);
    INSERT INTO table_1 VALUES (2);
    INSERT INTO table_2 VALUES (3);
    INSERT INTO table_2 VALUES (4);
    INSERT INTO table_3 VALUES (5);
    INSERT INTO table_3 VALUES (6); I want to write create a materialized view that will give me output only in case that there are same values in two different tables. I got this far.
    CREATE MATERIALIZED view mv_test
    REFRESH COMPLETE ON COMMIT
    AS
    SELECT count(1) ROW_COUNT
    FROM dual
    WHERE EXISTS (
         SELECT a.id
         FROM table_1 a
         WHERE a.id IN(
             SELECT b.id
             FROM table_2 b))
    OR EXISTS (
        SELECT a.id
         FROM table_1 a
         WHERE a.id IN
                 (SELECT c.id
                 FROM table_3 c))
    OR EXISTS (
        SELECT b.id
             FROM table_2 b
        WHERE b.id IN
                 (SELECT c.id
                 FROM table_3 c));
        ALTER MATERIALIZED VIEW mv_test
        ADD CONSTRAINT cs_mv_test
        CHECK (row_count = 0) DEFERRABLE; This sql statement itself returns no rows if my logic is correct. And in case there were some duplicate rows in two different table, it would return 1 and constraint would throw an error.
    However, I cannot create this with ON COMMIT option. When I try to compile I get:
    ORA-12054: cannot set the ON COMMIT refresh attribute for the materialized view I went through documentation, tried creating mat_view logs etc.
    I know that one of the mistakes is that I am referencing dual table and I am not sure if I can use EXISTS.
    Unfortunately, my SQL wisdom ends here. I need help rewriting the sql, so it would work in materialized view with refresh on commit option. Please, help!!!
    I know that since I am using a sequence there is little chance that same value will get into two different tables, but I would like to perform somekind of check.
    Thank you in advance.

    >
    I know that since I am using a sequence there is little chance that same value will get into two different tables, but I would like to perform somekind of check.If you are certain that you control all the inputs to the table and you are definitely using one sequence to insert into all three tables then there is physically no possible way you will get duplicate values across tables.
    Writing something to check if this is the case would almost be like writing something to verify that 1+1 really does equal 2 in 100% of cases.
    if you must, however. consider something similar to the following which may be more performant:
    select *
      from table_1 t1
      full outer join table_2 t2 on (t1.id = t2.id)
      full outer join table_3 t3 on (t1.id = t2.id
                                     or
                                     t2.id = t3.id)
    where t1.id+t2.id+t3.id not in (t1.id,t2.id,t3.id);

  • Problems in creating Materialized View from 10g R2  to 11g

    Hi,
    We have two databases in 10g Release 2. These databases are on two different servers and we use
    Materialized views to replicate data between these servers. We are currently using 64 bit version of
    oracle 10g release 2 for LINUX.
    Oracle Database 10g Release 10.2.0.1.0 - 64 bit Production
    PL/SQL Release 10.2.0.1.0 - Production
    CORE 10.2.0.1.0 Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    We use CENTOS 5 - 64 bit edition
    We upgraded one of the databases to 11g (We exported the data from old database and
    imported it in new database) . Then we tried to create a Materialized view with incremental refresh
    on it where the base table is in the second Oracle 10g database.
    The problem is that it is not letting us create the view with FAST Refresh. It kept on giving ORA-12028
    error. We tried different remedies suggested on forums like creating a view with ROWID, but still it
    continued giving us the same error. We also synchronized the characterset of Oracle 10g and Oracle 11g
    installations but still it did not work.
    Our base table size is pretty large (over 10 Million records) and if we do a full refresh, it takes hours to
    refresh it.
    Without incremental refresh, we will not be able to fucntion, and to upgrade both database simultaneously
    we will need a large down-time which also we can not afford.
    Please advise what should we do.
    Best Regards
    Madhup
    Edited by: Madhup on Mar 2, 2009 10:45 AM

    Hello,
    Yesterday I met the same problem and very sad about this, however, my story is much more complicated (I think so).
    I have 6 databases:
    2 - 11g
    2 - 10g
    2 - 9i
    Every database of each release has different characterset(UTF8 and AL16UTF16).
    I am trying to create Materialized view with FAST REFRESH on Oracle 11g, when master tables are located on 10g database and 9i database.
    Materialized view, which points to 9i database, was successfully created.
    Materialized view, which points to 10g database, gets ORA-12028
    Like you, I tried many notes from METALINK and thought at the begining that the problem is my characterset. But, when the materialized views were successfully built on Oracle 9i database, I understood that the problem is something else.
    Did you find the actual reason why this issue does not work??
    Thanks,
    Alex

  • Ability to query on all columns from a view with multiple tables

    I have view with 4 tables. view has about 50 columns.
    hypothetically, I want to build a form to give the user an ability to query on any of those 50 columns. user can search on one or more fields.
    what is the best way to write the query to retrieve the results without performance impact.
    please let me know if the question is not clear.

    If you want to permit them to query any of 10 fields with no restrictions, you could create 10 separate single-column indexes. The optimizer would have to try to pick the best of these indexes if you specified multiple search criteria. But since you have a view which presumably means that you've got multiple other indexes involved for the underlying join conditions, you'd probably want/need to combine the column lists of the indexes you're adding for searches with the indexes you've created for joins, which requires looking at the text of the view and figuring out the best way to optimize the 10 single-column searches. Of course, it is possible that the optimizer could chose to do something like a b-tree to bitmap conversion on multiple indexes which could allow it to use multiple independent indexes for your queries, but that's generally not ideal performance-wise.
    All this is a fancy way of saying that there probably isn't a cut and dried answer to your question. You need to figure out the queries you're trying to optimize (say, the 10 single-condition queries) and you need to figure out what set of indexes on the various underlying tables provides the best performance weighing those benefits against the cost on other side of maintenance during DML. Which is going to depend on the text of the view, the underlying tables, the existing indexes, etc.
    Justin

  • Problem in creating a view and generating datasource

    Hi Gurus,
    I am trying to create a Generic Data Source (ZGG_TEST) on a View (ZV_TEST1)
    View as Follows:
    Table1 has the Following Fields
    Field      Type
    MANDT     CLNT
    RECNO     NUMC
    STATUS     CHAR
    LMODF     CHAR
    Table2 has Fields
    Fields     Type
    MANDT     CLNT
    RECNO     NUMC
    PHCOS     QUAN
    MATNR     CHAR
    EQSFS     QUAN
    MEINS     UNIT
    In Table2 under Currency and Quantity Field tab
    For Field PHCOS The Reference table is MSEG and Reference Field is MEINS
    For Field EQSFS the Reference Table is MSEG and reference field is MEINS
    View Description
    Tables:
    Table1
    Table2
    MSEG
    Join condition For the View is
    TABLE2-MANDT=TABLE1-MANDT
    TABLE2-RECNO=TABLE1-RECNO
    TABLE2-MANDT=MSEG-MANDT
    TABLE2-MATNR=MSEG-MATNR
    The Problem is While saving the Data Source it is Giving  an Error as Follows
    Invalid extract structure template ZV_TEST1 of DataSource zgg_test
    Message no. R8359
    Diagnosis
    You tried to generate an extract structure with the template structure zgg_test. This operation failed, because the template structure quantity fields or currency fields, for example, field PHCOS refer to a different table.
    Procedure
    Use the template structure to create a view or DDIC structure that does not contain the inadmissible fields.
    Please help me In Solving this Issue
    Thanks in advance
    Santosh

    Hi,
    I think the problem here might be due to the fact that you are using MSEG table in your views.
    I see that you have used MEINS in your Table2. So for Field PHCOS give your reference table as TABLE2 and field as MEINS as MEINS is already present in your table. Please leave out MSEG from your View.
    Hope this helps. Please revert in case of any issues
    Regards,
    Pramod

  • SQL Tree over multiple tables

    Hi gurus,
    I have a question about buildings sql trees over several tables.
    This is the Output I hope for:
    0
    - 10, 'Company Blue1', 0
    -- 101, 'Part Blue1', 10
    --- 1001, 'Accounting Blue', 101
    ---- 10001, 'Hans Mueller', 1001
    --- 1002, 'Special Problems Blue', 101
    ---- 10002, 'Stephen Meyer', 1002
    ---- 10003, 'Carlos Anceto', 1002
    -- 102, 'Part Blue2', 10
    --- 1003, 'Information Technology Blue', 102
    ---- 10004, 'Tobias Tries', 1003
    - 20, 'Company Red1', 0
    -- 201, 'Part Red1', 20
    --- 2001, 'Accounting Red', 201
    ---- 20001, 'Carl Van Deser', 2001
    ---- 20002, 'Geromel Boats', 2002
    - 30, 'Company Green1', 0
    -- 301, 'Part Green1', 30
    --- 3001, 'Accounting Green', 301
    ---- 30002, 'Peter Finnighan', 3001
    --- 3003, 'Special Problems Green', 301
    ---- 30001, 'Loui Van Ecke', 3003This is the situation: I have 4 table which can be constraint by foreign key and all toghether build up a tree.
    Table1:
    tbl_company (c_id, company_name)
    Values:
    10, 'Company Blue1'
    20, 'Company Red1'
    30, 'Company Green1'
    Table2:
    tbl_company_parts (cp_id, part_name, company_id)
    Values:
    101, 'Part Blue1', 10
    102, 'Part Blue2', 10
    201, 'Part Red1',20
    301, 'Part Green1',30
    Table3:
    tbl_departments (d_id, dept_name, part_id)
    Values:
    1, 'Accounting Blue', 101
    2, 'Special Problems Blue', 101
    3, 'Information Technology Blue', 102
    4, 'Accounting Red',201
    5, 'Accounting Green',301
    6, 'Special Problems Green',301
    Tablemployees (e_id, dept_name, department_id)
    Values:
    1, 'Hans Mueller', 1
    2, 'Stephen Meyer', 2
    3, 'Carlos AncetoÄ, 2
    4, 'Carl Van Deser',4
    5, 'Geromel Boats', 4
    6, 'Loui Van Ecke',5
    7, 'Peter Finnighan',6
    8, 'Tobias Tries',3The problem is that I don't know how to concate alle these values and using the connect by clause creating this tree view

    Hi Tobias,
    It was not exactly clear how the id's had to be calculated, but this example will get you going:
    SQL> create table tbl_company (c_id, company_name)
      2  as
      3  select 10, 'Company Blue1' from dual union all
      4  select 20, 'Company Red1' from dual union all
      5  select 30, 'Company Green1' from dual
      6  /
    Table created.
    SQL> create table tbl_company_parts (cp_id, part_name, company_id)
      2  as
      3  select 101, 'Part Blue1', 10 from dual union all
      4  select 102, 'Part Blue2', 10 from dual union all
      5  select 201, 'Part Red1',20 from dual union all
      6  select 301, 'Part Green1',30 from dual
      7  /
    Table created.
    SQL> create table tbl_departments (d_id, dept_name, part_id)
      2  as
      3  select 1, 'Accounting Blue', 101 from dual union all
      4  select 2, 'Special Problems Blue', 101 from dual union all
      5  select 3, 'Information Technology Blue', 102 from dual union all
      6  select 4, 'Accounting Red',201 from dual union all
      7  select 5, 'Accounting Green',301 from dual union all
      8  select 6, 'Special Problems Green',301 from dual
      9  /
    Table created.
    SQL> create table tbl_employees (e_id, emp_name, department_id)
      2  as
      3  select 1, 'Hans Mueller', 1 from dual union all
      4  select 2, 'Stephen Meyer', 2 from dual union all
      5  select 3, 'Carlos Anceto', 2 from dual union all
      6  select 4, 'Carl Van Deser',4 from dual union all
      7  select 5, 'Geromel Boats', 4 from dual union all
      8  select 6, 'Loui Van Ecke',5 from dual union all
      9  select 7, 'Peter Finnighan',6 from dual union all
    10  select 8, 'Tobias Tries',3 from dual
    11  /
    Table created.
    SQL> select coalesce
      2         ( case when e.department_id is null then null else
      3             trunc(d.part_id,-2) * 100 + dense_rank() over (partition by d.part_id order by e.e_id)
      4           end
      5         , trunc(d.part_id,-2) * 10 + dense_rank() over (partition by d.part_id order by d.d_id)
      6         , p.cp_id
      7         , c.c_id
      8         , 0
      9         ) id
    10       , coalesce
    11         ( e.emp_name
    12         , d.dept_name
    13         , p.part_name
    14         , c.company_name
    15         ) name
    16       , coalesce
    17         ( trunc(d.part_id,-2) * 10 + dense_rank() over (partition by d.part_id order by d.d_id)
    18         , d.part_id
    19         , p.company_id
    20         , case grouping(c.c_id) when 0 then 0 end
    21         ) parent_id
    22    from tbl_company c
    23       , tbl_company_parts p
    24       , tbl_departments d
    25       , tbl_employees e
    26   where c.c_id = p.company_id
    27     and p.cp_id = d.part_id
    28     and d.d_id = e.department_id
    29   group by rollup
    30         ( ( c.c_id,c.company_name)
    31         , ( p.cp_id,p.part_name,p.company_id)
    32         , ( d.d_id,d.dept_name,d.part_id)
    33         , ( e.e_id,e.emp_name,e.department_id)
    34         )
    35   order by c.c_id nulls first
    36       , p.cp_id nulls first
    37       , d.d_id nulls first
    38       , e.e_id nulls first
    39  /
            ID NAME                                                                               PARENT_ID
             0
            10 Company Blue1                                                                              0
           101 Part Blue1                                                                                10
          1001 Accounting Blue                                                                         1001
         10001 Hans Mueller                                                                            1001
          1002 Special Problems Blue                                                                   1002
         10002 Stephen Meyer                                                                           1002
         10003 Carlos Anceto                                                                           1002
           102 Part Blue2                                                                                10
          1001 Information Technology Blue                                                             1001
         10001 Tobias Tries                                                                            1001
            20 Company Red1                                                                               0
           201 Part Red1                                                                                 20
          2001 Accounting Red                                                                          2001
         20001 Carl Van Deser                                                                          2001
         20002 Geromel Boats                                                                           2001
            30 Company Green1                                                                             0
           301 Part Green1                                                                               30
          3001 Accounting Green                                                                        3001
         30001 Loui Van Ecke                                                                           3001
          3002 Special Problems Green                                                                  3002
         30002 Peter Finnighan                                                                         3002
    22 rows selected.Regards,
    Rob.

  • Create a View with many tables with the Table-Fieldnames

    Hello!
    Question 1)
    Which kind of view is the correct for joining
    many tables together.
    Question 2)
    What is the solution in case of having several tables
    with the same fieldnames by creating a view. How can I choose this fields
    into a view. I cant use the same name twice in section
    (tab strip) ViewFlds.
    Regards
    Ilhan

    Hi Ilhan,
    There is no problem in the view fieldname you can put something like this :
    This is you who choose the view field name so...
    View Fieldname         Table           Field
    VBAK_VBELN           vbak             vbeln
    vbap_vbeln                 vbap             vbeln
    Erwan

  • HOW CAN I CREATE A VIEW FROM SAME TABLE WHERE I NEED COLUMNS DETAILS FROM DIFFERENT ROWS IN THE SAME TABLE

    i have a table1 on the top, but i want to create a view from table 1 as  view mentioned beneath the table 2. Could any of you please help me.
    table1
    ID
    office
    employee
    activity
    1
    246
    -9999
    698
    2
    ##-99
    21480
    698
    3
    104
    -9999
    7025
    4
    ##-99
    88908
    7025
    5
    108
    -9999
    2415
    6
    ##-99
    17135
    2415
    7
    246
    -9999
    698
    8
    ##-99
    21480
    698
    9
    104
    -9999
    7025
    10
    ##-99
    88908
    7025
    11
    108
    -9999
    2415
    12
    ##-99
    17135
    2415
    view
    ID
    office
    ID1
    employee
    activity
    1
    246
    2
    21480
    698
    3
    104
    4
    88908
    7025
    5
    108
    6
    17135
    2415
    7
    246
    8
    21480
    698
    9
    104
    10
    88908
    7025
    11
    108
    12
    17135
    2415

    declare @forumsTable table (ID int, officeID int, employeeID INT, activityID int)
    insert into @forumsTable (ID, officeID, employeeID, activityID)
    values
    (1 ,246, -9999, 698 ),
    (2 ,-99, 21480, 698 ),
    (3 ,104, -9999, 7025),
    (4 ,-99, 88908, 7025),
    (5 ,108, -9999, 2415),
    (6 ,-99, 17135, 2415),
    (7 ,246, -9999, 698 ),
    (8 ,-99, 21480, 698 ),
    (9 ,104, -9999, 7025),
    (10 ,-99, 88908, 7025),
    (11 ,108, -9999, 2415),
    (12 ,-99, 17135, 2415)
    select f1.ID, f1.officeID, f2.ID as ID1, f1.employeeID, f1.activityID
    from @forumsTable f1
    inner join @forumsTable f2
    on f1.activityID = f2.activityID
    and f1.officeID > 0
    and f2.employeeID > 0
    and f1.id - f2.id = -1
    You really need to improve the relationship here.
    Perhaps you could make office and activity an exclusive pair.

  • Problem in  Creating a view using infotypes PA0001,PA0002,...

    Hi,
    Can anybody please help me how to create a Maintainence view using PA0001,PA0002,PA0003,PA0006,PA0032.
    I tried to create it using se54.
    when i use PA0003 as check table, i am not able to create relations with PA0001,PA0002,PA0032,PA0006.
    Thanks in Advance.
    Vinay.BR

    You can create a view using SE11 as mentioned in the previous answer. Once you created, you can use SE16 to display the content of the view table. However, this does not serve much because you can also see the original table using SE16. Unless you want to generate screen dialog so that the view table can be used in SM30. This method can be done while editing the table in SE11. Click on Utilities->Table maintenance generator. However, this will be considered as a repair (modification to SAP standard) and you need repair key.

  • TP CONFIGURATION PROBLEM ( While creating a View Controller in Component )

    Hi All,
         I have a problem in TP Config while creating a View Controller in a component i am getting this Exception 
        Parameter lsm(&1) not in version 0004(&2) of tp configuration .
        This Exception Raised from this Function Module : RS_ACCESS_PERMISSION
    Any on can please help me to come out of this issue.
    Regards And Thank you,
    Nirmala.K

    Sounds like you should be using one of the Apps forums, perhaps {forum:id=210}

Maybe you are looking for

  • Plain HTTP adapter error

    Hello all! I have a following scenario: IDoc ORDERS05 -> IDoc adapter -> XI -> Plain HTTP adapter -> receiver system. The error arise when HTTP adapter being called. <!-- Call Adapter --> <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:S

  • Not all RAW files recognised by Aperture 3

    I am running the lastest update of Aperture 3 with the most recent RAW compatibility pack. (Can't remember what number but I updated last night). I have a Leica D-Lux-5. I import RAW photos using the card slot on my iMac i5 running Snow Leopard. The

  • Problems with JDAPI Samples

    We are having problems getting the JDAPI samples provided with FormsBuilder9i working correctly. There are a couple of problems that occur. 1) When running GetFormName/GetModuleName the name of the form retrieved with the FormModule.getName() method

  • Only safari doesn't show the home page image - why?

    Hello Wonder why the home page image/masthead doesn't show on the home page, ONLY in Safari/mac - every other browser shows it. Would love a fix. Thoughts? thank you KB http://www.truthandlife.info

  • How to find app store

    my sister gave me her mac book pro, the latest update was 10.5.8. i am having problems with downloading the app store for my computer. I press software update but there's none. can someone please help me with my situation?