Including data post-filtering

Hi all:
I have a database table named ORDERS that contains repair order data and invoice data. Each record has an ORDERTYPE (i.e. INVOICE or REPAIR) and all invoice records have a system-generated ORDERID that links them to the repair orders (called the REFORDERID). 
I have a second database table called ORDERLN that contains all individual line items for the repair orders and invoices. I need to access this data selectively to retrieve sales and cost information. 
All tables currently have inner joins not enforced.
The data lines for repair orders and invoices are separate in the ORDERLN table and have to be linked via ORDERIDs.  There may be several lines for one repair order or invoice (part data, labor data, comments, etc).  The repair orders have their own line items with COST data and the invoices have their own line items with SALES data.
I need to limit my selected report data by the invoice closed date, which is contained in the ORDERS table. So the problem arises here where I need to include INVOICETYPE="invoice" within a date range, then the repair orders (also in the ORDERS table) get dropped.  I need these repair order IDs to access their corresponding cost information in the ORDERLN table.  The only data point i have to link the invoice and repair order in the ORDER table is via the REFORDERID -- see the image I attached.
I need a way to first restrict the invoice type and close date, then use the REFORDERID on those data records to pull in the associated repair orders (these would already be closed orders). 
I have all the sales data in my report working, displaying sales by part and invoice order ID. However, I can't get the part cost data for the repair order line items to display because the REFORDERID (in the ORDERS table) is nested within each invoice record. If I don't limit the data by invoicetype="invoice" I can get the cost data to work; however, I need to filter the whole dataset by invoice closed date.
Can anyone guide me either with record selection formulas or SQL queries?

This is really not that difficult because Crystal will let you "alias" tables.  For example, in the Database Expert, you would add a second copy of your ORDERS table.  Crystal will tell you the table already exists and ask if you want to add an alias.  The table will then be added as ORDERS_1.  To prevent confusion, I would then select ORDERS_1 on the right of the screen, press F2, and rename it to REPAIRS.  Do the same thing with ORDERS and name it INVOICES.  You would then link from INVOICES to REPAIRS on the Order ID (or whatever field joins invoices to repair records).  In the Select Expert you would add something like the following criteria:
{INVOICES.INVOICETYPE} = 'invoice' and
{REPAIRS.INVOICETYPE} = 'repair'
To get the line items, you would also add another copy of your ORDERLN table.  To link things together, you would have the invoices table link to one copy of ORDERLN and the repairs table link to the other copy.   The picture below shows how the tables join together.
-Dell

