Query ref. Sales Revenues v Delivered Costs of these

Hi Experts
I picked up on the following SQL Query in answer to another users requirements.
SELECT Distinct T0.DocNum 'Invoice#', T0.DocDate, T0.DocDueDate,
T0.GrosProfit, T1.ItemCode, T1.Quantity, T1.Price, T3.DocNum 'Delivery#'
FROM OINV T0 INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry
inner join DLN1 T2 on t0.docentry = t2.trgetentry
inner join ODLN T3 on t3.docentry = t2.docentry
WHERE DateDiff(MM,T0.DocDate, GetDate())=1
Is it possible to modify this SQL so as to :
1. Be able to determine what the "Delivered Cost" (as per per the Jnl linked to the Delivery Docket' ) of the Sales Invoice was.
2. Change date criteria so as to show only Sales Invoice posted between x and y dates?
Any help would be much appreciated
Derek

Hi Rahul
It's ok - I must have missed part of SQL when I cut and pasted from email instead of directly from your SAP reply.
From what I can see, your SQL is taking the Purchase Price from the GP icon on the Sales Invoice.
However, the Delivered Cost (ie. the journal created on delivery) is working through Stocks on FIFO basis.
Therefore getting different answer.
Is there any way of picking up the Delivered Cost in this SQL?
Thanks for your help to date.
Derek

Similar Messages

  • Compare with my cost of goods sold account to my sales revenue account

    Hi,
    i want to compare with my cost of goods sold account to my sales revenue account.
    After PGI my COGS a/c will be debited INVENTORY a/c will be credited so after sales my SALES a/c credit & customer a/c debit . I want to see what is the difference value of COGS a/c with respective billing Sales A/C
    No doudt we can see in Profit of margin in billing doc. It is quite impossible to see all document in respective wise. Please give a solution for which i can know what is profit of margin with comparing values in both of Account.
    Thank's
    Abhay

    Hi,
    This is possible through CO-PA report. You can get the result per sales order.
    Also the same can be achieved in FI as follows:
    Outbound delivery document thr" VL01N is captured in "Reference field" of FI doc (BKPF-XBLNR) generated through delivery.
    If the settings are done by SD person to capture the outbound delivery no. in "Reference field" of FI doc generated through Billing document (VF01), then there will be a common field to compare the documents in both accounts.
    In transaction FAGLL03, select the account COGS & Sales revenue account. Once the report displays, sort or take sub total on this common field "Reference".
    This will give you difference between COGS & Sales revenue per document.
    Hope this resolves your query.
    Regards,
    Ashutosh

  • Difference between cost of sales & sales revenue

    What is the difference between cost of sales & sales revenue ?
    Does it get stored in SD cubes or GL cubes ?
    Regards

    Sales Revenue is the total sales amount. Cost of Sales, also referred to as Cost of Goods Sol, are the costs associated with building product (e.g. raw materials,  labour, etc in the case of a manufacturer).
    These figures are going to be in the General Ledger, or some companies do this in Profit Center Accounting (PCA).

  • Assigning Sales Revenue cost element to various Profit centres

    Hi
    I have one controlling area and three company codes assigned to it. 
    I have around seven profit centres under each company code.
    How can I assign the sales account (revenue cost element) to different profit centres.  No cost centre assignment will be given in the posting. 
    I am unable to find a solutions to this.  Kindly offer your views on how can we assign the same sales revenue element to different profit centres under various company codes.
    Regards

    check this path'
    Controlling>Profitcentre accounting>Assignment of account assignment object to prfit centre>assign cost object
    Define the cost element in it
    Edited by: shibu john on Oct 28, 2008 12:31 PM

  • ABAP QUERY REPORT on Sales Revenue.

    Dear SAP Experts!
    Can anyone tell me the step by step procedure to create the new additional feilds in Sq02 extras , The Feilds and the Code for the following report.
    I am working on the Total Sales Revenue.
    Tables Used :BSID BSAD
    I want to Show a the difference of the Credit-debit amount (BSID-WRBTR) in a user defined feild.
    Please tell me the step by step proceudre for entering the new feilds from extras in SQ02 and what code to be written.
    regards,
    A  S

    Dear GSL,
    I have Done as Stated.
    In the extras I have taken BSID-WBRTR as the name of the New Feild as BAL.
    Now I have Defined in the code as follows:
    bal= bsid-wrbtr - bsad-wrbtr.
    The error is as follows.
    Field "BAL" is unknown. It is neither in one of the specified tables
    nor defined by a "DATA" statement . . . . . . . . . .
    Please suggest what is to be done.
    How to get the following
    BSID-wbrtr (Credit entries) - BSID-wbrtr (Debit entries).
    regards,
    A S

  • Revenue Planning to cost elements

    Hi,
    I am Working on Project system object.
    When i am trying  planned revenue is added on the project, I need to find if there is a way to assign the revenue amount on the lowest WBS to a cost element. This is required for revenue amounts to appear in costing reports. CJ42 is used to add planned revenue manually.

    hi anuradha,
    Revenue Planning
    Use
    Revenue planning can be necessary when you perform results analysis on a sales order item and use a results analysis method that uses the planned revenues to calculate the results analysis data.
    Features
    The net value (revenue) for sales-order-related production is determined in pricing in Sales and Distribution (SD). Pricing depends on specific conditions which you maintain in Sales and Distribution.
    A particular customer orders a particular quantity of a product on a particular day. The variable factors – customer, product, quantity ordered, date – determine the final price for the customer.
    The system uses the conditions you specified to calculate the gross price at which the customer is invoiced; any discounts applying to the customer, for example; and other values such as freight charges and tax.
    Pricing is controlled by a pricing procedure which is selected through the sales document type. Price elements such as prices, surcharges and discounts, freight costs and taxes are saved in Sales and Distribution as condition types. The pricing procedure determines which condition types are used and the sequence in which they are calculated in the sales order.
    Condition Types
    The standard system contains the following condition types that can be used in connection with unit costing, product costing, and preliminary order costing in assembly processing:
    Condition Types for Pricing
    Condition Type
    Meaning
    EK01
    Cost of goods manufactured (CGM)
    EK02
    CGM (statistical)
    EK03
    Fixed CGM (statistical)
    Condition type EK01 is mainly used for cost-plus contracts in which the sales price depends on the expected costs.
    Condition type EK02 is mainly used when the sales price is a market price and the expected costs are only used for informational purposes.
    Condition type EK03 offers the capability of transferring the fixed costs of a cost estimate into the conditions.
    The costs are transferred from the cost component view Cost of goods sold into the condition type.
    The above-mentioned condition types must be of category Q. Whether a condition type of category Q is only used in pricing as a statistical value or for price calculation is controlled in the pricing procedure.
    The condition type is created in Customizing for Sales.
    The condition type can be selected as follows:
    Through the sales document type
    Condition types EK01 and EK02 are specified in the CndTypLineItems field in the sales document type.
    Through the requirements class
    This enables you to define different condition types for different sales document items of a sales document.
    Condition types EK01 or EK02 are specified in the CndTypLineItems field in the requirements class.
    Condition type EK03 is specified in the CondTypLinItFix field. You can only use condition type EK03 in conjunction with the requirements class.
    Planned Revenues
    Revenue elements from the SD pricing procedure that are not statistical are updated as planned revenue on the sales order item that carries costs and revenues, and can be viewed in the Product Cost Controlling Information System. Sales deductions can also be assigned to revenue elements through account determination, and updated on the CO object for the sales order item.
    The condition type is selected through the sales document type.
    Condition type EK01 is selected for sales document type TA (standard order). This means that the value from the cost estimate goes directly into pricing. A surcharge is calculated from this value and the net value for the sales order item is calculated.
    Condition type EK02 is selected for sales document type TA (standard order). Pricing is carried out on the basis of condition type PR00. To maintain this price, choose Logistics ® Sales/distribution ® Sales ® Master data ® Prices ® Material prices and enter a material price. The material price is updated under condition type PR00, while the values from the cost estimate are updated under condition type EK02 and can be used for informational purposes.
    Actual Revenue in Product Cost by Sales Order
    Use
    In Product Cost by Sales Order, actual revenues are updated to the sales order item that carries costs and revenues at the time of invoicing.
    Integration
    You can view the actual revenues in comparison with the planned revenues and costs in the Product Cost Controlling Information System at any time.
    You can settle the costs and revenues that are updated to the sales order item to a profitability segment in Profitability Analysis (CO-PA) during period-end closing for Product Cost by Sales Order. When you perform results analysis, the results analysis data are settled to CO-PA.
    The processing in Product Cost by Sales Order therefore differs from the processing in Product Cost by Order or Product Cost by Period (make-to-stock production and with a valuated sales order stock without a sales order item that carries costs and revenues).
    If you perform this type of product cost controlling (such as in addition to Product Cost by Sales Order), then in Product Cost by Order or Product Cost by Period the revenues from invoicing are transferred to CO-PA.
    If you are using the cost-of-sales accounting in Financial Accounting (FI) and are using a valuated sales order stock, you do not need to perform results analysis in order to transfer the cost of sales to FI. The cost of sales is transferred to Financial Accounting at the point of the goods issue posting.
    Prerequisites
    To ensure that the revenues are displayed on the sales order item, you must create revenue accounts and possibly sales deduction accounts as primary cost elements of cost element type 11 (revenues) or 12 (sales deductions). Make the necessary settings in Customizing under Controlling ® Overhead Cost Controlling ® Cost and Revenue Element Accounting ® Master data ® Cost Elements.
    To be able to settle the costs to Profitability Analysis, you must make the necessary settings in Customizing for Profitability Analysis. Make the necessary settings in Customizing under Controlling ® Profitability Analysis.
    Features
    Billing
    Billing invoices the customer for the goods and services delivered for a sales order.
    In Sales and Distribution, you create an invoice (billing document) on the basis of a reference document. In order-related billing, the reference document is the standard order or the delivery document with delivery-related billing.
    The data such as prices and quantities are transferred from the previous documents into the billing documents. The price can be calculated in the following ways:
    Using pricing on the basis of conditions (such as material or customer)
    On the basis of the incurred costs if you want to use resource-related billing
    When you enter a billing document, the system proposes a billing type depending on the reference document.
    The billing type determines the following:
    Which pricing procedure is used for account determination for Financial Accounting
    Whether the invoices are passed immediately to Financial Accounting
    Account assignment is controlled by the following parameters:
    The chart of accounts
    The sales organization
    The account assignment group of the customer (in the Account group field in the Invoicing screen of the customer master record)
    The account assignment group of the material (in the Account assignment group field in the Sales 2 view of the material master record)
    The account key in the pricing procedure
    thanks
    karthik
    <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Apr 15, 2008 3:10 PM

  • Sales Order Report Showing Cost on the Sales Order & total invoice dollars

    I am looking for a report in SAP that shows you the Sales Order number, the cost on the sales order (NOT the average cost) the actual cost on the sales order detail line and then the total invoice dollars in month to date and year to date?
    Thanks,
    Linda

    You can use <b>T.code: COOIS </b> if Product Costing has been configured for MTO scenario whcih gives the costing details.
    You can also use To.code: <b>KE30</b> if CO-PA implemented.
    but if you want to link with billing, Please search for any reports in Sales information system.
    One more you can create a ABAP Query Report using T.code: <b>SQVI</b>
    Regards,
    Anbu

  • Sales Order - order reason - cost element error in PO creation

    Good day Friends,
    We have a third party order scenario in our group among different company codes (FI-SD).   This scenario is working fine among the existing companies.
    Now there is a requirement from finance department to capture the revenues at different cost centers based on the order reason selected in the sales order.
    When order reason is mentioned in the sales order the system is giving error at the time of purchase order creation as u201CCreate account 123456 for 16.05.2010 as a cost element in controlling area INTu201D
    Where as if the sales order is created without order reason there is no problem in purchase order creation.
    Here the account 123456 cannot be created as cost element because it will stop the other existing processes in this controlling area.
    Thanks

    I can tell you why it's occurring and maybe give you a few suggestions on what to do.  The G/L account assignment for the third party sales process is determined based on the account key/modifier assigned to the transaction and the valuation class assigned to the material.  In this case, the account key/modifier is determined based on the account assignment category assigned to the purchased order (in the standard system the account assignment category is X for third party processing and the account modifier is VAX).  You would find the G/L account based on the combination of the account key = GBB, account modifier and valuation class using t-code (OBYC). 
    Saying all that, currently that combination is finding a G/L account that is not setup as a cost element (probably your cost of goods sold  account) and that's normal for these types of posting.  You can only make postings to cost centers for accounts that are setup as cost elements, so currently the system will not let make a posting to a cost center. 
    So if you want this transaction to post to a cost center, but don't want to create a cost element for this account, then you must use a different G/L account for these postings.  The simplest options would be to either change the account modifier assigned to the account assignment category or assign a different valuation class to these materials.  Once you've change one of those you can now assign a different G/L account to that combination in OBYC and create that account as a cost element.
    thanks,

  • Create sales revenue account in SAP R/3

    Hi there,
                I need to find the path for creating "sales revenue account" and "sales revenue deductions account" in SAP R/3
    I will appreciate suggestions for the same.
    Thanks
    Nishant

    Hi Nishant,
    The SAP NetWeaver MDM forum is not appropriate for your R/3-based query.
    Better try the ERP Financials forum (SAP ERP Financials) instead.
    Regards,
    Markus

  • Profit center wise Sales revenue

    Hi ALl,
    I am creating a sales query in Bi 7.0
    This query should display sales KF (from 0SD_C03) against profit centre values.
    I have used 2lis_13_vditm for sales values which doesn't have profit center.
    What do you suggest would be the best way to bring profir center values?
    Thanks and regards,
    Sharmishtha

    Hi,
    If you want to use 2lis_13_vditm with 0SD_C03 cube and show Profit center wise Sales revenue then you need to enhance the DataSource and workout, else implement CO-PA.
    If you catch the Profit centre using some Key Fields in 2lis_13_vditm datasource then it is easy, so discuss with SD/FI-CO Cunsultants and decide.
    Thanks
    Reddy

  • Sales revenue sales office wise

    Dear Experts,
    My client requirement is to see sales revenue sales office office and cost centre wise, my client is  using third party sales scenario so i have configured Order reason & cost centre and assigned to sales area.
    My client will enter order reason while creating the sales order. but while making PO the Error is coming
    " NO Direct Posting can be made to G/L a/c. 400156 in code xyz.
    Your reply is highly appreciated,
    Thanks and Regards,
    MH

    Hi
    We are doing third party sales scenario. We have this in our group for other companies as well and it is woking fine in existing company codes. Now we have a scenario for new company where third party sales with order reason to be maintained in sales order in order to book the revenues to specific cost center.
    Now the prblem is when we are creating SO with order reason system is not allowng for creating PO for this and gives this error message. When we are creating the SO without order reason sys is allowing for creating PO without any error message.
    We cannot create this GL as cost element is Contolling area as other existing processes will be effected.
    Regards,
    MH

  • Other sales revenues

    Hi,
    Our company want to sell web product licence fee to our customer. I plan to create some service articles to handle the sales and billing process. However, the development cost of the product was manually inputed in a speical G/L (in FI module). That means the there are no direct cost during the sales processing (No COGS).
    In this case, I want to know how to reflect the development cost and the sales revenue for these web product in system? In FI module, how to know the profit and expenses for this special project?
    Anyone can give me advice?
    Thanks and regards,
    Chris

    Hi Chris,
    You can use Statistical Internal Orders to capture the revenue and the costs posted in FI. The Statistical Internal Order can be used for billing and similarly the Statistical Internal Order can be entered manually at the time of booking the costs.
    Profitability can be displayed using the internal Order reports in Controlling module.
    Regards
    Mahendra

  • [URGENT] Opportunity.wsdl - how to query the opportunity revenue?

    Hi All,
    I need to write a web services (opportunity.wsdl) to query the Item Revenue from the opportunity. How can be done? Refer the screenshot below,
    The code as below,
    Dim lstOfOppQuery As New ListOfOpportunityQuery
    Dim lstOfProdRevQuery As New ListOfProductRevenueQuery
    lstOfOppQuery.Opportunity = myOppQuery
    lstOfProdRevQuery.ProductRevenue = myProdRevQuery
    'Number of records to fetch
    lstOfOppQuery.pagesize = "100"
    lstOfProdRevQuery.pagesize = "100"
    'Set OpportunityQueryPage_Input
    Dim myOppInput As New OpportunityQueryPage_Input
    'Dim myOppInput1 As New reven
    myOppInput.ListOfOpportunity = lstOfOppQuery
    'myOppInput.ListOfOpportunity = lstOfProdRevQuery
    'Get the output
    Dim myOutput As OpportunityQueryPage_Output
    'Dim myOutput As
    myOutput = accntPrxy.OpportunityQueryPage(myOppInput)
    I able to query the opportunity data but failed to input and output the revenue, please help.
    Please have a guide. Thanks :)
    Edited by: 911468 on 09-Apr-2012 00:32

    This is how I query opportunity & product revenue:
    Opportunity prxySrvc = new Opportunity();
    OpportunityQueryPage_Input objQryParam = new OpportunityQueryPage_Input();
    OpportunityQueryPage_Output objQryOut = new OpportunityQueryPage_Output();
    ListOfOpportunityQuery ListOfOpptyQuery = new ListOfOpportunityQuery();
    OpportunityQuery myOpptyQuery = new OpportunityQuery();
    ListOfProductRevenueQuery ListOfProdRevQuery = new ListOfProductRevenueQuery();
    ProductRevenueQuery myProdRevQuery = new ProductRevenueQuery();
    (query values to return)
    myOpptyQuery.Id = query_field;
    myProdRevQuery.Id = query_field;
    ListOfProdRevQuery.ProductRevenue = myProdRevQuery;
    myOpptyQuery.ListOfProductRevenue = ListOfProdRevQuery;
    ListOfOpptyQuery.Opportunity = myOpptyQuery;
    objQryParam.ListOfOpportunity = ListOfOpptyQuery;
    prxySrvc.Url = mSession.GetURL();
    objQryOut = prxySrvc.OpportunityQueryPage(objQryParam);
    (output data)
    objQryOut.ListOfOpportunity.Opportunity[index].Id
    objQryOut.ListOfOpportunity.Opportunity[index].ListOfProductRevenue.ProductRevenue[childIndex].Id

  • Query for Sales Order Analysis

    Dear Experts
    I have written a Query for Sales Order Analysis and would like to have help on this.
    The query is used for generating daily report for Sales Order on number of documents (Sales Order), total amount of sales orders and total GP of Sales Order. The query is written as below:
    SELECT T0.[DocNum], SUM(T0.DocTotal) AS 'Total', SUM(T0.U_Total_GP) AS 'Total GP'
    FROM ORDR T0 WHERE T0.[DocDate] =[%0] GROUP BY T0.[DocNum] ORDER BY T0.[DocNum]
    where U_Total_GP is a UDF for storing the GP of each order.
    After executing the query, a selection criteria of date appears and after a date is selected, the report shown information required. However, the query does not calculate column total for total amount and total GP. Although I know the total for each column can be displayed by pressing "Ctrl" + Click on the column title, it would have to be done from time to time.
    Therefore, I would like to modify my query in order to calculate the column totals when executed. Are there any suggestions for this?
    Thank you
    Regards
    Elton

    Hi Elton,
    Try this:
    SELECT T0.[DocNum], SUM(T0.DocTotal) AS 'Total', SUM(T0.U_Total_GP) AS 'Total GP'
    FROM ORDR T0 WHERE T0.[DocDate] =[%0] GROUP BY T0.[DocNum]
    Union ALL
    SELECT '', SUM(T0.DocTotal) AS 'Total', SUM(T0.U_Total_GP) AS 'Total GP'
    FROM ORDR T0 WHERE T0.[DocDate] =[%0]
    ORDER BY T0.[DocNum]
    Thanks,
    Gordon

  • Infoset query of vendor payments at the cost distribution level

    We would like an infoset query of vendor payments at the cost distribution level of the document.  The issue seems to be joining vendor to the document cost distribution lines. 
    1.) BSAK + BSIK can be combined with an infoset data structure but only contain the vendor line of a document;  the cost distribution lines are not in the tables. 
    2.) BSIS + BSAS can be combined with an infoset data structure but lack vendor data and joins (to a vendor source) are not an option with data structures.  Vendor data added with an additional field is too slow to be a primary selection field. 
    3.) Logical data base KDF in an infoset returns only the vendor line of a document, not the cost distribution lines. 
    4.) Logical data base BRM in an infoset can have vendor from BSAK/BSIK attached by an additional field but performance is too slow to be useful.  Joins are not an option in a logical data base infoset.
    5.) Complete data is lacking when table joins between document cost distribution tables and vendor data tables are possible, (SPL actual line item table & BSIP or FMIFIIT & FMIFIHD).  BSIP lacks AB documents (reversals).  FM tables lack general ledger only documents. 
    6.) BSAK and BSIK together have complete vendor data but joins of both to a basis table do not work well.  Left outer joins are too slow, inner joins won’t work since the tables have mutually exclusive data. 
    It would be ideal to have vendor in BKPF, like FMIFIHD has, but it isn't a field.
    Does anyone know of any other options?  I have seen the helpful thread on How to Read BSEG Efficiently

    Hi,
    This is SAP Business one reporting and printing forum. Please find correct forum and repost above discussion to get quick response.
    Please close this thread here with helpful answer.
    Thanks & Regards,
    Nagarajan

