Open Sales Order Query

Hello Experts,
I would like to pull all Open Sales Orders that do not have purchase orders and are more than 180 days old.
I tried the following query but does not seems to work exactly:
select t0.DocNum
,t0.DocDate
,DateAdd(Day,180,t0.DocDate) as Due180Days
, t0.DocDueDate
, t1.PymntGroup
, t0.OwnerCode
, t2.firstName
, t2.lastName from ordr t0
inner join OCTG t1 on t0.GroupNum = t1.GroupNum
inner join OHEM t2 on t0.OwnerCode = t2.empID
where (t1.PymntGroup like '%prepaid%'
or t1.PymntGroup like '%deposit%')
and t0.DocStatus ='O'and t0.PoPrss='N' and DATEADD(Day,180,t0.DocDate)>180
and t0.OwnerCode=18
Any hlep would be appreciated.
Regards,
Praneeth

Hello Praneeth,
You may try this:
select t0.DocNum,t0.DocDate,DateAdd(Day,180,t0.DocDate) as Due180Days,
t0.DocDueDate, t1.PymntGroup, t0.OwnerCode, t2.firstName, t2.lastName
from ordr t0
inner join OCTG t1 on t0.GroupNum = t1.GroupNum
inner join OHEM t2 on t0.OwnerCode = t2.empID
where (t1.PymntGroup like '%prepaid%'
or t1.PymntGroup like '%deposit%')
and t0.DocStatus ='O'and t0.PoPrss='N' and DATEDIFF(DD,t0.DocDate,GetDate())>180
and t0.OwnerCode=18
What is exactly the issue not seems to work?
Thanks,
Gordon

