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,

Similar Messages

  • SD report for the open sales orders with items

    Hi,
    Is there any standard SAP report which display open sales order togeather with the open items. I want to have columns target quantity, delivered quantity and open quantity.
    Any tip?
    BR
    Saso

    Dear Saso,
    I think, instead using Report: VA05/ VA05N; its better to use Report: VL10C
    In this report, you will get all the Sales Orders along with Materials - relevant for open delivery, along with Open Qty. and various other options can be selected from "Change Layout - (Ctrlt+F8)".
    Best Regards,
    Amit
    Note: Don't maintain any Field-Entry (while executing the Report: VL10N; in order to list all Sales Orders. But, if you want to list Sales Orders based upon some criterias, maintain the Field-entries, as reqd.

  • Migrate all Open Sales Orders From Legacy System (SAP) To SAP System using

    Hi Experts,
                 I've to Migrate all Open Sales Orders From Legacy System (SAP) To SAP System using Business Objects with a new SALES ORDER DOCUMENT NUMBER referencing the older one.
               I'll get all the required data with field in an excel file.
                 Does any standard transaction exist for it ? Or how to go ahead with it ?
    Thanks and regards,
    Jyoti Shankar

    Hi
    If you are checking for CREATE option then Sales Doc Type
    For more Info goto SWO1 transaction -> BUS2032 --> DIsplay --> Execute --> There SELECT the method which you want to perform... There you can fine the MANDATORY parameters also....
    Or in DISPLAY mode PLACE Cursor on the Required Method and CLick the PARAMETERS button on toolbar...
    That will show the MANDATORY parameters...
    Reward if helpful....
    Message was edited by:
            Enter the Dragon

  • Regarding All open sales order & want to close them

    Hi All,
    My client want the list of all open & partially open sales order in the time period excluding cureent & previous months & want to close all those sales order with partally open & fully open status
    Regards,
    Rohan

    Rohan in t-code mass find the reason for rejection and also try and block the sales order if you find it useful.
    Steps are below:
    First have those open order references in an excel sheet.
    Go to MASS, input Object Type BUS2032 and execute. There block "Sales order header data" and click on "Fields". There select the field "MASSSDHEAD_S-LIFSK" and execute.
    Now click on "Multiple selection" (right arrow), copy those order references and press "Shift+F12" and execute. There on top, assign some block and execute. All your sale orders will be blocked.
    On the other hand, you can also change the status of those sale orders by assigning "Reason of Rejection" in mass. To achieve this, go to TCode MASS, input Object Type BUS2032 and execute. There block on "Sales Order Item Data" and click on "Fields". There block the field "MASSVBAP-ABGRU" and execute. Follow the same procedure as explained above.
    Now see the document flow of those sale orders.
    Edited by: Muhammad Ali Lozada on Dec 28, 2010 12:32 PM

  • Change open sales order with new condition schema

    Hi SD Experts,
    I have to change condition type on condition schema. For example, now we have ZPVI (Discount %). I have to change with ZPFI (Discount %). But we have some open sales orders with old schema. Can I correct old sales orders with new condition schema? Is it possible?
    Thank you.
    Gulay Celik

    >
    Shai Sinai wrote:
    > 3) The item categories of document items are assigned to billing plan types. This customization does create separate billing plan for each item, but the billing plans of item are refrenced to the header billing plan (according database field FPLA-RFPLN and screen field RV60F-KFREL), what  means that item's values are not taken into consideration.
    >
    In this case it is obvious that it's not possible to have an item on the same document, which would have a billing plan different from the header. Unless, of course, you are ready to change the existing configuration or create a new item category, which would be independent from the header billing plan.
    If, despite configuration, such entry is possible in VA41/VA42, then you'll have to use BDC instead of BAPI. Unfortunately, BAPIs do not have all the same functionality that might be available in the transaction.

  • All Open Sales Orders in APO system

    Hi Experts,
    We have a requirement in which we have to get all open sales orders in SAP APO system for 2013.  Please suggest if there is some way to do this.
    Thanks in advance.

    Hi Manjunatha,
    RRP1 will list all the requirements: sales orders, forecast, dependent demand, putchase order release, etc.
    Same than in all the ALV reports, you can change the layout, sort, use filters in order to only see the document that you need, etc.
    Here you can an example of my system, where you have sales orders in RRP1:
    Kind Regards,
    Mariano

  • How to get all open sales orders of a customer and also account group

    I want to know the logic to find all open sales orders of a customer and also account group

    Hi,
    You can check the status weather a Sales order is Open or not by checking its billing status form the following:
    Check table VBUK and VBUP for delivery status "LFSTK" and billing status "FKSTK".
    Rward points if helpful answer.
    Ashven

  • Load a sales order with delivery date in the past

    Hi,
    We want to load in the system a sales order with delivery date in the past, and maintain the schedule delivery date in the past. To do that, in the customizing Sales And Distribution / Basic Functions / Delivery Scheduling and Transportation Scheduling / Define Scheduling By Sales Document Type, I selected the flag Blackwards. But the problem is that the rest of the dates in the scredule line: goods issue date, loading date, material avail.date and transportation Plan Date, are in blank and you cannot enter any data because the system deletes it.
    How can I have these dates informed with dates in the past?
    Thanks in advance,

    You can control this using the "Message Control" in the SAP IMG.
    Supplier Relationship Management>SRM Server>Cross-Application Basic Settings>Message Control>Influence Message Control
    Using this you convert Error to Warning or even swith off this message.
    Please refer this thread for complete steps:
    Re: How to change an error message to a warning message in SRM
    Note: you need to suppress the messages relevant to your case here.
    Regards
    Kathirvel

  • 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

  • Conversion program for the open sales orders

    Hi ,
         How to proceed for writing a conversion program for open sales order ??
    Please share if 've any document or idea.
    LSMW object: 0090, Method: 0000
    Business Object : BUS2032, Method : CREATEFROMDAT2,
    Message Type: SALESORDER_CREATEFROMDAT2
    Basic Type: SALESORDER_CREATEFROMDAT202
    Regards,
    Jyoti Shankar

    Dear Saso,
    I think, instead using Report: VA05/ VA05N; its better to use Report: VL10C
    In this report, you will get all the Sales Orders along with Materials - relevant for open delivery, along with Open Qty. and various other options can be selected from "Change Layout - (Ctrlt+F8)".
    Best Regards,
    Amit
    Note: Don't maintain any Field-Entry (while executing the Report: VL10N; in order to list all Sales Orders. But, if you want to list Sales Orders based upon some criterias, maintain the Field-entries, as reqd.

  • LSMW For Converting Open Sales Orders (not working for more than 1 item)

    Hi,
    I am using following standard object for Open sales orders .
    Object               0090   Sales documents                   
    Method               0000                                     
    Program Name         RVINVB10                                 
    Program Type         D   Direct Input                         
    Its not working for more than 1 line item.
    For more than 1 line item its giving Error saying that
    '102122                         V1                   845
    Print parameter SAPML2 1 is not defined
    Can anybody help me out in this regard.
    Thanks in advance.
    Nitin.

    hello, friend.
    i will still research the subject.  but the first thing that comes into my mind is t-code VA05.  with this, you have the option to change the Plant en masse.  so a possible workaround is for you to list a number of sales orders using VA05.  you then sort the line items by Plant.  choose all items with the same plant, change the plant via mass change... then change back to the original plant.  hopefully, the new settings should apply.
    do test a few sales orders by doing this for a larger scope.
    regards.

  • Retrieving all open Sales Orders

    Hai All,
    Can any one inform me how to get all the open sales orders?
    is there any fuction module exits for this?
    if not if any one knows the logic for this?
    Thanks & Regards,
    Bhaskar

    Hi Bhaskar,
    check this link for sample code.
    Re: Open Orders Report.
    Regards,
    Kiran Sure

  • Converting Open Sales Orders after MM data changes

    Hello,
       We are 'upgrading' a live v4.7 system to now use MRP. We have many open Contracts/Sales Orders with the affected materials. We are looking for a way to have SAP 'recalculate' or 'reload' the material master and VC data for these open orders without having to create new contracts/orders. There are absolutely no changes to the data entered into the contract/order. But because the orders were created with the old material master information they will not generate the MRP requirements unless we go into each order and cancel the line item and re-enter it into the order. This would be a significant amount of work to do either manually or writing a program to create new orders based on the existing orders.
    Anyone know of a method or tool that will force SAP to reload the MM/VC config information into these existing open orders?
    I would think this is a common issue for SAP upgrades where the new system turns on MRP.
    Any help is greatly appreciated and good answers will get points.
    John

    hello, friend.
    i will still research the subject.  but the first thing that comes into my mind is t-code VA05.  with this, you have the option to change the Plant en masse.  so a possible workaround is for you to list a number of sales orders using VA05.  you then sort the line items by Plant.  choose all items with the same plant, change the plant via mass change... then change back to the original plant.  hopefully, the new settings should apply.
    do test a few sales orders by doing this for a larger scope.
    regards.

  • SQL Queries for open sales orders with no invoice.

    Hello all!
    Is there a way to make a query to find out if there are any uninvoiced sales orders older than 5 days?  I am having difficulty figuring out how the invoice is linked to the sales order.
    I am more familiar with excel than SQL but I'm guessing it will be similar to the following:
    SELECT * FROM ORDR WHERE today's date - posting date>5 AND (not sure what to check here for the invoice having been created)
    **Note: my syntax is of course not exactly correct, this is just to give you an idea of what I'm looking for
    Has anyone had to do this before or know how it would be done?  It would be very useful for me.
    Thanks!
    Mike

    Hi Mike
    The document link is built on row level so the RDR1 should be used instead of ORDR to server your propose.
    You could use this query to get all the lines do not link to a invoice.
    *targettype 13 refers to target document invoice
    select t0.docentry,t0.docdate,t0.linenum,t0.itemcode,t0.quantity,t0.price,t0.linetotal
    from rdr1 t0 join ordr t1 on t0.docentry= t1.docentry
    where t0.trgetentry is null and t0.DocDate < dateadd("d",-5, getdate()) and t1.docstatus = 'O'
    or just use this query instead to find those lines do not link to any document
    select t0.docentry,t0.docdate,t0.linenum,t0.itemcode,t0.quantity,t0.price,t0.linetotal
    from rdr1 t0 join ordr t1 on t0.docentry= t1.docentry
    where t0.targettype !='13' and t0.DocDate < dateadd("d",-5, getdate()) and t1.docstatus = 'O'
    Please modify the code according to your needs.
    Regards,
    Syn Qin
    SAP Business One Forums Team
    Edited by: Syn Qin on Aug 11, 2008 5:20 AM

  • Close open sales order with no subsequest documents

    Hi,
    I have a scenario where line items in a sales order have been rejected citing a reason. But for two of these line item materials in a  report are showing up as open with zero quantity (comes up as error in report). The quantity of all line items in the sales order is zero. These line item description column is complete.
    how can this be corrected. how the sales orders  can be made completed, without deleting line items.
    Thanks
    Sharan

    Just a quick check,
    do all items you rejected have been assigned the same reason for rejection.

Maybe you are looking for