Similar Messages

  • Data Validation/Filtering Using SmartView

    Hi,
    I just want to know that how can i apply Data Validation/filtering in SmartView.
    For E.G if i want that Only those combination should be Shown where the Value of a Product is Always Greater than 2000.
    Please help out
    Thanks in Advance

    Well, yes it is true you can write MDX for it but that isn't what you asked is it?
    If you look at the Tech Ref
    http://docs.oracle.com/cd/E17236_01/epm.1112/esb_tech_ref/frameset.htm?launch.html
    and search for IIF there is an example there that should point you in the right direction.
    WITH MEMBER
    [Scenario].[Revised Budget]
    AS
    'IIF (
    [Product].CurrentMember.Caffeinated,
    Budget * 1.1, Budget
    SELECT
    {[Scenario].[Budget], [Scenario].[Revised Budget]}
    ON COLUMNS,
    [Product].Levels(0).Members
    ON ROWS
    FROM Sample.Basic
    WHERE ([Measures].[Sales], [Year].[Qtr3])
    Otherwise I might post a new question asking for someone to help you optimise an MDX query.
    Steve

  • Invoice verification Invoice date,Posting date and Baseline Date

    Hi Sap Gurus
    Pls Tell Me in detail what Dates should be entered at MIRO transaction,
    Invoice date,Posting date and Baseline Date
    i presumed that the date on the Invoice slip will be Invoice date,
    But in the Invoice the Date is very long back, say a month Older,
    the month of Posting as Posting date, but any posting Date made in MIRO will be Paid after 2 or 3 months so in this case what should be the Posting date.
    at Base line date in the present company Senario the Discount on Vendor payment is literally valid for all the time , say
    In Invoice if the condition is 10% discount if paid in 30 days is given.
    but in actual sense the Vendor is paid 10% less even if he is paid after 4 or 6 months also, so in this case what should be the Entry in Baseline date
    another senario is the vendor has sent only one Invoice for 2 POs how can this be accomadated in SAP
    Pls suggest its Urgent,
    Age may have a Bar, But Points No Bar
    Thanks and Regards
    Sathish

    Hi
    LIV is nothing but You are getting Invoice from the Vendor for your PO   and GR.....and you are checking the Invoice for Price, Qty,Amount etc. by refering the PO  and posting the Invoice...
    Invoice Date : 
               The date of Vendor' Invoice...ie) Date at which the vendor Raised the invoice for his supply against your PO...
    Posting Date :
       The Date at which you actually Verifying Vendor's Invoice and doing the Posting...
    base line date :
        Generally the Posting Date...
    The Imp. of Baseline date is for eg)
    If in the Payment Terms if some conditions are maintained like say
    10% Discount for Payment With in 30 days, if
    PO created on 01.11.2007.
    GR done at 10.11.2007.
    Invoice slip Received at 30.11.2007 but having the Date on it as 20.11.2007...
    So as per your terms you will get 10% Discount if you make the payment on or  20.12.07....
    Here if you keep  inv. Date: 20.11.2007  and Posting Date : 30.11.2007  and Baseline Date as  30.11.2007 ( you cannot maintain baseline date earlier than  Posting date)....even though as per terms the you are  eligible for discount if you make the payment on or before 20.11.2007.....as per the system you are still eligible to get the Discount if you make payment on or 30.12.2007( since you have maintained baseline date as 30.11.2007)...
    this way Baseline date is Importane...
    Generally we use to maintain always Posting Date as Baseline date....
    It is advantageous..
    Reward if useful
    regards
    S.Baskaran

  • Difference between doc date,posting date and invoice date

    hi bw guys
    can someone give a brief on the difference between doc date,posting date and invoice date.and the invidual definitions
    thank you

    Hi,
    Posting Date: Date which is used when entering the document in Financial Accounting or Controlling. The posting date can differ from both the entry date and the doc date.
    Document Date: The document date is the date on which the original document was issued. Ex: Inv date, Bill date etc.,
    Invoice Date : Usually the date when goods are shipped. Payment dates are set relative to the invoice date.
    -Vikram

  • Document Date & Posting date relations with PO-GRN-MIRO.

    Dear Experts,
    Could you please join the date relations for PO-GRN-MIRO with DOCUMENT DATE & POSTING DATE.
    I want to ask that what exactly we say Document Date & Posting Date to PO - GRN & MIRO.

    what exactly we say Document Date & Posting Date
    Just type in google difference between document date and posting date  and execute.  You will find lot of threads discussed on this topic.  Please dont post any query without searching the forum or google.
    G. Lakshmipathi

  • GRN Document Date / Posting Date Field Mandatory or Freeze

    Dear All,
    We have four Company Codes with single Chart of Accounts. we required to make GRN Document Date / Posting Date Field Mandatory or freeze on current date for only one Company Code. Can it be possible through Standard Configuration?
    Regards,
    Majid Khan

    what exactly we say Document Date & Posting Date
    Just type in google difference between document date and posting date  and execute.  You will find lot of threads discussed on this topic.  Please dont post any query without searching the forum or google.
    G. Lakshmipathi

  • ODP OracleCommandBuilder. Updating a table including DATE columns.

    Hi
    I have a problem with the OracleCommandBuilder not creating the correct update commands when I have DATE type columns in the table.
    I have created a test table (called DATETEST) with three columns:
    STRINGCOLUMN     VARCHAR2 10
    DATECOLUMN DATE
    NUMBERCOLUMN     NUMBER
    The STRINGCOLUMN is the primary key.
    Then I created a typed dataset that looks like this:
    STRINGCOLUMN     string
    DATECOLUMN string
    NUMBERCOLUMN     long
    This is the XML schema for the typed dataset:
    <?xml version="1.0" encoding="utf-8" ?>
    <xs:schema id="DateDS" targetNamespace="http://tempuri.org/DateDS.xsd" elementFormDefault="qualified" attributeFormDefault="qualified" xmlns="http://tempuri.org/DateDS.xsd" xmlns:mstns="http://tempuri.org/DateDS.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
         <xs:element name="DateDS" msdata:IsDataSet="true">
              <xs:complexType>
                   <xs:choice maxOccurs="unbounded">
                        <xs:element name="DATETEST">
                             <xs:complexType>
                                  <xs:sequence>
                                       <xs:element name="DATECOLUMN" type="xs:string" minOccurs="0" />
                                       <xs:element name="STRINGCOLUMN" type="xs:string" minOccurs="0" />
                                       <xs:element name="NUMBERCOLUMN" type="xs:long" minOccurs="0" />
                                  </xs:sequence>
                             </xs:complexType>
                        </xs:element>
                   </xs:choice>
              </xs:complexType>
         </xs:element>
    </xs:schema>
    And this is the test code:
    Dim connection As Oracle.DataAccess.Client.OracleConnection
    Dim adapter As New Oracle.DataAccess.Client.OracleDataAdapter()
    Dim dbCommand As New Oracle.DataAccess.Client.OracleCommand()
    Dim sqlstring As String
    Dim data As New DateDS() 'Typed dataset
    Const ConnectionString As String = "User Id=............."
    Try
    'Connect to database
    connection = New OracleConnection(ConnectionString)
    connection.Open()
    'Get data from table DATETEST
    dbCommand.CommandText = "SELECT STRINGCOLUMN, TO_CHAR(DATECOLUMN) AS DATECOLUMN, NUMBERCOLUMN FROM DATETEST"
    dbCommand.Connection = connection
    adapter.SelectCommand = dbCommand
    adapter.Fill(data, "DATETEST")
    'Make changes to dataset
    data.DATETEST(0).DATECOLUMN = Now()
    data.DATETEST(0).NUMBERCOLUMN = data.DATETEST(0).NUMBERCOLUMN + 1
    'Update database
    sqlstring = "SELECT * FROM DATETEST"
    adapter.SelectCommand = New OracleCommand(sqlstring, connection)
    Dim custCB As New Oracle.DataAccess.Client.OracleCommandBuilder()
    custCB.DataAdapter = adapter
    adapter.Update(data, "DATETEST")
    'Disconnect
    connection.Close()
    connection.Dispose()
    Catch exc As Exception
    MessageBox.Show(exc.Message)
    End Try
    Getting the data from the database is not a problem.
    The dataset contains the correct information.
    But updating the database is impossible.
    I get errors like:
    ORA-01861: literal does not match format string
    And if I don't specify a DATE format in the TO_CHAR statement I get this error:
    Concurrency violation: the UpdateCommand affected 0 records.
    I think I've tried everything.
    I've used the OracleGlobalization class, with the SetSessionInfo method.
    I've tried all different types of date conversions to make sure that
    the date format on the database is the same as in the dataset.
    I've tried to change the NLS parameters on the DB server and in the registry on the client.
    I've tried to change the DATECOLUMN type in the typed dataset from string to Oracle.DataAccess.Types.OracleDate
    But it still doesn't work.
    The default date format on the DB 9i server is AMERICAN,(DD-MON-RR).
    A strange thing is that when I instead of using the ODP classes use
    the System.Data.OracleClient and its OracleCommandBuilder
    the code works perfectly without any errors.
    This is the test code that works:
    Dim connection As System.Data.OracleClient.OracleConnection
    Dim adapter As New System.Data.OracleClient.OracleDataAdapter()
    Dim dbCommand As New System.Data.OracleClient.OracleCommand()
    Dim data As New DateDS()
    Dim sqlstring As String
    Const ConnectionString As String = "User Id=......."
    Try
    'Connect to database
    connection = New System.Data.OracleClient.OracleConnection(ConnectionString)
    connection.Open()
    'Get data from table DATETEST
    dbCommand.CommandText = "SELECT STRINGCOLUMN, TO_CHAR(DATECOLUMN,'YYYY-MM-DD HH24:MI:SS') AS DATECOLUMN, NUMBERCOLUMN FROM DATETEST"
    dbCommand.Connection = connection
    adapter.SelectCommand = dbCommand
    adapter.Fill(data, "DATETEST")
    'Make changes to dataset
    data.DATETEST(0).DATECOLUMN = Now()
    data.DATETEST(0).NUMBERCOLUMN = data.DATETEST(0).NUMBERCOLUMN + 1
    'Update database
    sqlstring = "SELECT * FROM DATETEST"
    adapter.SelectCommand = New System.Data.OracleClient.OracleCommand(sqlstring, connection)
    Dim custCB As New System.Data.OracleClient.OracleCommandBuilder()
    custCB.DataAdapter = adapter
    adapter.Update(data, "DATETEST")
    'Disconnect
    connection.Close()
    connection.Dispose()
    Catch exc As Exception
    MessageBox.Show(exc.Message)
    End Try
    My experience until this came up is that the ODP provider is better on everything
    than the microsoft Oracle provider so I don't want to switch unless I have to.
    Could someone that have used the ODP OracleCommandBuilder for updating a table including DATE columns with a typed dataset please give me some tips on how to make this work?
    I would be the happiest man on earth if someone had a solution :-)
    Erik

    Don't convert the dates to strings. Ever.
    The command builder uses the metadata returned from the select command to build the insert/update commands. Using to_char in the query tells ODP that that is a varchar2 column. If you omit the to_char the commandBuilder will know to bind a date parameter in that spot.
    Also in your typed dataset you should change the type from a string to a date.
    David

  • Regarding dates(posting key ,clearing key ,key due ,base line)

    HI Friends,
    I am new to bi,could you please can any one explain me significance of the below dates .
    1) Posting key date
    2)clearing key date
    3)key due date
    4)base line date
    5)key date for due date
    Above date regarding FI-AP Report.
    Thanks in advance,
    Vas.

    1) posting date: the date, when a FI-position is posted (booked). (to differentiate with create date = the date when a FI-document is created)
    2) clear date: the date, when a position is payed (cleared) from Vendor (Supplier)
    3) due date: the date, when the position has to be payed (payment date)
    4) baseline date is more a self-defined date (company depending), where the company has a basis to calculate some cindition like the trade discount or due date... Ask your FI-Colleagues for more details.
    5) key date: It is more a input field when you execute a query. Based on this input field you can make a calculation or comparision (with certain requirements/conditions).
    For example: a FI-position is still open when the posting key date <= posting date. The position is cleared when clear key date > clear date and posting key_date < posting date.
    Another example: a FI-position is overdue when a key date for due date > due date and a posting key date > posting date.

  • How to correctProcess Order confirmation data posted in the previous month

    Hi All PP Gurus,
    Can anybody tell me the answer of following
    How we can correct the process order confirmation data posted in the previous month.

    Dear Ashok/Brahmankar,
    Actually i am facing the following problem:-
    1) If you cancel the confirmation done in the previous month by the tcode CORS, the CO document is posted in the previous period because we cannot change the posting date in CORS. But the previous period is already closed.
    Can we change the posting date in CORS manually? Or do you have any other idea? 
    2) When reading the master data in COR2, I face the error because the status of PO is already set as 'DLV'.
    Do we need to read the master data even when the value is changed in KP26?
    Thanks,
    Narayan

  • Grabbing xml from raw data post to my webserver

    Trying to figure out how to catch xml being posted to my webserver. The client's instructions are:
    The HTTP and HTTPS delivery method performs a text/plain mime binary data post to the supplier's webserver. Suppliers must develop a catch web page. This page will receive the binary post.
    This is an xml document that I must capture and write to disk. I'm intending to use a java servlet to grab this data but java is new to me. It looks like HttpServletRequest is what I'm looking for. Anyone with any pointers?
    thanks,
    destin

    Okay, I've got some coding off a site that looks like it will do what I want. It's quite a robust applications which will do more than I need but as long as it does at least what I want, i could care less. As it will extract files from the datastream for me, it is going to save them to disk.
    I believe I have to specify a directory to save it to. I believe this is the line I'm going to modify, so assuming that's the case, how do I specify a directory here:
    private File fileOutPutDirectory = null;
    Do I have to use absolute paths or can I use relative. Also, what directory construct is expected by java? Anyone with an example of what urls are supposed to look like in this case?
    Thanks,
    destin

  • 3.1EA2 simple table copy including data - gives error

    hi
    3.1EA2 simple table copy including data - results in error-message "Ora-01403 data not found Ora-06512 line 1 ....."
    ..... copy failed
    although the copy did succeed and the table including data was copied.
    regards Karsten

    Hi Brian,
    3.1EA2 shows a little bit improvement on the copy paste from grid.
    However, these are another cases which I found :
    1. This happens everytime
    -invoke any select
    select sysdate
    from dual;
    - leave the cursor position on after semicolon
    - copy and paste the grid result, unto worksheet, so it will become like this
    select sysdate
    from dual;17-NOV-2011 10:42:29
    - now, again copy the grid result using (ctrl + C)
    - the selection on grid suddenly loose its focus (the yellow rectangle is disappear), instead the cursor on SQL worksheet makes selection.
    - therefore the clipboard does not store the grid value
    2. Intermittently, usually happens on the third attempts
    - invoke any select
    - copy and paste any cell into worksheet, press Enter
    - copy and paste different cell into worksheet, press Enter
    - copy and paste another different cel into worksheet, press Enter
    - you'll notice the copy does not copy the correct value
    - the workaround for this problem is to press Ctrl + C several times on the cell before pasting.
    Regards,
    Buntoro

  • I need a purchase history that includes date purchased. Is there any way to get this information?

    I need a purchase history that includes date purchased. Does this exist, and how do I get it?

    Look at your purchase history: Store>View My Account

  • Lookup Characteristic on IP data post (FUNDS_CTR- COMP_CODE)

    Hello.
    In my case, funds centers belong to appropriate company code, say
    FUNDS_CTR1,  FUNDS_CTR2, FUNDS_CTR3 belong to COMP_CODE1
    FUNDS_CTR4,  FUNDS_CTR5, FUNDS_CTR6 belong to COMP_CODE2
    FUNDS_CTR10,  FUNDS_CTR11 belong to COMP_CODE3
    etc.
    I got IP-enabled InfoProvider with 0COMP_CODE and 0FUNDS_CTR. I've created aggregation level on 0FUNDS_CTR. Is it possible to create lookup mechanizm (by ABAP or some type of hierarchy or whatever) to get comp. code by funds center on data post to the InfoProvider? Back to the example:
    Then user chooses FUNDS_CTR4 I post this value with COMP_CODE2 value
    Then user chooses FUNDS_CTR11 I post this value with COMP_CODE3 value
    etc.
    thanx in advance,
    points will be awarded

    Hi Gediminas,
    please check the follwing link:
    http://help.sap.com/saphelp_nw70/helpdata/en/43/1c3d0f31b70701e10000000a422035/frameset.htm
    Please search in this forum as well for characterist relationships. You will find useful information about this topic.
    Regards Matthias Nutt
    SAP Consulting Switzerland

  • Include data type cluster

    Hello,
    I have a cluster typedef, which has a multicolumn listbox, and two boolean variables. I need a reference of it, but wit the data type included. On the front panel, when I create the reference and drag and drop the typedef into it, the reference will not include the data type. The "Include data type" item by right clicking on the reference, is not active, so I can´t coose it. Why?
    It is a non stricit typedef, I use LV2010.

    ... I've got it! The boolean should not have a latch mechanical action.
    thanks to me :-D

  • If i restrict #Not included in Global Filters what will do exactly

    Hi
    If i restrict #Not included in Global Filters what will do exactly
    Regards
    ramu

    Hi ,
    In the Global filters if you are exulding #, then your every keyfigure will be restricted by that . That mean you will not see any record for the infoobject with # value in it .
    You can also imagine, that if you restrict all the keyfigures in the report by exculding #, it will be same as above .
    Hope the above reply was helpful.
    Thanks & Regards,
    Ashutosh Singh

Maybe you are looking for

  • Jinit not loading webutil jar files

    Hello, Our Application Server has had webutil installed on it for quiet some time now. I am implementing a custom Banner Form that requires webutil functionality. Well the form is all set, but the webutil portion does not function correctly. I have b

  • Fear and Loathing in 9.0.2.25 Backup Land

    After resisting the urge to take a bat to my case, I did some forum browsing and discovered that I made a serious error in judgement by assuming iTunes "backup library to disc" function worked. Short'n long of it, I made it through 13 out of 22 dvd's

  • HT6001 11.1.4 installing, brokens?  help

    11.1.4 installing itunes brokens...?

  • Why does Adobe Premiere CC lockup on the launch?

    Why does Adobe Premiere CC lockup on the launch?

  • Is it the RAM or my computer?

    I have read all the posts since Oct 19 2005 related to installing third party RAM in the 1.67 GHz double layer high resolution display PB and have not seen this problem discussed. I bought the PB with 512MB of factory RAM in the lower slot at the end