Maybe you are looking for

  • Aggregate function not working correctly

    I have this data in a table SZSTCLA_PIDM     SZSTCLA_TERM_CODE       SZSTCLA_TERM_CODE_MATRIC     SZSTCLA_TOTAL_CREDITS 82724                        201010                                               201010                      4.50 82724          

  • Why does it zoom a site in or out, and how to I change it back?

    ''locking as a duplicate - https://support.mozilla.com/en-US/questions/816730'' ok, here is the thing. I have a Dell laptop, and i use firefox all the time. but recently had a problem, it will zoom out on a site, and wont go back! how do i get it bac

  • Popping sounds when transcoding wmv to flv with media encoder

    Whenever I use adobe media to transcode a wmv file created in windows media encoder to a flash file, I get pops  in the audio track (similar to hissing bacon). The pops only occur during the begining of the video, when it's quiet and go away once the

  • Importing data with characterstics/Merchandise hierarchy in SAP IS Retail

    Hi All, Im importing data into SAP IS Retail from MDM using ARTMAS04 message type using SAP XI. I have cetrain Merchandise hierarchy,Characterstics maintained in ECC as well as in MDM. The article category is "Generic Article". Im able to pass the va

  • Dropped Frames on MacPro, but not on G5

    Hi, I just upgraded to a MacPro 16 gig ram, & 1 TB 2nd drive. Also I have two FW800 drives I use for projects. I'm not capturing any video on the system drive. The problem is my video is not playing back smoothly and i get a dropped frames notice. Th