Similar Messages

  • Creating Query to show items from open sales orders with a/p invoice

    Hi experts,
    I am trying to create a query that will show what items/quantities are still in open sales orders that can now be filled by an incoming shipment of goods, processed through the a/p invoice.
    This needs to be done using subqueries, which I have no experience with.  I am trying to do this using the ORDR and RDR1 tables to show the open items from the sales orders and the OPOR and POR1 tables to show items just received in to inventory.  I would like the query to show exactly the open item's, their quantities, the posting date from the sales order and the customer name that can now be filled from the new shipment through the a/p invoice.
    I appreciate the assistance,
    Hayden (on behalf of Todd)

    Hello,
    try this
    SELECT T0.[DocDate], T1.[ItemCode], T1.[Dscription],( T1.[Quantity] - T1.[DelivrdQty]) As "Open Qty" FROM ORDR T0  INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry WHERE T0.[DocDueDate]  <= [%0]And ( T1.[Quantity] - T1.[DelivrdQty]) != 0
    Try this query in query manager.
    Thanks
    Manvendra Singh Niranjan
    Edited by: Manvendra Singh Niranjan on Jul 13, 2011 6:27 AM

  • Query for all open sales order with a date range

    Hi Experts!
    I wrote this query that will look up all open sales order of a particular customer and how much was served:
    SELECT T0.[DocNum] 'OS #', T0.[DocDate] 'Posting Date', T0.[CardName] 'Customer',  T1.[Dscription] 'Item Description',T4.[SalUnitMsr] 'Sales UOM', T4.[InvntryUom] 'Invty UOM', T1.[UseBaseUn] 'Use of Invty UOM' , T1.[Quantity], T1.[Quantity]-T1.[OpenQty] 'Served Qty', T1.[OpenQty] 'Unserved Qty' FROM ORDR T0  INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OCTG T2 ON T0.GroupNum = T2.GroupNum INNER JOIN OSLP T3 ON T0.SlpCode = T3.SlpCode INNER JOIN OITM T4 ON T1.ItemCode = T4.ItemCode WHERE T0.[DocStatus] = 'O' and T0.[CardName] =[%0]
    However, I don't know how to input a parameter for the date range in a query.  Can anyone help with this issue?
    Your input will be highly appreciated.
    Warm regards,
    Jen

    Hiiiiiii
             Try This.....
    SELECT T0.DocNum 'OS #', T0.DocDate 'Posting Date', T0.CardName 'Customer', T1.Dscription 'Item Description',T4.SalUnitMsr 'Sales UOM', T4.InvntryUom 'Invty UOM', T1.UseBaseUn 'Use of Invty UOM' , T1.Quantity, T1.Quantity, T1.OpenQty 'Served Qty', T1.OpenQty 'Unserved Qty' FROM ORDR T0 INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OCTG T2 ON T0.GroupNum = T2.GroupNum INNER JOIN OSLP T3 ON T0.SlpCode = T3.SlpCode INNER JOIN OITM T4 ON T1.ItemCode = T4.ItemCode WHERE T0.DocStatus = 'O' and T0.CardName ='[%0]' and (T0.DocDate>='[%1]' and T0.DocDate<='[%2]')
    Regards,

  • Report for open sales order

    Dear all,
    I need to create a open sales order report. Could you please tell me from which table i can get open sales order. Its standard report is VA05 and also I checked in table VBBE. but all record which i get from VA05 are not visible in VBBE table. It means VBBE doesnt carry all pending open records.
    Please guide me from which table i can get it or what is the sriteria to get it?
    Thankyou very much in advance
    Punnet Sharma

    hi,
    my logic goes like this:
    Note: Open cursor is used since we are dealing with huge amnt of data:
    * Select orders based on their Delivery status
      SELECT  vbeln
      FROM vbuk INTO TABLE git_vbuk
          WHERE lfstk = 'A' OR lfstk = 'B' .
    * Filter selected orders
    * Selection using open cursor
      DATA: lwa_op_sal_ord1 TYPE gt_comtab.
      IF sy-subrc = 0.
        OPEN CURSOR c1 FOR
          SELECT vbap~matnr
          FROM vbap INNER JOIN vbak
          ON vbap~vbeln EQ vbak~vbeln
          FOR ALL entries IN git_vbuk
          WHERE vbap~vbeln = git_vbuk-vbeln AND
                vbak~vbtyp = 'C'.
        DO.
          CLEAR lwa_op_sal_ord1.
          FETCH NEXT CURSOR c1 INTO CORRESPONDING FIELDS OF lwa_op_sal_ord1.
          IF sy-subrc = 0.
            APPEND lwa_op_sal_ord1 TO li_op_sal_ord1.
          ELSE.
            CLOSE CURSOR c1.
            EXIT.
          ENDIF.
        ENDDO.
      ENDIF.
    here filter orders based on 'A' and 'B' from VBUK...
    then frm header table VBAK get order for vbtyp ='C'.
    now li_op_sal_ord1 will have open sales orders..
    Moreover as per ur query y do u need the item data frm VBAP as u are only concerned abt VBELN.
    If u need item u hv 2 run another select.
    regards,
    ags

  • Report for Open Sales Orders

    Hi..
    my client want the report for all open sales orders in following manner :
    CUSTOMER NAME         ITEM 1      ITEM 2     ITEM 3  ITEM 4
    Customer 1                     23             45           54          76
    Customer 2                     10             20           30          50
    Customer 3                     40             10           30          10
    TOTAL                            73             75          114        136
    please let me know the sql query which i can put in crystal report to creat this report
    Regards
    Rakhi

    hI rAK
    HERE IS UR QUERY FOR OPENSALES ORDER  I THINK THIS WILL SOLVE UR PROB
    SELECT T0.[DocNum], T0.[DocDate], T2.[CardCode], T2.[CardName], T0.[DocTotal],
    (T0.[GrosProfit]/(T0.[DocTotal]-T0.[GrosProfit])*100)'PROFIT%', T2.[CntctPrsn], T2.[Phone1], T3.[GroupName]
    FROM ORDR T0  INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry
    INNER JOIN OCRD T2 ON T0.CardCode = T2.CardCode
    INNER JOIN OCRG T3 ON T2.GroupCode = T3.GroupCode
    WHERE T0.[DocTotal]!= T0.[GrosProfit] and T0.[DocStatus] ='O'
    GROUP BY T0.[DocNum], T0.[DocDate], T2.[CardCode], T2.[CardName], T0.[DocTotal],
    T0.[GrosProfit], T2.[CntctPrsn], T2.[Phone1], T3.[GroupName]
    REGARDS
    JENNY

  • Open Sales Order Report

    Hello..
    my client wants to have the open sales Order report in following format :
    ======================================================================================================
    Customer Name | Item 1 code  | Item 2 code  | Item 3 code  |  Item 4 code  |  Item 5 code  |  Item 6 code  | Item 7 code  |
    =======================================================================================================
    Jack Inc.......................987.................865.....................654.................543.......................739..................543...................987
    Colt Inc.......................237.................213.....................799..................321.......................875...................187...................122
    IOUU LLC...................127.................535.....................654..................777.......................211...................345...................777
    =====================================================================================================
    .................................1351..............1613...................2107.................1641.....................1825.................1075..................1886
    =====================================================================================================
    pls help me to create sql query for the above
    rekha
    Edited by: Rekhatiwari on Dec 16, 2010 10:46 AM
    Edited by: Rekhatiwari on Dec 16, 2010 10:47 AM

    Hi,
    Try this:
    SELECT T0.CardName,
    (Select SUM(isnull(T1.quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '[%2\]') Item1,
    (Select SUM(isnull(T1.quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '[%3\]') Item2,
    (Select SUM(isnull(T1.quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '[%4\]') Item3,
    (Select SUM(isnull(T1.quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '[%5\]') Item4,
    (Select SUM(isnull(T1.quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '[%6\]') Item5,
    (Select SUM(isnull(T1.quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '[%7\]') Item6,
    (Select SUM(isnull(T1.quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '[%8\]') Item7
    FROM ORDR T0
    WHERE T0.docdate between [%0\] and [%1\]
    That might be the only way close to your requirement.
    Thanks,
    Gordon

  • LSMW  - Open Sales Orders

    Hello  Friends
    I want to find if anybody can guide me on how to get all open sales order tables , i want to create a format and create a flat file for uplodading the file , for this what do i need and how do i do it.
    Also for creating LSWM can i use the existing one which i can just Assign the New file to the existing one .
    Regards.

    Dear Mehmood,
    I want to find if anybody can guide me on how to get all open sales order tables
    You want to extract all the open sales orders- which you can get from Table:VBUP key in overall document status in selection screen ( You can use VBUK also- but if there are certain sales orders in which some of the items are completed or few of them open, using VBUK - you will not get exact records)
    Secondly, you can get the data by using Query also- in SQVI
    design a query with VBAK / VBAP & VBUP
    so that from VBAK you can give time period & sales area details
    from VBAP - you can enter plant relevant details to filter certain records & item category as well
    where as VBUP- filter wth the status.
    once downloaded store in flat file.
    Now Create LSMW object by using batch input recording method. after mapping the relevant fields,
    prepare the flat file in such a - it suits to the upload file / recording file. then you can upload the already downloaded n stored open sales orders in flat file.
    Hope this is what you are looking for.
    Regards,
    ReazuddinMD

  • SQL Open Sales Orders Value using today's currency rates

    Hi experts,
    I am creating a report for displaying the open sales order values (and other fields) using current currency rate (where applicable). I developed the below query. The only problem with this query is that it ignores the order rows in which the currency field is blank (Don't understand why this happens in SAP). Do you have other ideas?
    Thanks & Regards,
    IC
    SELECT 
    T0.DocNum as 'Sales Ord No', T0.DocDate as "Ord Date",  T0.CardCode as "Cust Code",  T0.CardName as "Customer Name",  T1.ItemCode, 
    T1.Dscription,  T3.ItmsGrpNam,  T1.U_SU,  T1.U_SULEN,  T1.U_SUQTY,  T2.InvntryUom as 'Stock UOM',  T1.Quantity as 'Ord Qty', T1.Quantity*T2.U_ITWTSTU as 'Weight (KG)', T1.Quantity-T1.OpenQty as "Qty Delivered", T1.OpenQty as 'Bal Qty', T1.Price*T1.Quantity/T4.Rate AS "Ord Value (GBP)", T1.Price*T1.OpenQty/T4.Rate  AS "Open Qty Val (GBP)", T1.Price/T4.Rate  AS "Price (GBP)", T1.Price*T1.OpenQty as "Ord Value (BP Currency)", T1.Price as 'Price (BP Curr)', T1.Currency as 'Cur Ind', T4.[Rate] AS 'Curr Rate', T0.DocDueDate as "Due Date",  T1.WhsCode as 'Del WHG'
    FROM ORDR T0  INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode INNER JOIN OITB T3 ON T2.ItmsGrpCod = T3.ItmsGrpCod, ORTT T4 WHERE T0.DocCur <> 'GBP' AND T1.Currency=T4.Currency AND T4.[RateDate] = [%0] AND T1.OpenQty > 0
    UNION ALL
    SELECT
    T0.DocNum as 'Sales Ord No', T0.DocDate as "Ord Date", T0.CardCode as "Cust Code", T0.CardName as "Customer Name", T1.ItemCode, T1.Dscription, T3.ItmsGrpNam, T1.U_SU, T1.U_SULEN, T1.U_SUQTY, T2.InvntryUom as 'Stock UOM', T1.Quantity as 'Ord Qty', T1.Quantity*T2.U_ITWTSTU as 'Weight (KG)', T1.Quantity-T1.OpenQty as "Qty Delivered", T1.OpenQty as 'Bal Qty', T1.LineTotal AS "Ord Value (GBP)", T1.LineTotal/T1.Quantity*T1.OpenQty AS "Open Qty Val (GBP)", T1.LineTotal/T1.Quantity AS "Price (GBP)", T1.Price*T1.OpenQty as "Ord Value (BP Currency)",T1.Price as 'Price (BP Curr)', T1.Currency as 'Cur Ind', T1.[Rate] AS 'Curr Rate', T0.DocDueDate as "Due Date", T1.WhsCode as 'Del WHG'
    FROM ORDR T0  INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode INNER JOIN OITB T3 ON T2.ItmsGrpCod = T3.ItmsGrpCod WHERE T0.DocCur = 'GBP'  AND T1.OpenQty > 0 ORDER BY 2,1

    Hi,
    Try:
    SELECT 
    T0.DocNum as 'Sales Ord No', T0.DocDate as "Ord Date",  T0.CardCode as "Cust Code",  T0.CardName as "Customer Name", 
    T1.ItemCode,  T1.Dscription,  T3.ItmsGrpNam,  T1.U_SU,  T1.U_SULEN,  T1.U_SUQTY,  T2.InvntryUom as 'Stock UOM', 
    T1.Quantity as 'Ord Qty', T1.Quantity*T2.U_ITWTSTU as 'Weight (KG)', T1.Quantity-T1.OpenQty as "Qty Delivered",
    T1.OpenQty as 'Bal Qty', T1.Price*T1.Quantity/T4.Rate AS "Ord Value (GBP)",
    T1.Price*T1.OpenQty/T4.Rate  AS "Open Qty Val (GBP)", T1.Price/T4.Rate  AS "Price (GBP)",
    T1.Price*T1.OpenQty as "Ord Value (BP Currency)", T1.Price as 'Price (BP Curr)',
    T1.Currency as 'Cur Ind', T4.[Rate] AS 'Curr Rate', T0.DocDueDate as "Due Date",  T1.WhsCode as 'Del WHG'
    FROM ORDR T0  INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry
    INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode
    INNER JOIN OITB T3 ON T2.ItmsGrpCod = T3.ItmsGrpCod
    LEFT JOIN ORTT T4 ON T1.Currency=T4.Currency AND T4.[RateDate] = [%0] AND T4.Rate != 0
    WHERE T0.DocCur != 'GBP' AND AND T1.OpenQty > 0
    Thanks,
    Gordon

  • How to show Open Sales Orders only in a report?

    Hi,
    I am working on a Business Objects report to show open sales orders. Here i pull data from a RapidMart universe for which data comes from SAP.
    I just wanted to know which object or field in SAP can/will differentiate whether a particular sales order is delivered or not.
    Is MRP anyway related to this?
    Plz. help!
    Many Thanks,
    Arun KK

    Gattu,
    Thanks for your reply.
    However, the problem goes like this.
    I am working on an existing BO report. This report works perfectly(shows only the open sales orders) except for some leakage(some delivered items too get it).
    The existing report's query have filters only one MRP Element and Order Category.
    Could there be anything that can be done with these objects?
    Thanks,
    Arun KK

  • How can i get the open sale orders for given material no and plant

    Hi,
    I have to retrieve the open sale orders depending on the material number and plant.
    For only open sale orders at header level and item level.
    I want to use VBUK-GBSTK to find open sale order at header level and
                          VBUP-GBSTA at item level.
    Can any one suggest me the best logic as performance is concerned?           
    Thanks,
    Kumar.

    hi Prasanth,
    select werks matnr from ZVSCHDRUN into table it_plant.
    sort it_plant by matnr werks.
    select
            vbeln
            posnr
            matnr
            werks
            erdat
            kbmeng
            vrkme
            from vbap
            into table it_vbap
            for all entries in it_plant
            where matnr = it_plant-matnr and
                  werks = it_plant-werks.
    and again i have to write one more select query for vbup.
    am i right?

  • Open Sales Order Balance incorret

    Dear All,
    When you copy a Sales Order to an AR-Invoice and then increase the line quantity on the AR Invoice, the Open Sales Order Balance on the Business Partner Master Data shows a negative amount.
    E.G.
    Sales Order 10 Chairs @ R1000 = 10000 (Open Sales Order balance in bp master = 10000)
    Copy to AR Invoice
    AR Invoice 12 chairs @ R1000 = 12000 (Open Sales Order balance in BP maser = -2000)
    When subsequent sales orders are added their is a  - 2000 diff between the Sales order balance and actual open sales orders.
    Can you please tel me how to correct this.
    Best regards
    Erika

    Hi,
    Please run the Query from the Note no. : 999124 and check whether the item in the sales order appears in the results obtained.
    If yes then you need to log a support ticket to get your issue investigated.
    Kind Regards,
    Jitin
    SAP Business One Forum Team

  • Total of particular items of various open sales orders for particular cust

    HI.. following are my Items code  :
    2009,  8010, 8016, 9831, 27363, 27361, 27360, 27181, 16095.
    i want the report that consists of all items to be delivered to the customer. I  have created the following query :
    SELECT T0.CardName AS 'Dept_Name',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '2009') '2009',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '8010') '8010',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '8016') '8016',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '9831') '9831',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '27363') '27363',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '27361') '27361',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '27360') '27360',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '27181') '27181',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '16095') '16095'
    FROM ORDR T0
    but i want the total of particular items of various open sales orders for particular customer.
    pls improve the above query.
    thanks
    reema

    Hi,
    Try this
    SELECT T0.CardName AS 'Dept_Name',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '2009') '2009',
    (Select SUM(isnull(T1.Quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '2009') 'All 2009',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '8010') '8010',
    (Select SUM(isnull(T1.Quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '8010') 'All 8010',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '8016') '8016',
    (Select SUM(isnull(T1.Quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '8016') 'All 8016',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '9831') '9831',
    (Select SUM(isnull(T1.Quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '9831') 'All 9831',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '27363') '27363',
    (Select SUM(isnull(T1.Quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '27363') 'All 27363',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '27361') '27361',
    (Select SUM(isnull(T1.Quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '27361') 'All 27361',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '27360') '27360',
    (Select SUM(isnull(T1.Quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '27360') 'All 27360',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '27181') '27181',
    (Select SUM(isnull(T1.Quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '27181') 'All 27181',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '16095') '16095'
    (Select SUM(isnull(T1.Quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '16095') 'All 16095'
    FROM ORDR T0
    Regards,
    Bala

  • How to identify open sales orders by sales representative by due date. ?

    We rely heavily on forecasting our "billing pipeline".   Billing Pipeline is defined in our organization  by:
    All billings for a specified date range + (all open sales orders + deliveries)  not yet billed but due by  a specified due date = Billing Pipeline.  
    The open items list by Sales Orders + Deliveries will accommodate that by the company but does not accommodate a breakdown by sales person.
    I am looking for a way to generate all Sales Orders & Deliveries that are not yet billed by due date for each sales person. 
    Has anyone done this in SAP core reporting or have a query to accomplish this ...?
    Thanks, Dan
    Prograde

    This one will show you Open orders by open lines by Sales Person by Date Range
    You can use the same structure for Open Deliveries. Change Ordr to Odln and RDR1 to DLN1
    Regards,
    M. Jenkins
    SELECT T2.SlpName, T0.DocNum, T0.CardCode, T0.CardName, T0.NumAtCard as 'Cust PO', T1.ItemCode, T1.Dscription, T1.Quantity, T1.OpenQty AS 'Open', T1.Price, (T1.OpenQty * T1.Price) AS 'Total Net', T1.ShipDate FROM ORDR T0  INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OSLP T2 ON T0.SlpCode = T2.SlpCode WHERE CONVERT(nchar(8), T0.DocDate, 112) >= [%0] AND  CONVERT(nchar(8), T0.DocDate, 112) <= [%1]  and  T1.LineStatus ='o' ORDER BY T2.SlpName, T0.CardName, T0.DocNum
    Edited by: Inc. Cowper on Feb 4, 2009 8:39 PM

  • Join MARA-MATNR to SALES ORDER and find ONLY open sales orders?

    I want to join selected MARA-MATNR number to find ONLY the open Sales Orders. VBAP does not identify the status of the order line...
    If I have one MARA-MATNR and join to VBAP ot VBAP-VAPMA I may find thousands of entries there. Then I have to join to VBUP to find the Status of the sales order line.
    How can I do this join in one step? 
    Thanks Bernard

    Hi,
    For joining diffrent tables you have to create LOGICAL DATABASE,
    and on this logical database you can write ABAP query and execute report.
    Kapil

  • Monthly Sales Order query Doc Status problem

    Hi Experts,
    I am having an problem while making a total monthly sales order query in which I am not getting the document status which are Open - Printed. Also note that these document which are open printed are not having any target document.
    SELECT T0.[DocStatus],T1.[TargetType],T0.[CANCELED],T0.[CardCode], T0.[CardName], T0.[NumAtCard], T5.[SeriesName], T0.[DocNum], T0.[DocDate], T0.[DocDueDate], T0.[DocTotal],T0.[Max1099]'Total Before Discount',T0.[TotalExpns],T4.[descript]'Territory',T2.[SlpName]'Employee Name'
    ,T0.[discsum]  FROM ORDR T0  ,RDR1 T1,OSLP T2,OCRD T3,OTER T4,NNM1 T5  where  T0.DocEntry = T1.DocEntry AND T0.SlpCode = T2.SlpCode AND T0.CardCode = T3.CardCode
    AND T3.Territory = T4.territryID AND T0.Series = T5.Series and T0.[CANCELED]='N' and T1.[TargetType] is not null
    My mission for the above query is to have Total Monthly Sales Orders with value exluding the cancelled and closed sales sales ( close here means - which are manually done by right click on sales order screen and selecting Close )
    Please guied how to solve this issue because in the back end for Sales Order which have turned to deleivery are showing doc status as closed and the sales order which are manually closed are also showing doc status as closed. How to diffrentiate between them.
    Waiting for a positve feedback.
    Regards,
    Rahul

    Try this one:
    SELECT DISTINCT T0.[DocStatus],T0.[CardCode], T0.[CardName], T0.[NumAtCard], T5.[SeriesName],
    T0.[DocNum], T0.[DocDate], T0.[DocDueDate], T0.[DocTotal],T0.[Max1099]'Total Before Discount',
    T0.[TotalExpns],T4.[descript]'Territory',T2.[SlpName]'Employee Name',T0.[discsum]
    FROM DBO.ORDR T0
    INNER JOIN DBO.RDR1 T1 ON T0.DocEntry = T1.DocEntry
    INNER JOIN DBO.OSLP T2 ON T0.SlpCode = T2.SlpCode
    INNER JOIN DBO.OCRD T3 ON T0.CardCode = T3.CardCode
    INNER JOIN DBO.OTER T4 ON T3.Territory = T4.territryID
    INNER JOIN DBO.NNM1 T5 ON T0.Series = T5.Series
    where  T0.[CANCELED]='N' and T1.[TargetType] != -1
    Thanks,
    Gordon

Maybe you are looking for