AdHoc Set Query - set operations - practical use

Hi
I am writing a user manual about AdHoc Query - including Set operations. I am looking for good examples when to use the different operations.  A-B is easy.  Example - 'give me all employees that are not on maternity leave'.  But I am struggling with good practical examples on when to use Union and Intersection.  It needs to be examples that cannot be covered by selection criteria in one single query.
Does anyone have any good practical examples?  Any help appreciated.
Kirsten

Hi Kirsten,
I use Set Operations many times to find individuals who do not have a certain infotype or plan.  Example:  Find all retirees who are not enrolled in a medical plan.  Group A = All retirees;
Group B = All retirees in a medical plan.  A - B = Retirees with no medical plan coverage. 
Ad Hoc Query does not allow you to use "Or" logic in selection with different criteria.  A Union could be used for this.  An example would be employees who are in pay Grade 1 - 5 (Group A) or earn less than $50,000 per year (Group B).  Intersection would be those in Grades 1 - 5 and earn less than $50,000 per year. 
Paul

Similar Messages

  • JDBC & setQueryTimeout - or is there another way to set query timeout?

    I am trying to set query timeout for TimesTen using jdbc library. But it seems like TimesTen jdbc library does not support setQueryTimeOut. Is there a way to set it without having to set it statically in the DNS?
    I tried to set the SqlQueryTimeout in the connection string but it doesn't work either:
         Connection connection = DriverManager.getConnection(
         "jdbc:timesten:client:TTC_SERVER=bleh;TCP_PORT=17013;TTC_Server_DSN=blah;TTC_Timeout=0;SqlQueryTimeout=5;");
    Thanks for your help!

    Thanks for replying. I don't know have good knowledge on Cache Connect. I will have to read on that first.
    It seems like TimesTen does not support jdbc setQueryTimeout. Calling this method on TimesTen jdbc library will return false: supportsQueryTimeout().
    I created a test class for testing the SqlQueryTimeout. I set the TTC_Timeout to 400 seconds and SqlQueryTimeOut to 5 seconds. So after 5 seconds it should time out.
    The way I test it is by putting a break point before executing the query, do a route add DBServer to an un-connectible gateway to simulate the network delay/connection problem and then continue after I added the route.
    After executing the query, instead of timing out after 5 second, it will wait for a few minutes before timing out.
    The code for testing the timeout is as follow:
    public class TTTest {
         public static void main(String[] args) throws ClassNotFoundException {
         Class.forName("com.timesten.jdbc.TimesTenDriver");
         try {
         Connection connection = DriverManager.getConnection(
         "jdbc:timesten:client:TTC_SERVER=server;TCP_PORT=17013;TTC_Server_DSN=server_dns;"
         + "TTC_Timeout=400;SqlQueryTimeout=5;");
         System.out.println(connection.getClass().getName());          
         Statement stmt = connection.createStatement();
         //com.timesten.jdbc.JdbcOdbcStatement stmt = (JdbcOdbcStatement)connection.createStatement();     
         System.out.println(stmt.getClass().getName());
         System.out.println("Query started " + new Date());
    // Pause here, put a route add and continue
         ResultSet rs = stmt.executeQuery("select count(*) from mse");
         rs.next();
         System.out.println("there are " + rs.getInt(1) + " rows");
         rs.close();
         stmt.close();
         connection.close();          
         } catch (Exception x) {           
         x.printStackTrace(System.err);
         System.err.println(new Date());
    }

  • Getting Compilation error when used SET or MULTISET operator on nested tabl

    Dear All,
    I am getting Compilation error when used SET or MULTISET operator on nested tables inside a procedure.
    This is working fine in other DB installations of 10g but does not work in another 10g DB.
    it says "wrong number of parameter or datatype used in SET"
    Can any one suggest what went wrong here?
    Thanks in advance.

    Can any one suggest what went wrong here?Only if you would post the query and Oracle versions on both databases.
    Besides, this forum deals with issues in Oracle product installation. So post this query in SQL PL/SQL forum for better response.

  • Compilation error when used SET or MULTISET operator on nested tables

    Dear All,
    I am getting Compilation error when used SET or MULTISET operator on nested tables inside a procedure.
    This is working fine in other DB installations of 10g but does not work in another 10g DB.
    it says "wrong number of parameter or datatype used in SET"
    Can any one suggest what went wrong here?
    Thanks in advance.

    Hi,
    Thanks for ur reply...
    Since MULTISET and SET operators are the new additions in base 10g release for manipulation of nested tables data, I am surprised that same is working in similar 5 DBs installations with 10.2.0.1.0 version, but does not work in the sixth.
    SET and MULTISET operators are used inside the PL/SQL procedure which is getting compiled in the above mentioned 5 DBs but not in sixth DB.
    it gives
    On line: 3112
    PLS-00306: wrong number or types of arguments in call to 'SET'
    Hope this clarifies the issue...

  • How set current month in Voyager using BEX Query 7.0

    Hi:
      I have a voyager workspace connected a SAP BI Query 7.0. My query shows information since 2007 to 2009
      How I can set current month in characteristics defined in slice section? I tried to use a exit variable in proposed values query section but it doesn't works, when I use filter section in my BEX query it show only  information for 1 month.
    Thanks
    Marta Díaz

    Hi,
    From the problem report i understand that you want to open the Voyager workspace with all the data, but want to analyze for only the current month. 
    You can achieve it in the following manner.
    a) Open the Voyager report.
    b) Click on the member selector of the slice.
    c) Deselect the default member and then select the current month.
    d) Click on OK button.
    This should show you the data for only the current month.
    If you want to make use of exit variable by using the SAP query designer then try using the current calendars month variable.
    You can also refer from the discussion below in the thread to create a variable.
    Dafault value previous month in BEx
    Hope this helps.
    Thanks

  • How to set tabstops in MS Word using the LabVIEW Report Generation Toolkit

    Using the Report Generation Toolkit of LabVIEW, I need to set multiple tabstops that very in distance in MS Word.  I also have different sets of tabstops that I use and re-use at different times in the same report.  Is there a way to set the tabstops under program control?  I searched through the various VIs and found that there is a property ("Tabstops", "Word.Tabstops") in the _ParagraphFormat property node that refers to tabstops.  I found it in the Word Format Paragraph (adv) VI.  Unfortunately, I could not determine how to use it.  Any suggestions?  Is this an operational element?

    Bluebell,
    Sounds like you've already done some fantastic work to expose the various properties and methods of MS Word. It took me about 20 min before I could find the specific property that you were talking about! I found it under Word.Document>>Paragraphs>>Tabstops>>Add. There is a position, alignment and leader parameter that you can set from this property node. I've found that the best way to discover what these parameters do is to simply experiment. You could also try using the macro recorder in Word, perform the specific task, and then look at the code generated. I'm guessing that position sets the position of the tabstop itself. It sounds like your application is really specific. For such a specific task, I think I'd write a macro and call that macro from LabVIEW.
    Chris Cilino
    National Instruments
    LabVIEW Product Marketing Manager
    Certified LabVIEW Architect

  • Getter/setter methods -- how do I use the return values

    I'm just learning Java, and I haven't been to this site since the end of July, I think. I have a question regarding getter and setter methods. I switched to the book Head First Java after a poster here recommended it. I'm only about a hundred pages into the book, so the code I'm submitting here reflects that. It's the beginnings of a program I'd eventually like to complete that will take the entered information of my CD's and alphabetize them according to whatever criteria I (or any user for that matter) choose. I realize that this is just the very beginning, and I don't expect to have the complete program completed any time soon -- it's my long term goal, but I thought I could take what I'm learning in the book and put it to practical use as I go along (or at lest try to).
    Yes I could have this already done it Excel, but where's the fun and challenge in that? :) Here's the code:
    // This program allows the user to enter CD information - Artist name, album title, and year of release -- and then organizes it according the the user's choice according to the user's criteria -- either by artist name, then title, then year of release, or by any other order according to the user's choice.
    //First, the class CDList is created, along with the necessary variables.
    class CDList{
         private String artistName;//only one string for the artist name -- including spaces.
         private String albumTitle;//only one string the title name -- including spaces.
         private int yearOfRelease;
         private String recordLabel;
         public void setArtistName(String artist){
         artistName = artist;
         public void setAlbumTitle(String album){
         albumTitle = album;
         public void setYearOfRelease(int yor){
         yearOfRelease = yor;
         public void setLabel(String label){
         recordLabel = label;
         public String getArtistName(){
         return artistName;
         public String getAlbumTitle(){
         return albumTitle;
         public int getYearOfRelease(){
         return yearOfRelease;
        public String getLabel(){
        return recordLabel;
    void printout () {
           System.out.println ("Artist Name: " + getArtistName());
           System.out.println ("Album Title: " + getAlbumTitle());
           System.out.println ("Year of Release: " + getYearOfRelease());
           System.out.println ("Record Label: " + getLabel());
           System.out.println ();
    import static java.lang.System.out;
    import java.util.Scanner;
    class CDListTestDrive {
         public static void main( String[] args ) {
              Scanner s=new Scanner(System.in);
              CDList[] Record = new CDList[4];
              int x=0;     
              while (x<4) {
              Record[x]=new CDList();
              out.println ("Artist Name: ");
              String artist = s.nextLine();
              Record[x].setArtistName(artist);
              out.println ("Album Title: ");
              String album = s.nextLine();
              Record[x].setAlbumTitle(album);
              out.println ("Year of Release: ");
              int yor= s.nextInt();
                    s.nextLine();
              Record[x].setYearOfRelease(yor);
              out.println ("Record Label: ");
              String label = s.nextLine();
              Record[x].setLabel(label);
              System.out.println();
              x=x+1;//moves to next CDList object;
              x=0;
              while (x<4) {
              Record[x].getArtistName();
              Record[x].getAlbumTitle();
              Record[x].getYearOfRelease();
              Record[x].getLabel();
              Record[x].printout();
              x=x+1;
                   out.println("Enter a Record Number: ");
                   x=s.nextInt();
                   x=x-1;
                   Record[x].getArtistName();
                Record[x].getAlbumTitle();
                Record[x].getYearOfRelease();
                Record[x].getLabel();
                Record[x].printout();
         }//end main
    }//end class          First, I'd like to ask anyone out there to see if I could have written this any more efficiently, with the understanding that I'm only one hundred pages into the book, and I've only gotten as far as getter and setter methods, instance variables, objects and methods. The scanner feature I got from another book, but I abandoned it in favor of HFJ.
    Secondly --
    I'm confused about getter and setter methods -- I'd like someone to explain to me what they are used for exactly and the difference between the two. I have a general idea, that getters get a result from the method and setters set or maybe assign a value to variable. I submitted this code on another site, and one of the responders told me I wasn't using the returned values from the getter methods (he also told me about using a constructor method, but I haven't got that far in the book yet.). The program compiles and runs fine, but I can't seem to figure out how I'm not using the returned values from the getter methods. Please help and if you can explain in 'beginners terms,' with any code examples you think are appropriate. It will be greatly appreciated.
    By the way, I'm not a professional programmer -- I'm learning Java because of the intellectual exercise and the fun of it. So please keep that in mind as well.
    Edited by: Straitsfan on Sep 29, 2009 2:03 PM

    Straitsfan wrote:
    First, I'd like to ask anyone out there to see if I could have written this any more efficiently, with the understanding that I'm only one hundred pages into the book, and I've only gotten as far as getter and setter methods, instance variables, objects and methods. The scanner feature I got from another book, but I abandoned it in favor of HFJ.Yes, there is tons you could have done more efficiently. But this is something every new programmer goes through, and I will not spoil the fun. You see, in 3 to 6 months when you have learned much more Java, assuming you stick with it, you will look back at this and be like "what the hell was I thinking" and then realize just haw far you have come. So enjoy that moment and don't spoil it now by asking for what could have been better/ more efficient. If it works it works, just be happy it works.
    Straitsfan wrote:
    Secondly --
    I'm confused about getter and setter methods -- I'd like someone to explain to me what they are used for exactly and the difference between the two. I have a general idea, that getters get a result from the method and setters set or maybe assign a value to variable. I submitted this code on another site, and one of the responders told me I wasn't using the returned values from the getter methods (he also told me about using a constructor method, but I haven't got that far in the book yet.). The program compiles and runs fine, but I can't seem to figure out how I'm not using the returned values from the getter methods. Please help and if you can explain in 'beginners terms,' with any code examples you think are appropriate. It will be greatly appreciated.
    By the way, I'm not a professional programmer -- I'm learning Java because of the intellectual exercise and the fun of it. So please keep that in mind as well.First, if you posted this somewhere else you should link to that post, it is good you at least said you did, but doubleposting is considered very rude because what inevitably happens in many cases is the responses are weighed against each other. So you are basically setting anyone up who responds to the post for a trap that could make them look bad when you double post.
    You are setting you getters and setters up right as far as I can tell. Which tells me that I think you grasp that a getter lets another class get the variables data, and a setter lets another class set the data. One thing, be sure to use the full variable name so you should have setRecordLabel() and getRecodLabel() as opposed to setLabel() and getLabel(). Think about what happens if you go back and add a label field to the CDList class, bad things the way you have it currently. Sometimes shortcuts are not your friend.
    And yes, you are using the getters all wrong since you are not saving off what they return, frankly I am suprised it compiles. It works because you don't really need to use the getters where you have them since the CDList Record (should be lowercase R by the way) object already knows the data and uses it in the printout() method. Basically what you are doing in lines like:
    Record[x].getArtistName();is asking for the ArtistName in Record[x] and then getting the name and just dropping it on the floor. You need to store it in something if you want to keep it, like:
    String artistName = Record[x].getArtistName();See how that works?
    Hope this helped, keep up the good learning and good luck.
    JSG

  • How to set Query SQL Statement parameter dynamically in Sender JDBCAdpter

    Hi All,
    I have one scenario in which we are using JDBC Sender Adapter.
    Now in this case,we need to set Query SQL Statement with a SELECT statement based on some fields.
    This SQL statement is not constant, it would need to be changed.
    Means sometimes receiver will want to execute SQL statement with these fields and sometimes they will want to execute it with different fields.
    We can create separate channels for each SQL statement but again that is not an optimum solution.
    So ,I am looking out for a way to set these parameters dynamically or set SQL statement at Runtime.
    Can you all please help me to get this?

    Shweta ,
    <i>Sometimes receiver will want to execute SQL statement dynamically</i>....
    How you will get the query dynamically? Ok Let me assume, consider they are sending the query through file, then its definitely possible. But u need BPM and also not sender JDBC receiver adapter instead, receiver JDBC adapter.
    SQL Query File ->BPM>Synchronous send [Fetch data from DB]--->Response -
    >...............
    Do u think the above design will suit's ur case!!!!
    Best regards,
    raj.

  • This is regarding CBMA in SAP PI 7.3.1. I have set up the alert mail using default java mail client.I do receive the alerts via mail. But my requirement is to direct all the mails to Business workplace inbox in ECC.

    This is regarding CBMA in single stack SAP PI 7.3.1. I have set up the alert mail using default java mail client.I do receive the alerts via mail. But my requirement is to direct all the alert mails to Business workplace inbox in ECC.
    So I need to set up PI to redirect mails to ECC Business workplace user inbox (sbwp). From here rules are set up & routed per distribution list.
    Please guide me how I can achieve this requirement.

    Hi,
    yes, it is a little bit different. This is the issue.....  
    But I am not sure if your links will help:
    1) /people/william.li/blog/2008/02/13/sap-pi-71-mapping-enhancements-series-using-graphical-variable
    is about a different solution. I do not need to count the number of lines of the source message.
    And the second variable is about concat line by line from unbound node to unbound node.
    My issue is:
    Souce:
    Message line (0...unbound) ! ! ! ! ! ! ! !
    .    ResultLine   (1..1)
    Mapping:
    =>   ResultLine1
           ResultLine2
           ResultLine........          => into UDF to an element  (1..1) in one mapping operation.
    So that all "ResultLine"s are included.
    The result is explained in the given link for Mail attachment with UDF.
    So I am not sure how to use this thread for my issue.
    In the comments of that blog Christoph Gerber writes that the new variable feature can only handle single values.
    So it is not suitable for my purposes as I have a list of values here that needs to be moved into the target message field.
    2) http://wiki.sdn.sap.com/wiki/display/Java/UsingEditJavaSectioninMessageMapping
    shows where to find the button "Java section" which is not available here in 7.1
    3) /people/sap.user72/blog/2005/10/01/xi-new-features-in-sp14
    too is about the nice little button for Java Section that is no longer existing on PI 7.1 screen for mappings.  
    So my issue is: How to replace the Java section function with global variables in PI 7.1?
    Best regards
    Dirk

  • Query Performance and Result Set Query/Sub-Query

    Hi,
    I have an infoset with as many as <b>15 joins</b> with different ODS and Master Data..<b>The ODS are quite huge with 20 million, 160 million records)...</b>Its taking a lot of time even for a few days and need to get atleast 3 months data in a reasonable amount of time....
    Could anyone please tell me whether <b>Sub-Query or Result Set Query have to be written against the same InfoProvider</b> (Cube, Infoset, etc)...or they can be used in queries
    on different infoprovider...
    Please suggest...Thanks in Advance.
    Regards
    Anil

    Hi Bhanu,
    Needed some help defining the Precalculated Value Set as I wasnt succesful....
    Please suggest answers if possible for the questions below
    1) Can I use Filter Criteria for restricting the value set for the characteristic when I Define a Query on an ODS. When i tried this it gave me errors as below  ..
    "System error in program CL_RSR_REQUEST and form  EXECUTE_VTABLE:COB_PRO_GET_ALWAYS....                     Error when filling value set DELIVERY..                                               
    Job cancelled after system exception ERROR_MESSAGE"                                           
    2) Can I create a create a Value Set predefined on an Infoset -  Not Succesful as Infoset have names such as "InfosetName_F000232" and cannot find the characteristic in Paramter Tab for Value Set in Reprting Agent.
    3) How does the precalculated value Set variable help if I am not using any Filtering Criteria and is storing the List of all values for the Variable from the ODS which consists of 20 millio records.
    Thanks for your help.
    Kind Regards
    Anil

  • Info set query condition

    we have a infoset query to generate a list of parked logistic invoices, we use the same vendor and the same T-code : MIR7 to generate park document, but I can see only the park documents generated by my collegue throgh this info set query.
    I can't see the park documents generated by me throgh this info set query, we are using the same T-code MIR7 and same query.
    why this happen? Is someone set the condition of this query, so i can't see the parked document generate by my self. I can see these parked document(both my collegue and mine) through MIR6

    any idea from query design point of view? thanks

  • WEBI Sample Result Set Query Property Question

    Wnen I set the WEBI Sample Result Set query property my retrievals took longer than I thought they should especially with a limited result set.  When I hit the View SQL button and look at SQL I notice that the following order by is added to the query:
    Order by dbms_random.value
    I copied the query and ran it against our Oracle database with and without the order by.  Without the order by the query ran significantly faster.   Is there any way to stop the order by from being generated when the Sample Result Set property is set?
    Thanks,
    Bob

    Thanks for your reply.
    I tried to locate the parameter you mentioned in the parameters for my universe and did not find anything referencing not enforcing order bys.  I checked the documentation and did not see anything there either.   Please respond with the exact name of the parameter or if it is a custom parameter the settings you used to create it.
    Thanks,
    Bob

  • How to set Border in the Excel using UTL_FILE ?

    Hi all,
    Any one aware of
    How to set Border in the Excel using UTL_FILE ?
    Am doing excel creation from a stored procedure.
    Thanks
    Dora

    Hello Dora,
    if you need more than simple csv: at Re: How to save a query result and export it to, say excell? you can find links to different solutions. At least the package behind the second link supports defining your own formats (and has a tutorial how to do it).
    Regards
    Marcus

  • How to set query result to emai content?

    Dears,
    Since user want to get the email with content like a grid format, just like a sql query result with some columns and rows.
    Is there any simply way to set the sql query result to the email content?
    Thanks!

    Create a transaction or modify the existing one which is sending the email.
    Take the output of the SQL Query action block and use an XSLT action block (lookup the ones in the Transformation portion of the query template you are using in the SQL Query action block to find the one with an HTML output) to convert it to HTML. 
    Go the Web group of action blocks and find the HTML Saver.
    You can save it to the Workbench (actually NW) by using either web://<yourprojectname>/WEB/<yourfoldername>/<yourfilename> or db://<yourprojectname>/WEB/<yourfoldername>/<yourfilename> (web:// publishes it, db:// does not)
    Play around with it a bit to see what will present the data the way you want. 
    Good luck,
    Mike

  • Set query of VO through CO

    How can I set query of VO on run time through CO?
    Thanks,
    Krunal

    could you resolve the issue.
    because I am also facing the same error when I use the
    vo.setWhereClause(".........");
    I have extended the existing controller by adding some conditions for the ViewObject. (see above)
    after assigning the extended controller to the controller class of the page, I am receiving an error about the SQL statement, that includes two where statements in one sql.
    what is the correct syntax for that?
    how can I add one more condition within the controller to the VO???
    thanks a lot in advance for your advices...
    regards,
    DOGAN
    ps: the error I am receiving:
    Error Page
    Exception Details.
    oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: SELECT * FROM (SELECT /* leading (PLL) NO_MERGE( PLL ) USE_NL( PLL POH ) */
    POH.SEGMENT1 PO_NUMBER,
         PRL.RELEASE_NUM RELEASE_NUM,
         DECODE(PRL.PO_RELEASE_ID, NULL, POH.SEGMENT1, POH.SEGMENT1 || '-' || TO_CHAR(PRL.RELEASE_NUM)) DISPLAY_PO_NUMBER,
    POL.LINE_NUM LINE_NUM,
    POL.ITEM_ID ITEM_ID,
         POL.ITEM_REVISION ITEM_REVISION,
         POL.ITEM_DESCRIPTION ITEM_DESCRIPTION,
         POL.VENDOR_PRODUCT_NUM SUPPLIER_ITEM_NUMBER,
    NVL(PLL.PROMISED_DATE, PLL.NEED_BY_DATE) DUE_DATE,
         PLL.RECEIPT_DAYS_EXCEPTION_CODE RECEIPT_DAYS_EXCEPTION_CODE,
         PLL.DAYS_EARLY_RECEIPT_ALLOWED DAYS_EARLY_RECEIPT_ALLOWED,
         PLL.DAYS_LATE_RECEIPT_ALLOWED DAYS_LATE_RECEIPT_ALLOWED,
         POL.UNIT_MEAS_LOOKUP_CODE UNIT_MEAS_LOOKUP_CODE,
         TO_NUMBER(NULL) SHIPMENT_QUANTITY,
         PLL.QUANTITY QUANTITY_ORDERED,
         PLL.QUANTITY_RECEIVED QUANTITY_RECEIVED,
         NVL(HRL.LOCATION_CODE, SUBSTR(RTRIM(HZ.ADDRESS1)||'-'||RTRIM(HZ.CITY),1,20))
    SHIP_TO_LOCATION,
         PVS.VENDOR_SITE_CODE VENDOR_SITE_CODE,
         PVS.PAY_SITE_FLAG PAY_SITE_FLAG,
         POH.PO_HEADER_ID PO_HEADER_ID,
    POH.CURRENCY_CODE CURRENCY_CODE,
    POH.RATE_TYPE RATE_TYPE,
    POH.RATE RATE,
    POH.RATE_DATE RATE_DATE,
    POL.PO_LINE_ID PO_LINE_ID,
    PLL.LINE_LOCATION_ID LINE_LOCATION_ID,
    PLL.SHIP_TO_ORGANIZATION_ID ORG_ID,
         POL.UNIT_PRICE UNIT_PRICE,
         POH.VENDOR_ID VENDOR_ID,
         POH.VENDOR_SITE_ID VENDOR_SITE_ID,
         POV.VENDOR_NAME VENDOR_NAME,
         PLL.SHIPMENT_NUM SHIPMENT_NUM,
         POH.VENDOR_CONTACT_ID VENDOR_CONTACT_ID,
         MSI.CONCATENATED_SEGMENTS ITEM_NUM,
         PLL.TAXABLE_FLAG TAXABLE_FLAG,
         '' TAX_NAME,
         POH.REVISION_NUM REVISION_NUM,
         TO_NUMBER(NULL) TOLERABLE_QUANTITY,
         NULL ORGANIZATION_CODE,
         HRO2.NAME SHIP_TO_ORG_NAME,
         HRO.NAME ORGANIZATION_NAME,
         MUM.UOM_CLASS UOM_CLASS,
         PLL.ORG_ID OPERATING_UNIT_ID,
         PLL.PO_RELEASE_ID PO_RELEASE_ID,
         PLL.MATCH_OPTION MATCH_OPTION,
         PVS.PAY_ON_CODE PAY_ON_CODE,
         PLL.CONSIGNED_FLAG CONSIGNED_FLAG,
         PLL.SHIP_TO_LOCATION_ID SHIP_TO_LOCATION_ID,
         POL.SUPPLIER_REF_NUMBER SUPPLIER_REF_NUMBER,
         nvl(POH.SHIPPING_CONTROL,'SUPPLIER') TRANSPORTATION_ARRANGED_BY ,     
    PLC.DISPLAYED_FIELD TAB_Display,
    NVL(MSI.PRIMARY_UNIT_OF_MEASURE,POL.UNIT_MEAS_LOOKUP_CODE),
    PLL.QTY_RCV_EXCEPTION_CODE
    FROM
    PO_HEADERS_ALL     POH,
    PO_LINES_ALL     POL,
    PO_LINE_LOCATIONS_ALL      PLL,
    PO_RELEASES_ALL           PRL,
    PO_VENDOR_SITES_ALL      PVS,
    HR_LOCATIONS_ALL_TL     HRL,
    HZ_LOCATIONS          HZ,
    PO_VENDORS               POV,
    MTL_SYSTEM_ITEMS_KFV     MSI,
    MTL_UNITS_OF_MEASURE     MUM,
    HR_ALL_ORGANIZATION_UNITS_TL     HRO,
    HR_ALL_ORGANIZATION_UNITS_TL     HRO2,
    PO_LOOKUP_CODES PLC
    WHERE
    POH.PO_HEADER_ID = PLL.PO_HEADER_ID AND
    POH.PO_HEADER_ID = POL.PO_HEADER_ID AND
    POH.AUTHORIZATION_STATUS = 'APPROVED' AND
    POL.PO_LINE_ID = PLL.PO_LINE_ID AND
    POL.UNIT_MEAS_LOOKUP_CODE = MUM.UNIT_OF_MEASURE (+) AND
    PLL.PO_RELEASE_ID = PRL.PO_RELEASE_ID(+) AND
    POV.VENDOR_ID = POH.VENDOR_ID AND
    PVS.VENDOR_SITE_ID = POH.VENDOR_SITE_ID AND
    HRL.LOCATION_ID(+) = PLL.SHIP_TO_LOCATION_ID AND
    HRL.LANGUAGE(+) = USERENV('LANG') AND
    HZ.LOCATION_ID(+) = PLL.SHIP_TO_LOCATION_ID AND
    NVL(PLL.APPROVED_FLAG, 'N') = 'Y' AND
    NVL(PLL.CANCEL_FLAG, 'N') = 'N' AND
    NVL(POH.FROZEN_FLAG, 'N') = 'N' AND
    NVL(PLL.CLOSED_CODE, 'OPEN') NOT IN
    ('FINALLY CLOSED', 'CLOSED', 'CLOSED FOR RECEIVING', 'CANCELLED') AND
    (PLL.QUANTITY*(1+NVL(PLL.QTY_RCV_TOLERANCE, 0)/100)) >
    (NVL(PLL.QUANTITY_RECEIVED, 0) + NVL(PLL.QUANTITY_SHIPPED, 0) + NVL(PLL.QUANTITY_CANCELLED, 0)) AND
    PLL.SHIPMENT_TYPE IN ('STANDARD','BLANKET','SCHEDULED') AND
    NVL(PLL.payment_type, ' ') not in ('ADVANCE', 'DELIVERY','MILESTONE','RATE','LUMPSUM') AND
    POL.ITEM_ID = MSI.INVENTORY_ITEM_ID (+) AND
    NVL(MSI.ORGANIZATION_ID, PLL.SHIP_TO_ORGANIZATION_ID) = PLL.SHIP_TO_ORGANIZATION_ID AND
    HRO2.ORGANIZATION_ID (+) = PLL.SHIP_TO_ORGANIZATION_ID AND
    HRO2.LANGUAGE (+)= USERENV('LANG') AND
    HRO.ORGANIZATION_ID (+) = POH.ORG_ID AND
    HRO.LANGUAGE (+)= USERENV('LANG') AND
    DECODE(PLL.PO_RELEASE_ID, NULL, NVL(POH.CONSIGNED_CONSUMPTION_FLAG, 'N'), NVL(PRL.CONSIGNED_CONSUMPTION_FLAG, 'N'))!='Y'
    AND PLC.LOOKUP_TYPE='SHIPPING CONTROL'
    AND NVL(POH.SHIPPING_CONTROL,'SUPPLIER') =PLC.LOOKUP_CODE
    AND PLL.OUTSOURCED_ASSEMBLY <> 1
    AND PLL.PAYMENT_TYPE IS NULL) QRSLT WHERE (NVL(HRL.LOCATION_CODE,SUBSTR (RTRIM (HZ.ADDRESS1) || '-' || RTRIM (HZ.CITY), 1, 20)) not in ('BU-TVP')) ORDER BY DUE_DATE ASC
    Edited by: doGan on Jan 31, 2011 7:27 AM

Maybe you are looking for