Is it possible to join a view to a table

Hi all,
I need to create a datasource in R3, the basis of the datasource lies in sql statement. In the statement there are lots of "and" and "(+). Within the "and" statement there is also a filter.
For example (the sql coding):
where rs.docnumber = r.invoicenumber
and ct.caracteristic = 'unspsc_number'
and ekk.costcenter = cs.costcenter
The first 2 lines can be solved with SE11, in here you can set your filter. But in SE11 you can not have an outer join in place.
So, I tried SQ02, creating infosets but the problem with the infoset is that you are not able to set a filter.
My question to you is:
1. is there a solution to solve my problem (sql statement)
2. can an outer join be set in SE11
3. can a selection/filter set in SQ02
4. is it possible in SQ02 to join a view (created in SE11) and join this to another table?
mcteam

James,
datsources can be defined on tables, views and on function modules.
In Views you can define which tables, which fields and wich selections but as far as I know you can't specify outer joins.
The last option is to write a function module that returns you the data. See here in SDN lots of topics to that.
Regards,
Juergen

Similar Messages

  • Outer Join on view hangs

    Hi there,
    sorry about the big post but I am wondering if someone could help me with this. I dont seem to be able to figure out what I am doing wrong here:
    I've created a function that merges a number of lines of text into one row, the function works fine if I call it directly:
    CREATE FUNCTION "LONG_TEXT" (code IN VARCHAR2, inc_no IN VARCHAR2)
    RETURN VARCHAR2 IS
    text_full VARCHAR2(32767);
    BEGIN
    FOR r IN ( SELECT bo_text
    FROM text_table
    WHERE SUBSTR(bo_key,1,4) = code
    AND SUBSTR(bo_key,5,10) = inc_no
    AND bo_text_code = 'IT'
    ORDER BY LINE_NO)
    LOOP
    text_full := text_full || ' ' || trim(r.bo_text);
    END LOOP;
    RETURN trim(text_full);
    END long_text;
    I've called the function in a view - works fine when I call it directly:
    CREATE OR REPLACE VIEW "EEV097_IT" ("CODE","INC_NO","BO_TEXT") AS SELECT DISTINCT SUBSTR(bo_key,1,4) AS code,
    SUBSTR(bo_key,5,10) AS inc_no,
    long_text(SUBSTR(bo_key,1,4),SUBSTR(bo_key,5,10)) AS bo_text
    FROM text_table
    WHERE bo_text_code = 'IT'
    Then I've joined the view to another table. This statement actually works:
    SELECT
    EEV097_IT.CODE,
    EEV097_IT.BO_TEXT,
    EEV097_IT.INC_NO,
    INC_DIM.REV_OCC_DATE
    FROM
    INC_DIM
    LEFT OUTER JOIN
    EEV097_IT ON EEV097_IT.CODE=INC_DIM.CODE AND
    EEV097_IT.INC_NO=INC_DIM.INC_NO
    WHERE
    INC_DIM.BO_USER_ID = 'L83321' AND
    INC_DIM.REV_OCC_DATE BETWEEN '19/FEB/07' AND '23/FEB/07'
    INC_DIM.INC_NO = '1234';
    but as soon as it take this line "INC_DIM.INC_NO = '1234'" out of the where clause or add a second inc_no something like INC_DIM.INC_NO in ('1234','2345'); oracle hangs when I execute this statement - At the end of the day I dont want to specify a inc_no in the where clause at all - The expected result is quite small just about 10 rows I am using oracle version 11.1.0.6.
    If someone has an idea please let me - there would be one work around to put the view as a nested selected into the statement that works fine, but I can't use it. I basically need to end up with a view that I can join to the other table like I did above - so the fix needs to be in the view or in the function.
    thanks
    jess

    Please provide more details as mentioned in When your query takes too long ... thread

  • View on "Transparent Table and DataBase View" ????

    Hi
    I have three transparent tables and four database views in R/3.
    Is it possible to create the view on "Transparent Table and DataBase View". Please let me know
    kumar

    no it's not possible.

  • Is it possible to create materialized view log file for force refresh

    Is it possible to create materialized view log file for force refresh with join condition.
    Say for example:
    CREATE MATERIALIZED VIEW VU1
    REFRESH FORCE
    ON DEMAND
    AS
    SELECT e.employee_id, d.department_id from emp e and departments d
    where e.department_id = d.department_id;
    how can we create log file using 2 tables?
    Also am copying M.View result to new table. Is it possible to have the same values into the new table once the m.view get refreshed?

    You cannot create a record as a materialized view within the Application Designer.
    But there is workaround.
    Create the record as a table within the Application Designer. Don't build it.
    Inside your database, create the materialized with same name and columns as the record created previously.
    After that, you'll be able to work on that record as for all other within the Peoplesoft tools.
    But keep in mind do never build that object, that'll drop your materialized view and create a table instead.
    Same problem exists for partitioned tables, for function based-indexes and some other objects database vendor dependant. Same workaround is used.
    Nicolas.

  • Outer join in view criteria

    Hi everybody
    I use jdeveloper 11.1.1.6.0
    I want to create outer join in view criteria, so I had to override getCriteriaItemClause method in ViewObjImpl.java
    my query is like this :
    SELECT t1.row_no, t2.type FROM   table_1  t1 , table_2  t2
    WHERE   t1.row_no(+) = t2.row_no
      and       t1.user_Id(+) = :bindVar
    table_1(row_no, user_Id )
    table_2(row_no,type)
    the part   " t1.user_Id(+) = :bindVar " should be put in the view criteria
    the method:
        @Override
        public String getCriteriaItemClause(ViewCriteriaItem viewCriteriaItem) {         
                String newQeury =this.getEntityDef(0).getAliasName() + "." +  viewCriteriaItem.getColumnName() + "(+) = :bindVar ";
                return newQeury;
    but when I run the view criteria the exception below raises:
    oracle.jbo.expr.JISyntaxError: JBO-36000: An unexpected expression token is found.
    when I remove sign "(+)" from newQeury
       String newQeury =this.getEntityDef(0).getAliasName() + "." +  viewCriteriaItem.getColumnName() + "= :bindVar ";  // remove sign '(+)' before = :bindVar
    the exception below raises
    JBO-29000: Unexpected exception caught: oracle.jbo.expr.JIEvalException, msg=JBO-25077: Name t1 not found in the given object: ViewRow [oracle.jbo.Key[5 1 5 ]].
    Habib

    This is a duplicate of https://forums.oracle.com/thread/2577092
    Please don't post your questions multiple times. 
    A possible solution posted to the original thread.
    Timo

  • Is it possible the query in view object is dynamic?

    Is it possible the query in view object is dynamic?
    Generally, make the column list dynamic.
    I think this is related to whether view object can be assembled at runtime based on a dynamic cursor in a procedure?
    I ask this because I would like to know how we can use OA framework to simulate crosstab workbook in Discoverer?
    Anybody has some clues, please advise.
    Thanks.

    Hi Shay,
    Let me tell you briefly... I am sending input as customerId,customerNumber,CustomerName to the web service, if the record is available i am getting the response and i am displaying those records on page as a table. Now when i click a row i need to populate another table with all sale orders of that customer. From webservice datacontrol i have only customer object, I dont have Sales Order Object. For this i need master detail relation. In this case how to proceed. Thats why i am thinking to create a vO and EO object for sales orders table and i want to create view link for this sales order and customers. As i don't have customer VO and EO object to create view link.

  • Is it possible to create relational view on Analytic Workspace in Oracle 9i Release1

    Hi All,
    We are in the initial stages of Oracle 9i OLAP prototype. Since the current version of BIBeans 2.5 does not work with Release 2 of Oracle 9i OLAP, we are planning to use Oracle 9i OLAP Release 1. So can you please answer the following questions.
    1. Is it possible to create relational view on Analytic Workspace(like in Release 2) and populate the OLAP catalog, if so can you give me guidance to get the appropriate user guide. The OLAP DML guide in Release 1 talks about creating OLAP catalog metadata for Analytic Workspace using a metadata locator object.
    2, Is it advisable to use Oralce 9i OLAP Release 1? Does the Analytic Workspace and the corresponding BIBeans work in Release 1?
    Thank you,
    Senthil

    Analytic Workspaces (Express/multidimensional data objects and procedures written in
    the OLAP DML) are new to Oracle9i OLAP Release 2, you cannot find them in Release 1.
    BI Beans will soon (within a week) introduce a version on OTN that will work with Oracle9i OLAP Release 2.

  • Is it possible to modify a view at run time?

    Hi,
    I am relatively new to using SQL Server, so sorry if this is impossible or very easy and I missed the solution.
    I am working on an enterprise SQL Server 2008 R2.  Because of the size of the company, we do not want to create new Views as they need to be maintained.  With that said, I need to use Views and not tables because of DB traffic issues.
    HERE IS MY QUESTION:
    Is it possible to Alter a view at run time; in this specific instance I want to change a constraint in the WHERE clause to include one more value in an IN() constraint.  Specifically I want the modified SQL to go from WHERE column IN('A', 'B', 'C')
    to 
    WHERE column IN('A', 'B', 'C', 'L').  I do not want to permanently modify the View, I just want the View to change when it is run for this report.  I need to do this in order to fix a dynamic report.  I am sure that there is another way to
    accomplish this; however, a solution of this manner would also have many other uses, so I am curious if this is possible. 
    Feel free to tell me that it can be done. 
    Thanks for your ideas!!

    Right, I understand those fundamentals.  We outsource a lot of out view creation and do not have permission to create views for Business reasons; these are beyond my control.  However, I can see the source code to many Views.  We have also
    been told that we should not use tables in our queries.  Therefore, I need to use existing Views.  Specifically, I would like to add an additional value to an IN() constraint.  This would change the constraint as showed below: 
    IN('A', 'B', 'C') ---> IN('A',
    'B', 'C', 'L')
    I am wondering if this change can be made when the view runs and only for this one report, with the change being made from the report.  This would be very easy if the constraint was removing a value.  Obviously I could change the constraint from
    IN('A', 'B', 'C') to IN('A','B') very easily with out modifying the View. This would be done by writing a query against the view and in the WHERE clause adding the new IN('A', 'B') statement.  However, I want to do the opposite and add a value...

  • Is it possible to maintain a view vai Batch Input

    Hi guys,
    The user required to develop a BDC program to upload the data source from outside of SAP, and maintain these data into a view via Tcode: SM34. But it seems the view doesn't support Batch input.....
    Can anybody tell me, is it possible to maintain a view via Batch input? Many thanks!
    Brian Liu

    Additional information:
    This requirement is to upload the Overhead Rate data from outside of SAP, and maintained via KZM2 or SM34. But when I tried to record a BDC for KZM2, it seems that the SAP can not support batch input.
    I find a SAP note 208474, it says:
    Symptom
    Overhead rates of the costing sheet of the overhead rates, which have been created, changed or deleted via batch input or Call Transaction, are not saved.
    The same rates are saved if processing is carried out via Transaction KZZ2 or the Implementation Guide IMG.
    Cause and prerequisites
    Processing the Customizing transactions for maintaining the overhead rates of the costing sheet (Transaction KZZ2, KZM2) is
    not supported in the batch input. This corresponds to the SAP standards according to which Customizing transactions in general need not necessarily be capable of batch input.
    The batch input data of the overhead rates are not saved in the standard because processing is terminated by a COMMIT WORK. This statement ensures that the internal tables for the transport of the overhead rates are only deleted if their transfer to the database tables to be transported has been processed successfully.
    Solution
    The subsequent modification allows batch input processing of the overhead rates, by suppressing the COMMIT WORK statement. As a result of the modification, the tables in the transport request of the overhead rates may be incomplete in single cases.
    In cases where the overhead rates have not been transferred completely to the target system after implementation of the modification, include the overhead rates again in a transport request, repeat the transport and, if necessary, subsequent processing.
    Note that the attached modifications are not and will not be included in the R/3 standard system.
    I modified the sap standard program L0COEF04 according to another SAP note 150041, but after the modification, I still couldn't record the BDC.
    Anybody who have ever met the same situation, or can give me some suggestion? With many thanks!
    Brian Liu

  • Is it possible to create a view where table in the From clause changes name

    is it possible to create a view from a from a table like this
    create view my_view as select id, col1, col2, result from <<my_latest_cacahe_table>>;
    the table in the from clause changes the name .
    I have another table which indicates the the latest name of my cache tables. Always there are two records there. The latest one and previous one.
    select * from cache_table_def
    table_name cache_table_name refresh_date
    my_table cache_table245 1/23/2012
    my_table cache_table235 1/22/2012
    create table cache_table_def (table_name varchar2(25), cache_table_name varchar2(25), refresh_date date);
    insert into cache_table_def values( 'my_table','cache_table245','23-jan-2012');
    insert into cache_table_def values ( 'my_table','cache_table546','22-jan-2012');
    create table cache_table245 (id number, col1 varchar2(50), col2 varchar2(20), result number);
    insert into cache_table245 values(1, 'test123', 'test345',12.12);
    insert into cache_table245 values (2, 'test223', 'test245',112.12);
    create table cache_table235 (id number, col1 varchar2(50), col2 varchar2(20), result number);
    insert into cache_table235 values (1, 'test123', 'test345',92.12);
    insert into cache_table235 values (2, 'test223', 'test245',222.12);
    what I need to do is find the latest cache_table name for my_table and use that in my view defintion
    When user select from the the view it always reurns the data from the latest cache_table
    is it possible to do something like this in oracle 11g?
    I have no control on the cache tables names. that is why I need to use the latest name from the table.
    Any ideas really appreciated.

    I've worked up an example that does what you ask. It uses the SCOTT schema EMP table. Make two copies of the EMP table, EMP1 and EMP2. I deleted dept 20 from emp1 and deleted dept 30 from emp2 so I could see that the result set really came from a different table.
    -- create a context to hold an environment variable - this will be the table name we want the view to query from
    create or replace context VIEW_CTX using SET_VIEW_FLAG;
    -- create the procedure specified for the context
    - we will pass in the name of the table to query from
    create or replace procedure SET_VIEW_FLAG ( p_table_name in varchar2 default 'EMP')
      as
      begin
          dbms_session.set_context( 'VIEW_CTX', 'TABLE_NAME', upper(p_table_name));
      end;
    -- these are the three queries - one for each table - none of them will return data until you set the context variable.
    select * from emp where 'EMP' = sys_context( 'VIEW_CTX', 'TABLE_NAME' );
    select * from emp1 where 'EMP1' = sys_context( 'VIEW_CTX', 'TABLE_NAME' );
    select * from emp2 where 'EMP2' =  sys_context( 'VIEW_CTX', 'TABLE_NAME' )
    -- this is how you set the context variable depending on the table you want the view to query
    exec set_view_flag( p_table_name => 'EMP' );
    exec set_view_flag( p_table_name => 'EMP1' );
    exec set_view_flag( p_table_name => 'EMP2');
    -- this will show you the current value of the context variable
    SELECT sys_context( 'VIEW_CTX', 'TABLE_NAME' ) FROM DUAL
    -- this is the view definition - it does a UNION ALL of the three queries but only one will actually return data
    CREATE VIEW THREE_TABLE_EMP_VIEW AS
    select * from emp where 'EMP' = sys_context( 'VIEW_CTX', 'TABLE_NAME' )
    union all
    select * from emp1 where 'EMP1' = sys_context( 'VIEW_CTX', 'TABLE_NAME' )
    union all
    select * from emp2 where 'EMP2' =  sys_context( 'VIEW_CTX', 'TABLE_NAME' )
    -- first time - no data since context variable hasn't been set yet
    SELECT * FROM THREE_TABLE_EMP_VIEW
    -- get data from the EMP table
    exec set_view_flag( p_table_name => 'EMP' );
    SELECT * FROM THREE_TABLE_EMP_VIEW
    -- get data from the EMP2 table
    exec set_view_flag( p_table_name => 'EMP2');
    SELECT * FROM THREE_TABLE_EMP_VIEW
    For your use case you just have to call the context procedure whenever you want to switch tables. You can union all as many queries as you want and can even put WHERE clause conditions based on other filtering criteria if you want. I have used this approach with report views so that one view can be used to roll up report data different ways or for different regions, report periods (weekly, quarterly, etc). I usually use this in a stored procedure that returns a REF CURSOR to the client. The client requests a weekly report and provides a date, the procedure calculates the START/END date based on the one date provided and sets context variables that the view uses in the WHERE clause for filtering.
    For reporting it works great!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Can we write a join on a view and a table

    Hi all,
    can we write a join on a view and a table. i got the requirement from my functional people about the following one
    Select CAUFV-AFUNR, CAUFV-AUART, AFVC-VORNR, CAUFV-FTRMI, CRHD-ARBPL
    into <ProOrd>, <OrdTyp>, <Opt>, <RelDat>, <WorCen>
    from CAUFV, AFVC, CRHD
    where CAUFV-WERKS = plant in selection screen
    and CAUFV-AFUNR = production order in selection screen
    and CAUFV-AUART = production order type in selection screen
    and CAUFV-FTRMI = range of release date in selection screen
    and CAUFV-AUFPL = AFVC-AUFPL
    and AFVC-ARBID = CRHD-OBJID
    and CRHD-OBJTY = ‘A’
    here CAUFV is a view and CRHD and AFVC are transperent tables.
    please tell me any feasible solution for this..
    Thanks  in Advance..

    Hi
    Refer these links:
    <u>http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ec84446011d189700000e8322d00/content.htm</u>
    <u>http://www.sap-img.com/abap/what-is-the-different-types-and-usage-of-views.htm</u>
    <u>http://www.karakas-online.de/forum/viewtopic.php?t=730</u>
    Thanks
    Vasudha
    Message was edited by:
            Vasudha L

  • Possible to Join Two Mono Tracks to Stereo, Or Change Panning of a Stereo?

    In the new Garage Band 11, is it possible to Join Two Mono Tracks to Stereo, or Change the Panning of a Stereo track, or split a stereo track into two mono files?
    Sometimes it would be convenient when I have a lot of tracks to combine two mono tracks into one stereo track to eliminate an additional track.
    Also, I find that I often want to change the panning of a stereo track to either make it wider, or merge the two channels, even reverse L&R. If no way to change the panning of a stereo track can a stereo track be split into two mono tracks to be panned differently?

    Woodwyn wrote:
    is it possible to Join Two Mono Tracks to Stereo
    only by exporting the two tracks
    or Change the Panning of a Stereo track
    you can pan a stereo track in every version of GB with the pan knob
    or split a stereo track into two mono files?
    indirectly:
    http://www.bulletsandbones.com/GB/GBFAQ.html#stereotomono
    (Let the page FULLY load. The link to your answer is at the top of your screen)
    want to change the panning of a stereo track to either make it wider, or merge the two channels
    that's different. no, you'd have to split the track into two mono files as described above.
    even reverse L&R.
    same answer

  • Joining DB VIEW and Command result in cartesian product

    hello,
    My SQL query is joining a DB view and a Command(=ad hoc query).
    Nonetheless from the results it appears that CR didn't join the views correctly, it returns a cartesian product.
    Any idea what the issue could be, I'm using very simple queries.
    Thanks in advance

    #1  make sure you are linking everything together properly in the "Links" tab of the Database Expert
    #2  In my experience, it's just a bad idea to join SQL commands and other tables.  I had poor performance issues in my case.  (It prevents server side filtering and grouping)  My suggestion is to write out the entire thing in the command.  If you are pulling from multiple database, write a separate command for each database and link them.

  • Attribute handling in Sun Java Directory Proxy Server join data views

    Hi all,
    I've configured a join data view and want to get rid of the duplicated attributes that show up in the search results since they are present in the primary and the secondary data view. The documentation says that this behaviour is configurable to return only the values of the primary data view but I can't find any information how to do it.
    Can anybody shed some light on this?
    Thanks and regards
    Geli

    Hi,
    If an attribute is present on both sides and if you want to consider the value(s) from one side only, use the viewable-attr or non-viewable-attr property at the data view level. You can specify which attribute(s) are /are not exposed by that data view (policy for read and write may differ).
    For more details, have a look at [http://docs.sun.com/app/docs/doc/819-0986/non-viewable-attr-5dpconf?l=ko&a=view|http://docs.sun.com/app/docs/doc/819-0986/non-viewable-attr-5dpconf?l=ko&a=view]

  • Is it possible to join a Windows server domain?

    Hi, We have a mixtures of Windows and Mac clients at school. We have recently had installed a Windows Server 2003. The windows all work well - but other than as a file server can I expect more from the macs? Is it possible to join the windows domain - and log in as different users so that different network drives are mounted at log in? Thanks in advance!

    Hi, We have a mixtures of Windows and Mac clients at
    school. We have recently had installed a Windows
    Server 2003. The windows all work well - but other
    than as a file server can I expect more from the
    macs? Is it possible to join the windows domain - and
    log in as different users so that different network
    drives are mounted at log in? Thanks in advance!
    Yes. The server does not have to be running Services for Macintosh.
    If the server is running Active Directory, you'll have to work with the windows admin people to create the AD account.
    Otherwise, you'll just hae access to the shares.
    On the Mac, I think the AD options are under Directory Services.
    To map drives at login, the easiest way is to write an Applescript, save it as an application, and add it as a login item.
    I can't recall the exacy syntax, but for each drive, the script should look something like this:
    Tell Application "finder"
    try
    mount "smb:\\windows.server.ip.address\sharename"
    end try
    You will get a user id/pw/domain prompt for each share.
    For e-mail, assuming they use Exchange, you'll need exchange server 2000 SP 2 or higher with OWA, IMAP, and LDAP active on the mail server to be able to access mail through Entourage or Apple mail.
    Otherwise, you'll be limited to Outlook Web Access.
    Printing: Standard IP,LPR, or appletalk printer setup.

Maybe you are looking for