Query to find uninvoiced orders

Hi,
I am newbie to Financials, Can someone help me coding a select statement to find uninvoiced orders please?
Thanks in advance
Aali

The po_line_locations_all table has a field called amount_billed.
You can look for those records in this table where amount_billed < amount.
Then you can join this table to po_headers_all using the po_header_id.
You can then eliminate canceled/closed shipments by using cancel_flag and closed_code.
Hope this helps,
Sandeep Gandhi

Similar Messages

  • Query to find out the sales order

    Hi All,
    I need a query to find sales order number against which a serial number is transacted.
    Can ny one help onthis.
    Thanks ,

    hi,
    thanks you for your reply.
    its working but i am not able to see the required item serail number.
    Bit confused its their in mtl_serial_number but its not their in sales order.
    How is it possible.
    In mtl_serial_number its current_status is '4'
    Can you please hlep me.
    Thanks

  • Query to find Orders that have all LINES CLOSED status

    All,
    CAn someone send me SQL QUERY TO find all ORDERS that have all LINES in CLOSED status.
    we have an issue in an environment, i am trying to build a data fix script.
    regards
    girish

    Hi,
    Try this :
    Method-1 (backend):
    *==============*
    select a.order_number, b.line_number, b.flow_status_code
    from oe_order_headers_all a, oe_order_lines_all b
    where a.header_id = b.header_id
    and a.org_id= &Org_id     -- Operating_unit_id
    and a.org_id = b.org_id
    and b.flow_status_code='CLOSED'
    Method-2 (front end)
    *==============*
    Orders,Returns --> Order Organizor --> Find orders/Quotes form will open --> Close this serch page only.... --> Now you will able to see Order oganizor form --> Click on Lines Tab of this form (you will see this tab atleft bottom side of the page) --> Press F11.. --> In status Field give parameter as *"CLOSED"..*and press Ctrl + F11 ..... Take an export of the form output..
    Risk : this query may take hell lot of time to complete..as it is going to pull all closed line of a particular Org..
    Method-3
    *========*
    Check if you can find any oracle standard report for closed lines..
    Hope this will help..
    Regards :)
    S.P DASH

  • Find Sales Order Item Basic Data by Elements query fails

    I am trying to consume Find Sales Order Item Basic Data by Elements in .NET 3.0.
    Every thing appears to be working fine -- I could query by PO number, Creation time, SalesOrganisationID etc.
    However, the most basic query is mysteriously failing. I just want to query by Sales order number, and have given a valid sales order number 6718 that exists in SAP.
    It fails giving the following errors:
    (in Log.LogItem.Note variable):
    <b>"Conversion failed: Invalid input format"</b>
    (in Log.LogItem.TypeID variable):
    <b>"701(SFB)"</b>
    Code is pretty simple, and I am just trying to query Saler Order number 6718. Of course there is nothing wrong with its format.
    From the ESOA site, all I could get was:
    <i>----
    QUOTE -
    The following values are optional selection criteria for restricting the search result:
    SelectionByID – Document number range
    INCLUSION_EXCLUSION_CODE
    INTERVAL_BOUNDARY_TYPE_CODE
    LOWER_BOUNDARY_ID
    Value
    UPPER_BOUNDARY_ID Value
    Value
    UNQUOTE -
    </i>
    I could not even have any  documentation on what to put in InclusionExclusionCode, and IntervalBoundaryTypeCode. They apper to be some Global Data Types for which I couldn't find any documentation. By sifting through Wiki, I just guessed a couple of values praying that it may work. I am a bit new to ESOA, but have expertise in .NET 3.0. Would someone guide me where to find the documentation for that, where are the error codes listed, so that I make the queries with little better preparation.
                querydata.SelectionByID = new SalesOrderERPItemBasicDataByElementsQueryMessage_syncSalesOrderERPItemBasicDataSelectionByElementsSelectionByID[1];//Single element array is good enough
                querydata.SelectionByID[0] = new SalesOrderERPItemBasicDataByElementsQueryMessage_syncSalesOrderERPItemBasicDataSelectionByElementsSelectionByID();
                querydata.SelectionByID[0].InclusionExclusionCode = "E";
                querydata.SelectionByID[0].IntervalBoundaryTypeCode = "6";
                querydata.SelectionByID[0].LowerBoundaryID = new SalesOrderID();
                querydata.SelectionByID[0].LowerBoundaryID.Value = "6718";
                querydata.SelectionByID[0].UpperBoundaryID = new SalesOrderID();
                querydata.SelectionByID[0].UpperBoundaryID.Value = "6718";

    How do you test with a SOAP Client  - I am trying to use same dataset as provided?
    I did with WSDL Test - SAP, SOAP Client and got the following error:
    <soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
       <soap-env:Body>
          <nr1:SalesOrderERPBasicDataByElementsResponse_sync xmlns:nr1="http://sap.com/xi/APPL/Global2">
             <Log>
                <MaximumLogItemSeverityCode>1</MaximumLogItemSeverityCode>
                <Item>
                   <TypeID>701(SFB)</TypeID>
                   <SeverityCode>1</SeverityCode>
                   <Note>Conversion failed: Invalid input format</Note>
                </Item>
                <Item>
                   <TypeID>701(SFB)</TypeID>
                   <SeverityCode>1</SeverityCode>
                   <Note>Conversion failed: Invalid input format</Note>
                </Item>
                <Item>
                   <TypeID>701(SFB)</TypeID>
                   <SeverityCode>1</SeverityCode>
                   <Note>Conversion failed: Invalid input format</Note>
                </Item>
                <Item>
                   <TypeID>701(SFB)</TypeID>
                   <SeverityCode>1</SeverityCode>
                   <Note>Conversion failed: Invalid input format</Note>
                </Item>
                <Item>
                   <TypeID>701(SFB)</TypeID>
                   <SeverityCode>1</SeverityCode>
                   <Note>Conversion failed: Invalid input format</Note>
                </Item>
             </Log>
          </nr1:SalesOrderERPBasicDataByElementsResponse_sync>
       </soap-env:Body>
    </soap-env:Envelope>
    Thanks..
    Vikas

  • Query to find out the time used by an user for an application

    Hello All,
    I want to know the query to find out the whole time used by the user for an application. Please view the below data
    Employee:
    SNO EMP_ID EMP_NAME EMP_DATE LOGIN_TIME LOGOUT_TIME
    1 10 Visu 21-Nov-2010 06:30:00 07:30:00
    2 10 Visu 21-Nov-2010 06:40:00 07:20:00
    3 10 Visu 21-Nov-2010 06:50:00 07:50:00
    4 10 Visu 21-Nov-2010 07:30:00 08:30:00
    5 10 Visu 21-Nov-2010 09:30:00 10:30:00
    By checking the above data we can say that the total time Visu used the application is
    8.30 - 6.30 (From 1,2,3,4 records) = 2hrs
    10.30 - 9.30 (Based on 5th rec) = 1hr
    So the total time Visu used the application would be 3 hrs = 180 mins.
    Could you please help me in getting the result from that data using a query?

    odie_63 wrote:
    I think it may be solved with analytics too.
    with t1 as (
                select 1 sno,10 emp_id,'Visu' emp_name,'21-Nov-2010' emp_date,'06:30:00' login_time,'07:30:00' logout_time from dual union all
                select 2,10,'Visu','21-Nov-2010','06:40:00','07:20:00' from dual union all
                select 3,10,'Visu','21-Nov-2010','06:50:00','07:50:00' from dual union all
                select 4,10,'Visu','21-Nov-2010','07:30:00','08:30:00' from dual union all
                select 5,10,'Visu','21-Nov-2010','09:30:00','10:30:00' from dual
         t2 as (
                select  emp_id,
                        emp_name,
                        emp_date,
                        to_date(emp_date || login_time,'DD-MON-YYYYHH24:MI:SS') login_time,
                        to_date(emp_date || logout_time,'DD-MON-YYYYHH24:MI:SS') logout_time
                  from  t1
         t3 as (
                select  t2.*,
                        case
                          when login_time < max(logout_time) over(
                                                                  partition by emp_id,emp_date
                                                                  order by login_time
                                                                  rows between unbounded preceding
                                                                           and 1 preceding
                            then 0
                          else 1
                        end start_of_group
                  from  t2
         t4 as (
                select  t3.*,
                        sum(start_of_group) over(partition by emp_id,emp_date order by login_time) grp
                  from  t3
         t5 as (
                select  emp_id,
                        emp_date,
                        min(login_time) login_time,
                        max(logout_time) logout_time
                  from  t4
                  group by emp_id,
                           emp_date,
                           grp
    select  emp_id,
            numtodsinterval(sum(logout_time - login_time),'day') time_spent
      from  t5
      group by emp_id
      order by emp_id
        EMP_ID TIME_SPENT
            10 +000000000 03:00:00.000000000
    SQL> SY.

  • SQL Query to find Receipt No.s which are not matched to AP Invoices

    Hi
    Please help me to frame a query to find list of Receipt No.s which are not matched with AP Invoices.
    Please refer to the below query .
    SELECT
    poh.segment1 "PO No.",
    aps.vendor_name "Supplier Name",
    pol.item_description "Item Description",
    rcvh.receipt_num "GRV No.s",
    rcvl.quantity_received "Quantity",
    pol.unit_price "Rate/Unit",
    rcvtl.tax_name||' - '||initcap(rcvtl.tax_type) "Tax",
    (rcvl.quantity_received * pol.unit_price) + nvl(rcvtl.tax_amount,0) "Amount"
    FROM
    po_headers_all poh,
    po_lines_all pol,
    po_distributions_all pod,
    ap_suppliers aps,
    rcv_shipment_headers rcvh,
    rcv_shipment_lines rcvl,
    rcv_transactions rcvt,
    jai_rcv_line_taxes rcvtl
    WHERE
    poh.po_header_id = pol.po_header_id
    AND poh.po_header_id = pod.po_header_id
    AND pol.po_line_id = pod.po_line_id
    AND aps.vendor_id = poh.vendor_id
    AND aps.vendor_id = rcvh.vendor_id
    AND rcvh.shipment_header_id = rcvl.shipment_header_id
    AND poh.po_header_id = rcvl.po_header_id
    AND pol.po_line_id = rcvl.po_line_id
    AND rcvh.shipment_header_id = rcvt.shipment_header_id
    AND rcvl.shipment_line_id = rcvt.shipment_line_id
    AND poh.po_header_id = rcvt.po_header_id
    AND pol.po_line_id = rcvt.po_line_id
    AND aps.vendor_id = rcvt.vendor_id
    AND rcvh.shipment_header_id = rcvtl.shipment_header_id
    AND rcvl.shipment_line_id = rcvtl.shipment_line_id
    AND rcvt.transaction_id = rcvtl.transaction_id
    AND aps.vendor_id = rcvtl.vendor_id
    AND rcvt.transaction_type = 'RECEIVE'
    AND poh.authorization_status = 'APPROVED'
    AND poh.segment1 = '210001079'
    I have'nt included the Invoice Tables in the above query.
    Please help me in that area.
    This is bit urgent.
    Please help me.
    Regards
    Nakul Venkatraman

    I am using ORACLE 11gR2 If you're licensed for Diangnostics pack then you might want to look at the AWR tables, e.g. DBA_HIST_SQLSTAT and cross-reference with DBA_HIST_SNAPSHOT.
    By this will i get the top 5 consumed queries of DEV user in the whole session or its just the top 5 queries at that particular time. The "executions" columns in this query, does it mean that the no. of. times the query has executed... This will get you a random 5 queries that were first parsed by DEV. Depending on your application code/structure, it may well be that all code (except for system-recursive sql) executed by DEV is parsed by DEV, and all code parsed by DEV is executed by DEV but this isn't true for all.
    In terms of top N queries, you need to ORDER BY and then restrict by ROWNUM at an outer level to the ROWNUM otherwise the ROWNUM filter is applied before the ORDER BY.
    i.e.
    SELECT *
    FROM
    (SELECT ...
    FROM ...
    WHERE
    ORDER BY...)
    WHERE ROWNUM <= ....
    The "executions" columns in this query, does it mean that the no. of. times the query has executedYes.
    http://download.oracle.com/docs/cd/E11882_01/server.112/e25513/dynviews_3064.htm#REFRN30259
    Edited by: Dom Brooks on Oct 24, 2011 9:45 AM

  • Query to find out controls displayed as in UI for an applet,along with view

    Hi,
    I am looking for a query to find out list of all the controls as displayed in UI applet along with applet's view.
    Please note that in the query only mapped controls (those displayed in UI ) should come up.
    Regards,
    Kunal

    Hi,
    If the EUL is an apps mode (EBS) EUL then the eu_username column is the apps user id or apps resp id. If you want to show only the responsibilities and convert those ids to names then you need to use the EUL5_GET_APPS_USERRESP function like this:
    select ba_name, ba_developer_key, EUL5_GET_APPS_USERRESP(eu.eu_username, 'R') responsibility_name
    from eul5_bas ba
       , eul5_access_privs ap
       , eul5_eul_users eu
    where ba.ba_id = ap.gba_ba_id
    and ap.ap_type = 'GBA'
    and ap.ap_eu_id = eu.eu_id
    and eu.eu_role_flag=1
    order by 1,2,3Rod West

  • Query to find out which process consuming more cpu?

    Hi All,
    some one please tell me the query to find out which process is consuming more
    cpu resources?
    Thanks and Regards
    Srikanth

    Use V$SESSTAT to determine which sessions are using most CPU, and investigate what SQL these users/sessions are executing:
    SQL> select ss.sid, se.command, ss.value CPU, se.username, se.program
    from v$sesstat ss, v$session se
    where ss.statistic# in
    (select statistic#
    from v$statname
    where name = 'CPU used by this session')
    and se.sid=ss.sid
    order by ss.value desc;

  • Need query to find out the sum till a period

    Hi,
    I need to write one query to find out the cumulative sum of raw_cost of table pa_budget_lines till the specified period, I tried to do this by analytical function, but that is not working in Report 10g. Can anybody help me in this.
    Thanks

    not familiar with report but could you do something like this
    with t as
      select 1 grp, 10 * level the_cost, add_months (sysdate,  level) effective_dt from dual connect by  level < 11 union all
      select 2 grp, 5 * level the_cost, add_months (sysdate,  level) effective_dt from dual connect by  level < 11
    input as
      ( select null grp, null the_cost, null running_total,  v_eff_dt effective_dt   from dual)
    select * from(
    select t.grp, t.the_cost, sum(t.the_cost) over (partition by t.grp order by t.effective_dt) running_total, t.effective_dt,
           lead(t.effective_dt) over (partition by t.grp order by t.effective_dt) next_effective_dt,
           input.effective_dt  inp_eff_dt
    from t, input
    where inp_eff_dt between effective_dt and next_effective_dtv_eff_dt would be the input date you are interested in

  • Query to find the latest record with respect to the current status

    Dear gurus
    I have the following data in a table
    Customernum
    bkcode
    reqtdate
    Prevstat
    currstat
    The data will be like this
    CustomerNum bkcode reqdate prevstat currstat
    5900 1 03-Aug-12 0 1
    5900 1 06-Aug-12 1 0
    5900 5 22-Jun-12 0 1
    If a customer has an issue to solved, a record is added with bkcode , register date and currstat will be 1
    If the issue is resolved for the bookingcode,a new record is added, the currentstatus will become 0. and prev stat will show 1. Row no 1 and 2 reflects this case
    If this table is queried for finding the unresolved issues. the output should be only the Last row of the above example. since issue with bookingcode 1 has been resolved
    I have trying hard to get this thing confused what to use Lead or Max
    Kindly guide me

    Hi,
    one way here:
    WITH mytable(CustomerNum, bkcode, reqdate, prevstat, currstat)
    AS
       SELECT 5900, 1, TO_DATE('03-Aug-12', 'DD-Mon-YY'), 0, 1 FROM DUAL UNION ALL
       SELECT 5900, 1, TO_DATE('06-Aug-12', 'DD-Mon-YY'), 1, 0 FROM DUAL UNION ALL
       SELECT 5900, 5, TO_DATE('22-Jun-12', 'DD-Mon-YY'), 0, 1 FROM DUAL
    SELECT CustomerNum, bkcode, reqdate, prevstat, currstat
      FROM (SELECT a.*
                 , ROW_NUMBER() OVER (PARTITION BY CustomerNum, bkcode
                                           ORDER BY reqdate DESC) AS rn
              FROM mytable a
    WHERE rn=1
       AND currstat=1;
    CUSTOMERNUM     BKCODE REQDATE     PREVSTAT   CURRSTAT
           5900          5 22-JUN-12          0          1Regards.
    Al
    Edited by: Alberto Faenza on Dec 18, 2012 5:23 PM
    Changed again!! Previous logic was wrong

  • Query to find the  second maximum date in a table

    please give me the query to find the second maximum date in a table

    You can try with this
    SELECT empno
          ,hiredate
      FROM emp        a
    WHERE 2          = (SELECT COUNT(DISTINCT hiredate)
                           FROM emp        b
                          WHERE b.hiredate      >= a.hiredate
    OR
    SELECT empno
          ,hiredate
      FROM (SELECT ROWNUM      row_num
                  ,empno
                  ,hiredate
              FROM emp        a
          ORDER BY hiredate   ASC
    WHERE row_num             = 2;Regards
    Arun

  • Query to find patches that were applied using admrgpch

    Hi,
    I Hav a query to find what are all patches merged and applied using admrgpch.Here,From the output I am concluding that, all the bugs that were fixed during a specific time were merged and applied using admrgpch.
    Could u please suggest my approach is wrong Or any better alternative is available ??
    =========================================
    col DRIVER_FILE_NAME format a15;
    col ORIG_PATCH_NAME format a7;
    col BUG_NUMBER format a10;
    select To_char(c.creation_date,'DD-MON-YYYY HH24:MI:SS') creation_date, driver_file_name, orig_patch_name,merged_driver_flag, bug_number
    from ad_comprising_patches c, ad_patch_drivers d, ad_bugs b
    where c.patch_driver_id = d.patch_driver_id
    and c.bug_id = b.bug_id
    and c.creation_date like TO_DATE('&a','DD-MON-YYYY')
    order by c.creation_date, bug_number;
    =========================================
    BestRegards/

    Hi All,
    we submitt a concurrent request last month it compleated in 335min. Now the same request is taking 7 hours. what can i do, our production is going on live in june its the error in wrong time, we tryed it for 3 times.. every time its taking 7 to 7.20min how can i resolve it?
    1) Is there any use to increase SGA?
    2) Our queary is very much tuned . . .
    Waiting for responce...
    Thanks
    Krish.
    [email protected]

  • Query to find vendor number with whom a particular item was last purchased.

    Hi All,
    I want to frame a SQL query to find vendor number with whom a particular item was last purchased.
    I got to know that we can find this by looking at the open Purchase Order or the Material Transactions for the transaction type of ‘PO Receipt’ whichever is the latest.
    Can anyone please help me in framing such query.
    Regards,
    Shruti

    Here is a hint
    Use the mtl_system_items_b table to get the inventory_item_id.
    Use it in the po_lines_all table to get po_header_id
    Use it in po_headers_all table to get vendor_id
    Use it in po_vendors to get segment1 (i.e. vendor#)
    Hope this helps,
    Sandeep Gandhi

  • Q30: Cannot find sales order for a committed stock item

    I have a few item numbers which show committed stock in item master data/stock but I cannot find an open sales order or even with an open line on a closed sales order. I have tried various query reports without success.
    Does anyone have a key to unlock this problem?
    Thanks,
    Robin

    Hi,
    Sorry but I am pretty new to SAP and on a learning curve so no idea what note 999124 is or even where/how I would use it.
    Can you explain further please?
    Robin
    Lakshmipathi     
    Posts: 17,513
    Registered: 8/9/07
    Forum Points: 34,462 
    Solved problem (10)
    Very helpful answer (6)
    Helpful answer (2)
       Re: Q30: Cannot find sales order for a committed stock item  
    Posted: Jan 12, 2011 3:18 PM    in response to: Robin Bellion           Reply 
    Check Note 999124 - Incorrect committed\On order quantity when changing orders
    thanks
    G. Lakshmipathi

  • Query to find dependent task attached to task on some response in OIM 11g

    can anyone help me in making a sql query to find dependent task attached to task on some response in OIM 11g
    Edited by: user13331347 on Sep 3, 2012 2:09 PM

    Use below query to find all dependent task in OIM 11g:-
    select pkg.pkg_name, mil.mil_name, rsc.rsc_data, rsc.sta_key, sta.sta_status, sta.sta_bucket, mil2.mil_name
    from     pkg pkg, tos tos, mil mil, mil mil2, rsc rsc, sta sta, rgm rgm
    where     pkg.pkg_key = tos.pkg_key
    and tos.tos_key = mil.tos_key
    and mil.mil_key = rsc.mil_key
    and rsc.sta_key = sta.sta_key
    and rgm.rsc_key = rsc.rsc_key
    and rgm.mil_key = mil2.mil_key
    order by pkg.pkg_name, mil.mil_name, rsc.rsc_data, sta.sta_status, mil2.mil_name

Maybe you are looking for

  • Online Number is not shown sometimes

    Hi there,  I got online number and have been using it for a while. However, few days ago, I started having problems. When I call somebody, they see wrong phone number, or don't see my number at all. Before everything was OK, and I didn't check any se

  • Cd drive not working or responding

    just today I noticed my cd drive isn't working at all. When I put a cd or whatever in nothing happens. also I spilld some V8 fruit juice on the keyboard and the cd drive still worked after that. but now it doesnt work. Anything that I can do?

  • Reverse engineer  from oracle database

    Hi friends, I am looking to create a diagram on my Visio 2010 using the reverse engineering feature to connect to my oracle database..Can some please post the required steps to achieve it...Thank you

  • Find abap programs

    Hi How can we find out that whether there is an abap program written for a paticular query or not. I have got a delivery report and the total volume of quantity moved is wrong.The kFigure name is moved quantity.BUt when i double click on it in the qu

  • Eclipse plugin not working with Eclipse 2.1

    I'm trying to use the Eclipse plugin with Eclipse version 2.1 (recently released). I am aware that the Kodo documentation says it works with Eclipse 2.0. The "Kodo" menu appears in the wrong perspective (the CVS Repository Exploring Perspective). Thi