Problem creating a view

I need some help with a query that I need to use in order to create a view.
It's fairly complicated, at least for me.
Here is a short summary of the problem:
There is a table involved called salesperson.
This table has a four digit salespersonid, lastname, firstname, hiredate, and supervisor columns.
The supervisor column holds the four digit salespersonid of the supervisor of that particular sales person.
This column is null if that salesperson is the supervisor.
Now I need to generate a view that summarizes book sales by salesperson and shipping state.
7 columns are required.
Salespersonid
Sales person Name
State (based on shipstate)
Total number of orders
total amount of sales
Total profit
Last name of person's supervisor.
It is that last one that is giving me fits.
I don't know how to get the supervisor last name in the output.
Also, if the salesperson is the supervisor (i.e. supervisor column is null) I need to display (none) there. It can't be blank.
Here is what I have so far:
SELECT s.salespersonid AS ID, s.lastname || ', ' || s.firstname AS salesperson, shipstate,
       COUNT(DISTINCT order#) AS "TOTAL ORDERS", SUM(retail * quantity) AS "GROSS SALES",
       SUM((retail - cost) * quantity) AS "PROFIT"
FROM  salesperson s LEFT JOIN orders o ON s.salespersonid = o.salespersonid
LEFT JOIN orderitems oi ON o.order# = oi.order#
LEFT JOIN books b ON oi.isbn = b.isbn
GROUP BY s.salespersonid, s.lastname || ', ' || s.firstname, shipstateIt seems to me that I have to use a self join but my brain is cooked, and I can't seem to figure this out.
I have scripts here that would generate the tables and data I am using.
It's a small database. (If anyone is familiar with Oracle 10g SQL by Joan Casteel it is the JustLeeBooks database used throughout that book)
I don't really want to post these scripts here. It would make for quite a long post.
There are seven of them to get the data consistent with what I am using here.
If someone is willing to spend some time helping me, I could e-mail them the scripts.
They are the script that sets up the initial database and then 6 more scripts I have written to get to this point.
They kind of build on one another.
Send me a private message if you are willing to do that.
We could then bring the discussion back here if that is to your liking.
Any takers?
Maybe someone can help without those scripts?

Hi..
If i understood you need this query can help you..
SELECT s.salespersonid AS ID, s.lastname || ', ' || s.firstname AS salesperson, shipstate,
       COUNT(DISTINCT order#) AS "TOTAL ORDERS", SUM(retail * quantity) AS "GROSS SALES",
       SUM((retail - cost) * quantity) AS "PROFIT",
       nvl(sup.lastname || ', ' || sup.firstname,'none') AS supervisor
FROM  salesperson s LEFT JOIN orders o ON s.salespersonid = o.salespersonid
LEFT JOIN orderitems oi ON o.order# = oi.order#
LEFT JOIN books b ON oi.isbn = b.isbn
LEFT JOIN salesperson sup ON s.supervisorid = sup.salespersonid
GROUP BY s.salespersonid, s.lastname || ', ' || s.firstname, shipstate, nvl(sup.lastname || ', ' || sup.firstname,'none') Not Tested.
Tell me if there is that you need !!!

Similar Messages

  • Problems creating a view that's a union of two other views

    Hello all you Oracle folks,
    I'm pretty new to this Oracle thing, coming over from SQL Server where life was simple. Here's my issue;
    I am trying to create a view that is a union of two other views.
    I can run the top SELECT of this view (before the UNION) and it works no problem, and I can run the bottom SELECT (after the UNION) and it also works with no problem. I can run a DESC on both views involved, and those also work without any problem.
    When I try to run the SQL all together though, I get this;
    SQL> CREATE materialized view trkmaster.cmp_pmr_union refresh force ON demand AS SELECT 'CMR'
    2 "Ticket_System", "Id_col" "Ticket", "Submitter", "Submit_Date", "Submit_To",
    3 "Actual_Activity_Start_Date" "Start_Date", "Actual_Activity_Start_Time" "Start_Time",
    4 "Actual_Activity_End_Date" "End_Date", "Actual_Activity_End_Time" "End_Time",
    5 "Close_Date", "Risk_Level" "Level", "Activity_Type" "Type", "Activity_Category"
    6 "Category", "Hardware_Name" "Hardware", "Platform", "Application_Name" "Application",
    7 "Completion_Status" "Status", "Area_CMPO" "Owner", "Outage_Minutes" "Total_Outage_Mins",
    8 "Acorde_Downtime__in_minutes_" "Acorde", "Atlas", "Corporate_Email_Downtime"
    9 "Corporate_Email", "Data_Warehouse_Downtime__In_M6" "Data_Warehouse",
    10 "E__Commerce_Downtime__In_Mins_" "ECommerce", "FMDS__FIVR_" "FMDS_FIVR",
    11 "FMDS_Hotels_Downtime" "FMDS_Hotels", "FMDS_Internet_Downtime" "FMDS_Internet",
    12 "FMDS_Resv__Ctr_Downtime" "FMDS_Resv_Ctr", "GDS_Downtime__In_Mins_" "GDS",
    13 "HI_Online_Downtime__In_Mins_" "HI_Online", "Holidex__CRO____In_Mins_" "Holidex_CRO",
    14 "Holidex__Hotels____In_Mins_" "Holidex_Hotels", "Hyperion_Essbase",
    15 "IHGMail_Downtime__In_Mins_" "IHG_Mail", "Kofax_Downtime__in_minutes_" "Kofax",
    16 "PeopleSoft_Fin_Downtime_In_Mi1" "Peoplesoft", "PERFORM__HIRO____In_Mins_" "Perform_HIRO"
    17 FROM CMP.CHRQVCHANGE_MANAGEMENT_REQUEST UNION SELECT 'PMR' "Ticket_System", "Id_col"
    18 "Ticket", "Submitter", "Submit_Date", "Submit_To", "Problem_Start_Date" "Start_Date",
    19 "Problem_Start_Time" "Start_Time", "Problem_End_Date" "End_Date", "Problem_End_Time"
    20 "End_Time", "Close_Date", "Severity_Level" "Level", "Problem_Type" "Type",
    21 "Occurrence_Type" "Category", "Hardware_Name" "Hardware", "Platform", "Application_Name"
    22 "Application", "Close_Code" "Status", "Problem_Owner" "Owner",
    23 "TOTAL_Outage_Time__If_Any_" "Total_Outage_Time", "Acorde_Downtime__in_minutes_" "Acorde",
    24 "Atlas", "Corporate_Email_Downtime" "Corporate_Email", "Data_Warehouse_Downtime__In_M6"
    25 "Data_Warehouse", "E__Commerce_Outage_Time__Mins_" "ECommerce", "FMDS__FIVR_" "FMDS_FIVR",
    26 "FMDS_Hotels_Outage_Time__In_M5" "FMDS_Hotels", "FMDS_Internet_Outage_Time__Mi4"
    27 "FMDS_Internet", "FMDS_Resv__Ctr_Outage_Time__M3" "FMDS_Resv_Ctr",
    28 "GDS_Outage_Time__Mins_" "GDS", "HI_Online_Outage_Time__In_Min2" "HI_Online",
    29 "Holidex__CRO____In_Mins_" "Holidex_CRO", "Holidex__Hotels____In_Mins_" "Holidex_Hotels",
    30 "Hyperion_Essbase", "IHG_Mail_Outage_Time__In_Mins_" "IHG_Mail",
    31 "Kofax_Downtime__in_minutes_" "Kofax", "PeopleSoft_Fin_Downtime_In_Mi1" "Peoplesoft",
    32 "PERFORM__HIRO____In_Mins_" "Perform_HIRO" FROM PMR.CHRQVPROBLEM_MANAGEMENT;
    "PERFORM__HIRO____In_Mins_" "Perform_HIRO" FROM PMR.CHRQVPROBLEM_MANAGEMENT
    ERROR at line 32:
    ORA-00942: table or view does not exist
    The 'CMR' and 'PMR' as Ticket_System is me trying to assign a literal as a newly created column.
    All the data types match from one view to the other.
    If I switch around the SQL so the 'CMR' view is at the bottom and the 'PMR' view is at the top, it still errors out on the 'PMR' view as not existing, even though I can DESC it and run the SELECT using that view. A coworker thinks it could be some kind of view alias issue (?).
    I know the view exists, and I can access it no problem. Any ideas why this isn't working? It seems so simple, I could do this in a heartbeat in SQL Server. I have very few hairs left to rip out, so any help would be appreciated.

    SELECT 'CMR' "Ticket_System",
    "Id_col" "Ticket",
    ....you have wrapped up your columns with a double quotes and use an alias. i tried the same thing
    but using a different table and it does not work.
    SQL> desc emp;
    Name                                      Null?    Type
    EMPNO                                     NOT NULL NUMBER(4)
    ENAME                                              VARCHAR2(10)
    JOB                                                VARCHAR2(9)
    MGR                                                NUMBER(4)
    HIREDATE                                           DATE
    SAL                                                NUMBER(7,2)
    COMM                                               NUMBER(7,2)
    DEPTNO                                    NOT NULL NUMBER(2)
    SQL> select "empno" "employee_number"
      2    from emp;
    select "empno" "employee_number"
    ERROR at line 1:
    ORA-00904: "empno": invalid identifier
    SQL> how were you able to run the top level of your SQL before the UNION clause? did you run it thru some tools
    other than SQL*Plus?

  • Problem creating a view in Administrator: 942: table or view does not exist

    Hi and thank you for reading,
    I am working with the Administration tool and would like to create a view in the physical layer. However I am getting the following error messages when I try to view the Date in the view:
    [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occured.
    [nQSError: 43093] An error occured while processing the EXECUTE PHYSICAL satement.
    *[nQSError: 17001] Oracle Error code: 942, message: ORA-00942: table or view does not exist at OCI call OCIStmtExecute.*
    [nQSError: 17010] SQL statement preparation failed.
    [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occured.
    [nQSError: 43093] An error occured while processing the EXECUTE PHYSICAL satement.
    *[nQSError: 17001] Oracle Error code: 936, message: ORA-00936: missing expression at OCI call OCIStmtExecute.*
    [nQSError: 17010] SQL statement preparation failed.
    I proceed as following:
    Right click on a physical schema (this schema is already created and works in Answers) -> new Physical Schema ->Table Type: Select -> Select * from Table_A where name='name' (Table_A is in the physical schema) -> OK -> Save -> Deploy -> Update Row count (works) -> View Data -> Error
    Any Idea what I am doing wrong. I have started with an easy select statement to test how to create a view in Oracle Administrator.
    Thanks a lot for any help
    Evgeny

    Do you see Table_A, and in which database schema?
    Try to put alias (database user) before table name.
    Select * from user.Table_A where name='name'
    Where user is database user.
    If you have Table_A in another user and connection pool is set to different user, then grant select from Table_A owner to connection pool user (make synonym for Table_A):
    Example (I'm using connection pool from userB and have tables from userA and userB).
    create or replace public synonym xx for userA.xx
    and
    grant select on xx to userB
    Hope this helps.
    Regards,
    Goran
    http://108obiee.blogspot.com

  • Problem creating materialized view

    OK, I'm totally new in using materialized views.
    I'm trying to create one and to make it refreshed on commit
    CREATE MATERIALIZED VIEW VK_CLIENT  build immediate refresh fast on commit AS
      select c1.code,
    c1.fiche fiche_1,
    decode( c1.sfam, '04', 
    decode( c7.sfam, '04', 'M. et Mme', c1.lnte ), c1.lnte ) lnte_1,
    decode( c1.sfam, '04', 
    decode( c7.sfam, '04', 
    decode( c1.lnte, 'M.', c1.libe, c7.libe ), c1.libe ), c1.libe ) libe_1,
    decode( c1.sfam, '04', 
    decode( c7.sfam, '04', 
    decode( c1.lnte, 'M.', substr( c1.libe, 1, c1.lgnom ), substr( c7.libe, 1, c7.lgnom ) ), substr( c1.libe, 1, c1.lgnom ) ), substr( c1.libe, 1, c1.lgnom ) ) nom_1,
    decode( c1.sfam, '04', 
    decode( c7.sfam, '04', 
    decode( c1.lnte, 'M.', initcap( substr( c1.libe, c1.lgnom + 2 ) ), initcap( substr( c7.libe, c7.lgnom + 2 ) ) ), initcap( substr( c1.libe, c1.lgnom + 2 ) ) ), initcap( substr( c1.libe, c1.lgnom + 2 ) ) ) prenom_1,
    decode( c1.sfam, '04', decode( c7.sfam, '04', decode( c1.lnte, 'Mlle', 'Mme', c1.lnte ), c1.lnte ), c1.lnte ) lnte_1_bis,
    c1.libe libe_1_bis,
    substr( c1.libe, 1, c1.lgnom ) nom_1_bis,
    initcap( substr( c1.libe, c1.lgnom + 2 ) ) prenom_1_bis,
    c1.sfam sfam_1,
    c1.dnai dnai_1,
    decode( to_char( c1.dnai, 'dd' ), '01', '1er', 
    decode( substr( to_char( c1.dnai, 'dd' ), 1, 1 ), 0, substr( to_char( c1.dnai, 'dd' ), 2 ), to_char( c1.dnai, 'dd' ) ) ) || ' ' || 
    rtrim( to_char( c1.dnai, 'month', 'nls_date_language = french' ) ) || to_char( c1.dnai, ' yyyy' ) dnai_fr_1,
    c1.horsfoyer horsfoyer_1,
    decode( c1.lnte, 'Mlle', 'f', 'Mme', 'f', 'M.', 'm' ) accord_1,
    c7.fiche fiche_7,
    decode( c1.sfam, '04', 
    decode( c7.sfam, '04', null, c7.lnte ), c7.lnte ) lnte_7,
    decode( c1.sfam, '04', 
    decode( c7.sfam, '04', null, c7.libe ), c7.libe ) libe_7,
    decode( c1.sfam, '04', 
    decode( c7.sfam, '04', null, substr( c7.libe, 1, c7.lgnom ) ), substr( c7.libe, 1, c7.lgnom ) ) nom_7,
    decode( c1.sfam, '04', 
    decode( c7.sfam, '04', null, initcap( substr( c7.libe, c7.lgnom + 2 ) ) ), initcap( substr( c7.libe, c7.lgnom + 2 ) ) ) prenom_7,
    decode( c7.sfam, '04', decode( c1.sfam, '04', decode( c7.lnte, 'Mlle', 'Mme', c7.lnte ), c7.lnte ), c7.lnte ) lnte_7_bis,
    c7.libe libe_7_bis,
    substr( c7.libe, 1, c7.lgnom ) nom_7_bis,
    initcap( substr( c7.libe, c7.lgnom + 2 ) ) prenom_7_bis,
    c7.sfam sfam_7,
    c7.dnai dnai_7,
    decode( to_char( c7.dnai, 'dd' ), '01', '1er', 
    decode( substr( to_char( c7.dnai, 'dd' ), 1, 1 ), 0, substr( to_char( c7.dnai, 'dd' ), 2 ), to_char( c7.dnai, 'dd' ) ) ) || ' ' || 
    rtrim( to_char( c7.dnai, 'month', 'nls_date_language = french' ) ) || to_char( c7.dnai, ' yyyy' ) dnai_fr_7,
    decode( c7.lnte, 'Mlle', 'f', 'Mme', 'f', 'M.', 'm' ) accord_7,
    initcap( decode( instr( lower( c1.adr1 ), 'log' ), '1', c1.adr2, decode( instr( lower( c1.adr1 ), 'bât' ), '1', c1.adr2, c1.adr1 ) ) ) adr1,
    initcap( decode( decode( instr( lower( c1.adr1 ), 'log' ), '1', c1.adr2, decode( instr( lower( c1.adr1 ), 'bât' ), '1', c1.adr2, c1.adr1 ) ), c1.adr2, null, 
    decode( instr( lower( c1.adr2 ), 'log' ), '1', c1.adr3, decode( instr( lower( c1.adr2 ), 'bât' ), '1', c1.adr3, c1.adr2 ) ) ) ) adr2,
    initcap( decode( instr( lower( c1.adr3 ), 'log' ), '1', null, decode( instr( lower( c1.adr3 ), 'bât' ), '1', null, c1.adr3 ) ) ) adr3,
    c1.ptt,
    c1.lcom,
    decode( c7.fiche, null, decode( c1.lnte, 'Mme', 'Madame', 'Mlle', 'Mademoiselle', 'M.', 'Monsieur', 'Monsieur' ),
    decode( nvl( c1.sfam, '07' ), '04', 
    decode( nvl( c7.sfam, '07' ), '04', 'Madame, Monsieur', 
    decode( c1.lnte, 
    'Mme', decode( c7.lnte, 'Mme', 'Mesdames', 'Mlle', 'Madame, Mademoiselle', 'M.', 'Madame, Monsieur', 'Madame, Monsieur' ), 
    'Mlle', decode( c7.lnte, 'Mme', 'Madame, Mademoiselle', 'Mlle', 'Mesdemoiselles', 'M.', 'Mademoiselle, Monsieur', 'Mademoiselle, Monsieur' ),
    'M.', decode( c7.lnte, 'Mme', 'Madame, Monsieur', 'Mlle', 'Mademoiselle, Monsieur', 'M.', 'Mesieurs', 'Mesieurs' ),
    '. ', decode( c7.lnte, 'Mme', 'Madame, Monsieur', 'Mlle', 'Mademoiselle, Monsieur', 'M.', 'Mesieurs', 'Mesieurs' ),
    decode( c1.lnte,
    'Mme', decode( c7.lnte, 'Mme', 'Mesdames', 'Mlle', 'Madame, Mademoiselle', 'M.', 'Madame, Monsieur', 'Madame, Monsieur' ),
    'Mlle', decode( c7.lnte, 'Mme', 'Madame, Mademoiselle', 'Mlle', 'Mesdemoiselles', 'M.', 'Mademoiselle, Monsieur', 'Mademoiselle, Monsieur' ),
    'M.', decode( c7.lnte, 'Mme', 'Madame, Monsieur', 'Mlle', 'Mademoiselle, Monsieur', 'M.', 'Mesieurs', 'Mesieurs' ),
    '. ', decode( c7.lnte, 'Mme', 'Madame, Monsieur', 'Mlle', 'Mademoiselle, Monsieur', 'M.', 'Mesieurs', 'Mesieurs' ),
    '-' ) ) ) lnte_long,
    decode( c1.cfam, null, c7.cfam, c1.cfam ) cfam,
    decode( c1.cfam, null, c7.allo, c1.allo ) allo,
    decode( c1.sexe, 'm', decode( c7.sexe, null, 'ms', 'm', 'mp', 'f', 'mp' ), 'f', decode( c7.sexe, null, 'fs', 'm', 'mp', 'f', 'fp' ), '-' ) accord,
    c9.fiche fiche_9,
    c9.lnte lnte_9,
    c9.libe libe_9,
    substr( c9.libe, 1, c9.lgnom ) nom_9,
    initcap( substr( c9.libe, c9.lgnom + 2 ) ) prenom_9,
    initcap( decode( instr( lower( c9.adr1 ), 'log' ), '1', c9.adr2, decode( instr( lower( c9.adr1 ), 'bât' ), '1', c9.adr2, c9.adr1 ) ) ) adr1_9,
    initcap( decode( decode( instr( lower( c9.adr1 ), 'log' ), '1', c9.adr2, decode( instr( lower( c9.adr1 ), 'bât' ), '1', c9.adr2, c9.adr1 ) ), c9.adr2, null, 
    decode( instr( lower( c9.adr2 ), 'log' ), '1', c9.adr3, decode( instr( lower( c9.adr2 ), 'bât' ), '1', c9.adr3, c9.adr2 ) ) ) ) adr2_9,
    initcap( decode( instr( lower( c9.adr3 ), 'log' ), '1', null, decode( instr( lower( c9.adr3 ), 'bât' ), '1', null, c9.adr3 ) ) ) adr3_9,
    c9.ptt ptt_9,
    c9.lcom lcom_9,
    decode( c9.lnte, 'Mlle' , 'Mademoiselle', 'Mme', 'Madame', 'M.', 'Monsieur', 'M. et Mme', 'Madame, Monsieur', null ) lnte_long_9,
    decode( c9.sexe, 'm', 'ms', 'f', 'fs', null, null, '-' ) accord_9,
    no.nbocc
    from client c1,
    client c7, 
    client c9,
    select z.code code,
    count(*) nbocc
    from client z
    where to_char( sysdate, 'yyyymmdd' ) between to_char( z.cdeb, 'yyyymmdd' ) and to_char( nvl( z.cfin, sysdate ), 'yyyymmdd' )
    group by z.code
    ) no
    where c1.code = c7.code (+)
    and c1.role = '1'
    and c7.role (+) ='7'
    and nvl( c7.horsfoyer (+), 0 ) = '0'
    and to_char( nvl( c7.cfin (+), sysdate ), 'yyyymmdd' ) >= to_char( sysdate, 'yyyymmdd' )
    and c1.code = c9.code (+)
    and c9.role (+) = '9'
    and to_char( nvl( c9.cfin (+), sysdate ), 'yyyymmdd' ) >= to_char( sysdate, 'yyyymmdd' )
    and c9.lnte (+) not in ( '. ', 'Assoc.', 'Ste' )
    and c9.lcom (+) is not null
    and c1.code = no.code (+);when doing so, I'm getting a ORA-12054:
    ORA-12054: cannot set the ON COMMIT refresh attribute for the materialized view
    12054. 00000 - "cannot set the ON COMMIT refresh attribute for the materialized view"
    *Cause:    The materialized view did not satisfy conditions for refresh at
    commit time.
    *Action:   Specify only valid options.
    When I create the materialized view with just CREATE MATERIALIZED VIEW "H6801_GL_00"."VK_CLIENT" AS
    it works but the refresh is only "ON DEMAND"...
    Can't find how and why it won't work...
    Edited by: MacFizz on Dec 17, 2009 3:22 PM

    You could try the DBMS_MVIEW.TUNE_MVIEW and check if you can modify you materialized view or "refactor" it in a smaller, fast refreshable part that you could combine later to the sysdate/rownum part of it.
    http://download.oracle.com/docs/cd/E11882_01/server.112/e10821/advisor.htm
    Explanation on restrictions of fast refresh:
    http://download.oracle.com/docs/cd/E11882_01/server.112/e10706/repmview.htm
    Below there's an example of a fast refreshable mview, on creating the materialized view log and so on:
    http://download.oracle.com/docs/cd/E11882_01/server.112/e10592/statements_6002.htm#i2080820

  • Problem creating Database view

    Hi ABAP experts,
    I have created an ABAP database view with tables /SAPAPO/MATLOC, /SAPAPO/MATKEY and /SAPAPO/LOC.
    I am taking snp planner (PLANNER_SNP) and ppds planner (PLANNER_PPS) from table /SAPAPO/MATLOC. I want their descriptions also in the same view which is there in an another database table /SAPAPO/PLANNER. but when i use this table in the join number of entries in the view appears to be zero. I dont know why..
    Can anybody suggest me how can I put descriptions of SNP planner and PPDS planner also in the same view.
    Also view is getting created with all the fields as key fields by default but I want only three feilds to be the key feilds.
    Can anybody help in this matter.
    Thanks a lot
    Best Regards,
    Chandan Dubey

    I can't see the structure of these tables but apparently your join condition is not well done. Ensure foreing keys for /SAPAPO/MATLOC exist in /SAPAPO/PLANNER (or vice versa dependig on which table has primary key) . Try doing a view first only with these two tables, then if this works expand it to the two other tables. This will give you an overview were is the logic (relationship) problem.
    As for your second question system will suggest key relationship, of which you can delete some relations. In this case you don't need to use all of them but only part of the key fields to be compared. Just select relationship you don't want and delete it. when using this view only these fields will be used to formluate join condition.
    I hope this helps you
    Marcin

  • Problems creating Materialized View

    Hello,
    i have Problems with the creation of a materialized view with the following sql-statement:
         SELECT Tag_ID, ROWNUM AS RowNr
         FROM L_tag
         ORDER BY tag_id ASC
    in the table L_tag is only one column (tag_id) that contains all dates (1895.01.01 - 2020.01.01) as numbers (format like: 20020508)
    if i create the materialized view, no errors occures. if i check later the sql-statement of this materialized view, there is no ORDER BY!!:
         SELECT Tag_ID, ROWNUM AS RowNr
         FROM L_tag
    has anyone an idea, why oracle don't accept the order by clause?
    thanks,
    Dome

    has anyone an idea, why oracle don't accept the order by clause?Yes, because Oracle stores data in an unorderred fashion (except for IOT, but that's different matter). So your ORDER BY clause makes no sense for stored data.
    You must use ORDER BY when doing the final select from the MV (...).
    Regards,
    Yoann.

  • Problem creating basic views while creating materials using idocs?

    hello,
    I am facing an issue while creating materials using idocs. The problem is that the basic view does not get created whereas other views are present. The function module used is idoc_input_matma01 and the basic idoc type is MATMAS03.
    Looking for help. Thank you

    Hi Madhu,
    Actually i recieve an idoc from PI containing data required for cretion of the material via an idoc. This idoc is then processed to create the required material.
    The material gets created with appropiate data in various tables(mara, makt) but when we view material in mm03 we cant see the basic data views.

  • Problems creating extension (View Object) in JDeveloper 9.0.3.5

    Note: I originally posted this on the JDeveloper forum - but I was told to post it in this forum.
    This is on Windows XP Pro SP2 with JDeveloper 9.0.3.5 - patch 6469392 (appropriate for 11.5.10.6).
    I'm trying to create an extension for a view object for the Oracle Applications Framework. I've exported the appropriate MDS repo contents to my system using export. One of the first issues I've seen is the step where I import the the business components XML file (server.xml) and I get the following warning:
    Warning: This Business Components Package was built with an earlier version of Oracle Business Components for Java. Unable to upgrade since it is readonly. oracle.apps.pos.isp.server
    I've encountered these strange "readonly" errors all along the way. When I try to create the VO itself, I notice the wizard is in readonly mode, preventing me from associating query columns with view attributes (I cannot change a view attribute for a query column for many of the query columns). Why are things in readonly mode?

    I've seen is the step where I import the the business components XML file (server.xml) and I get the following warning:
    Warning: This Business Components Package was built with an earlier version of Oracle Business Components for Java. Unable to upgrade since it is readonly. oracle.apps.pos.isp.server
    Ans : VO , EM and AM related xml files not need to import to MDS, only PG and Region related xml file need to import to MDS.

  • Emergency Creating Two View

    Hello everyone,
    I have created 4 tables and populated them but I have a real problem creating 2 Views for them.
    Please if anybody can help because it is a real emergency.
    Well,
    1st View: I want to create a view called ProjMgt which will display the number of employees participating in projects, per department name, but only for those departments which have more than 3 projects.
    2nd View: I want to create a view called Duration which will display the number of employees participating in projects according to the duration of the projects.
    The script is the following:
    CREATE SEQUENCE "DEPARTMENT_ID_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 40 NOORDER NOCYCLE
    CREATE TABLE Departments_pr
         department_ID INTEGER NOT NULL ,
         department_Name VARCHAR2(15) NOT NULL ,
    CONSTRAINT XPKDepartmentsTable PRIMARY KEY (department_ID)
    INSERT INTO departments_pr
    VALUES (department_id_seq.NEXTVAL, 'IT');
    INSERT INTO departments_pr
    VALUES (department_id_seq.NEXTVAL, 'CONSTRUCTION');
    CREATE SEQUENCE "EMPLOYEE_ID_SEQ" MINVALUE 100 MAXVALUE 999999999999999999999999999 INCREMENT BY 10 START WITH 100 CACHE 40 NOORDER NOCYCLE
    CREATE TABLE Employees_pr
         employee_ID INTEGER NOT NULL ,
         first_name VARCHAR2(15) NOT NULL,
         last_name VARCHAR2(20) NOT NULL ,
         position VARCHAR2(15) DEFAULT 'INSTRUCTOR',
         DOB DATE NULL ,
         hire_date DATE NULL ,
         salary NUMBER(9,2) NULL ,
         department_ID INTEGER NOT NULL ,
    CONSTRAINT XPKEmployeesTable PRIMARY KEY (employee_ID),
    CONSTRAINT Has FOREIGN KEY (department_ID) REFERENCES Departments_pr(department_ID)
    INSERT INTO employees_pr
    VALUES (employee_id_seq.NEXTVAL, 'Nick','Maiden', DEFAULT, DATE '1985-03-01', DATE '2001-02-23', 500.50, 1);
    INSERT INTO Employees_pr
    VALUES (employee_id_seq.NEXTVAL, 'Harry', 'Porter', DEFAULT, DATE '1979-03-13', DATE '1999-01-05', 700.56, 1);
    INSERT INTO Employees_pr
    VALUES (employee_id_seq.NEXTVAL, 'Alice', 'Macain', 'MANAGER', DATE '1967-12-01', DATE '1990-11-25', 15460.89, 1);
    INSERT INTO Employees_pr
    VALUES (employee_id_seq.NEXTVAL, 'Mario', 'Fallen', DEFAULT, DATE '1977-07-30', DATE '2000-11-14', 555.00, 1);
    INSERT INTO Employees_pr
    VALUES (employee_id_seq.NEXTVAL, 'Petro', 'Juna', DEFAULT, DATE '1981-02-01', DATE '2005-09-05', 800.67, 1);
    INSERT INTO Employees_pr
    VALUES (employee_id_seq.NEXTVAL, 'Michael', 'Rivers', 'MANAGER', DATE '1967-08-24', DATE '1992-09-24', 16650.45, 2);
    INSERT INTO Employees_pr
    VALUES (employee_id_seq.NEXTVAL, 'Mary', 'Sivers', DEFAULT, DATE '1979-12-10', DATE '2003-12-12', 350.34, 2);
    INSERT INTO Employees_pr
    VALUES (employee_id_seq.NEXTVAL, 'Nikoleta', 'Kalen', DEFAULT, DATE '1984-06-25', DATE '2006-02-03', 780.35, 2);
    INSERT INTO Employees_pr
    VALUES (employee_id_seq.NEXTVAL, 'Rick', 'Jones', DEFAULT, DATE '1979-05-10', DATE '2003-02-12', 500.34, 2);
    INSERT INTO Employees_pr
    VALUES (employee_id_seq.NEXTVAL, 'Many', 'Rihter', DEFAULT, DATE '1984-12-25', DATE '2006-01-03', 980.35, 2);
    CREATE SEQUENCE "PROJECT_ID_SEQ" MINVALUE 50 MAXVALUE 999999999999999999999999999 INCREMENT BY 3 START WITH 50 CACHE 40 NOORDER NOCYCLE
    CREATE TABLE Projects
         project_ID INTEGER NOT NULL ,
         start_date DATE NOT NULL ,
         end_date DATE NULL ,
         pName VARCHAR2(15) NOT NULL ,
         pdescription VARCHAR2(100) NULL ,
         budget NUMBER(7) NULL ,
         department_ID INTEGER NOT NULL ,
    CONSTRAINT XPKProjects PRIMARY KEY (project_ID),
    CONSTRAINT Manages FOREIGN KEY (department_ID) REFERENCES Departments_pr(department_ID)
    INSERT INTO Projects
    VALUES (project_id_seq.NEXTVAL, DATE '2007-01-01', DATE '2008-01-02', 'MADNESS', 'Build a Park in the center of Athens', 50000, 1);
    INSERT INTO Projects
    VALUES (project_id_seq.NEXTVAL, DATE '2007-03-23', DATE '2009-03-23', 'KIFISIAS', 'Create an intersection on Kifisias Avenue 157', 500870, 1);
    INSERT INTO Projects
    VALUES (project_id_seq.NEXTVAL, DATE '2009-02-23', NULL, 'MOLL MEGARA', 'Build a Mall Superstore in Megara', 80780, 1, manager_id_seq.NEXTVAL);
    INSERT INTO Projects
    VALUES (project_id_seq.NEXTVAL, DATE '2007-03-30', DATE '2010-01-30', 'ORACLE DATABASE', 'Create a database for Intracom clients', 300679, 2);
    INSERT INTO Projects
    VALUES (project_id_seq.NEXTVAL, DATE '2008-10-24', NULL, 'WIMAX', 'Create a WiMAX network for Athens municipality', 50800, 2);
    INSERT INTO Projects
    VALUES (project_id_seq.NEXTVAL, DATE '2007-11-13', DATE '2008-10-13', 'SERVERS', 'Order Microsoft Servers for Vodafone and update their IT department', 500500, 2);
    INSERT INTO Projects
    VALUES (project_id_seq.NEXTVAL, DATE '2007-11-12', DATE '2008-10-12', 'SERVERS2', 'Order Microsoft Servers', 60050, 2);
    CREATE TABLE Project_Management
         employee_ID INTEGER NOT NULL ,
         project_ID INTEGER NOT NULL ,
    CONSTRAINT XPKProject_Control PRIMARY KEY (employee_ID,project_ID),
    CONSTRAINT Undertake FOREIGN KEY (employee_ID) REFERENCES Employees_pr(employee_ID),
    CONSTRAINT Are_Assigned_to FOREIGN KEY (project_ID) REFERENCES Projects(project_ID)
    INSERT INTO Project_MANAGEMENT VALUES (100, 50);
    INSERT INTO Project_MANAGEMENT VALUES (110, 53);
    INSERT INTO Project_MANAGEMENT VALUES (120, 59);
    INSERT INTO Project_MANAGEMENT VALUES (130, 62);
    INSERT INTO Project_MANAGEMENT VALUES (130, 50);
    INSERT INTO Project_MANAGEMENT VALUES (110, 65);
    INSERT INTO Project_MANAGEMENT VALUES (100, 65);
    INSERT INTO Project_MANAGEMENT VALUES (140, 68);
    INSERT INTO Project_MANAGEMENT VALUES (150, 56);

    Hi Shruti,
    ODS should not be linked on Timestamp basis, there must be some other alternatives like document number, date etc etc...
    In other case if its possible to include addtional key figure in to ODS then
    create a dummy key figure , in the aggregation tab page Select Exception aggregate as "Last Value" and in the "agg.ref char" Select time stamp as info object. This setting will make sure that in the ODS you have only last updated data.
    Hope that helps.
    Regards
    Mr Kapadia
    Assigning points is the way to say thanks in SDN.

  • 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

  • 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}

  • 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

  • Facing problems while creating tree view

    Hi gurus,
    I am facing problems while crating the tree view can please explain me what are the basic requirements for creating tree view and explain me  which are the methods i need to redefine.
    any answer is appreciated.
    Regards,
    Chetan Agali

    Hi Chetan,
    Maybe Poonam Assudani weblog may help you a little more. Check it's location here:
    /people/poonam.assudani/blog/2009/06/24/create-a-tree-view-display-in-crm-web-ui
    Kind regards,
    Garcia

  • 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.

  • Problem While Creating Classification View in mm01

    Hi Friends,
    I have useing 'BAPI_OBJCL_CREATE' for creating Classfication View
    I am passing   mat no,  class , class type ..
    How can i find  characteristic values  for  particular Class..
    Means How can i find values which r passed through
    ALLOCVALUESNUM , ALLOCVALUESCHAR, ALLOCVALUESCURR  tables
    I have code like this
    {  CALL FUNCTION 'BAPI_OBJCL_CREATE'
              EXPORTING
              OBJECTKEYNEW            = P_MATNR
              OBJECTTABLENEW          = 'MARA'
              CLASSNUMNEW             =  IT_MATMAS-CLASS
              CLASSTYPENEW            =  IT_MATMAS-KLART
            STATUS                  = '1'
            KEYDATE                 = SY-DATUM
            TABLES
            ALLOCVALUESNUM          =
            ALLOCVALUESCHAR         =
            ALLOCVALUESCURR         =
              RETURN                  = IT_RETURN2.

    Hi,
    You need to use the BAPI 'BAPI_OBJCL_CREATE' to create characteristics for a material.
    The characteristics are need to be passed in the table ALLOCVALUESCHAR.
    If you do not know the values for a particular characteristics then you canmake use of FM
    BAPI_CLASS_GET_CHARACTERISTICS and BAPI_CHARACT_GETDETAIL to get the values.
    Regards,
    Ankur Parab

Maybe you are looking for

  • Supp Open Interface Import concurent program submit from Pl/Sql not Working

    Hi, I am new to Financials and using R12.1. We are integrating the Supplier Master from the Operations system from a different platform. The records are inserted into the interface tables and subsequently we need to trigger the concurrent programs fr

  • IPad Air "Photos" will not start?

    When "Photos" icon is tapped, the Home a Page blinks, then nothing. Any solutions? Much thanks.

  • IDOC Experts

    Hi Guys, I have a problem with outbound IDOC. The invoice is fine but in the IDOC the condition record text of Z61A is missing because the segment type E1EDKT1 is also missing in IDOC. This problem occurs in Production but in other Environment it is

  • Firefox doesn't know how to open this address, because the protocol (c)

    this happens when trying to open a local file using a local server (example: easyPHP): my file is located at: C:\Program Files\EasyPHP-5.3.9\www\myweb\test.php and my index page has a link to it. The link is generated depending if I am working local

  • Color mismatch between CS4 and Canon PIXMA PRO6500

    Hi there! I am trying to research if anyone else is having a problem with color mismatch between CS4 and their printer. Last night I printed a .tiff image out of CS4 to my Canon PRO6500 printer and the sky came out purple / pink! It was supposed to b