Interesting cases about variance analysis report

hi gurus,
I have problem like this, in t-code S_ALR_87013127 i can see variance calculation for each order. But, when i run t-code S_ALR_87013140 system told that no record exist. What is the possible reason for this case? It is confusing me. Because both report are standard SAP report, so it's impossible there is error in define report.
Maximum point will be given for those who help. thanks

Hi Yudha,
S_ALR_87013127 reads the same table for orders imputation.
S_ALR_87013140 reads tables fulfilled by KKRV, KKRC, KKRS (post process)
Kind regards

Similar Messages

  • How to read the Variance Analysis report S_ALR_87013139,  Pdt cost by Order

    Hi,
    Could someone tell me how to read the variance analysis report, S_ALR_87013139 - Cumulative for product cost by order. The report has the following fields, Target (Debits),     Actual (Debits),     Scrap,     Var. Without Scrap,     Work in Process(WIP),     Control Costs.
    I am looking to find how the numbers add up.
    Thanks for your help.
    Ram
    Message was edited by:
            Ram R

    Thanks Sridhar,
    When I analyse the report S_ALR_87013139 - Cumulative , for a product for a period (with no scrap), I get the following
    Target (Deb) -   46,855.55
    Act (Deb) - 58,315.87
    Scrap - 0.00
    Var W/O- Scrap -  11,269
    WIP- 0
    Control Cost - 0
    Here Actual - Target is not equal to Variance. What could be the issue?
    Could you please tell me how SAP would update this report  with target & actual costs with respect to open production orders, carried over from previous periods.
    Thanks,
    Ram

  • Variance Analysis Report

    Hi
    The users wants a Variance analysis report in such a way say there a is variance from target to acutal by cost elements detail of from where that variance come from other than from general variances categories.
    Say for ex: if it is a input quantity variance of 10, they want a report showing from were that variance come from, in more detail. They don't want to go to every order at month end to look and analyse every single PO to see why the variances, is it feasible in SAP?
    Thank you,
    Nivi

    These reports run on summarized values. Please run KKRV for summarization by plant for the given periods.

  • FDM 9312 Variance Analysis report and columns 1 off in xls

    Hi,
    I have a variance analysis report in FDM and when i run in HTML and PDF, all the columns are aligned/formatted fine. But when i run it in xls, the columns are one off. Has anyone seen this before or experienced this.
    Thanks,
    Azmat Bhatti

    This is due to formatting within Excel. You can try to adjust the report via the report designer in the workbench. It may not be possible to run the report in Excel with the formatting you are expecting.

  • Summarized Analysis - Variance Analysis report Problem

    Hi Guru's
    When Executing the Report "S_ALR_87013139 " of Order Variance analysis - Sumarization Report we are not able to fetch any data for the current year.
    But when we are checking for 2008 we are able to fetch some data but with wrong values
    We wanted to know whether any additional configuration has to be done to fetch that data
    Your help will be greatly appreicated
    << Moderator message - Please do not promise points >>
    thanks in advance
    Best Regards,
    Ravi Reddy
    Edited by: Rob Burbank on Dec 15, 2010 5:05 PM

    Hi Christian
    Thanks for your reply i have one more doubt regarding the report " 7-KA2-K-P1" to modify that report does it generate a Workbench Request or a Customizing request.
    I am asking this because as per my Clinets requirement i  need to add few more columns.
    Best Regards,
    Ravi Reddy

  • Variance analysis report doesnt have any values

    Hi Gurus,
    For following reports I am not getting any values .Is I am missing any configuration.My client needs to be resolved on top priority.
    S_ALR_87013139 - Target/Actual/Production Varainace - Cumulative
    S_ALR_87013140 - Target/Actual/Production Varainace - Periodic
    S_ALR_87013142 - Target/Actual Comparison - Cumulative
    S_ALR_87013143 - Target/Actual Comparison - Periodic
    S_ALR_87013145 - Plan/Actual Comparison - Cumulative
    S_ALR_87013146 - Plan/Actual Comparison - Periodic
    S_ALR_87013148- Variance Catergories Cumulative
    S_ALR_87013149- Variance Catergories Periodic
    Regards,
    Nitin Amritkar

    These reports run on summarized values. Please run KKRV for summarization by plant for the given periods.

  • Production variance analysis: reports

    Guys hi,
    can anyone tell me what standard reports are available to look at production variance?
    I have seen report 7kok for individual orders, are there other reports
    Do you know of a report that would allow to look at a group of orders
    I use to know of a transaction that takes me to where all these relevant reports, are located
    Thanks in advance for your time
    KR - Loï

    Hi
    Use KKO0 reports..
    Assign Cost Comp Structure in OKN0 and choose Prod Group = Material Group in OKN0
    Transport these settings across to all clients...
    Run KKRV to collect data and then run KKO0 reports
    Br, Ajay M

  • Standard SAP report for variance analysis of SD and MM

    Dear All,
    I want the standard SAP report for the vendors and customer varaiance analysis for the posting done in MM and SD with the GL balance in FI .It should be same as the report we get from the transaction code MB5L.
    Thanks in advance
    Meruta

    HI,
    The 1AB library contains reports for variance analyses. This is an important report for Cost Center Accounting (CO-OM-CCA) supplied in the SAP R/3 System. Additional information for  report can be found in the documentation for the reports. Choose Extras->Documentation from the report itself.
    Hope I had been able to help you out. Please assign points.
    Rgds
    Manish

  • Sales Analysis Report per Sales Employee with BP Reference No

    Hi All,
    I need your assistance in creating a query that balances back to Sales Analysis Report but I require the BP Reference No to show per row.  I have created 2 queries through Query Generator.  The 1st contains the OINV and OSLP tables with Fields:  DocNum, NumAtCard, SlpName, DocDate, CardCode, CardName, DocTotal
    The 2nd contains the ORIN and OSLP tables withe the same Fields.
    I need to combine these 2 queries and I need assistance with the DocTotal.  I need the amount before tax.
    This report needs to balance back to the SAP B1 Sales Analysis Report.
    Your assistance would be appreciated.
    Regards,
    Desiré Janse van Rensburg

    Thank you for your assistance!  After googling a few pages I came across this query.  I adjusted it to comply to my needs.
    Herewith query if you guys are interested:
    SELECT
    T0.DocNum AS 'Invoice Nr',
    T0.NumAtCard AS 'Customer Ref Nr',
    T1.SlpName AS 'Salesperson',
    --T0.SlpCode AS 'SP Code',
    T0.DocDate AS 'Posting Date',
    T0.CardCode AS 'Customer Code',
    T0.CardName AS 'CustomerName',
    'Credit Memos' AS 'Doc Type',
    ((T0.DocTotal) * -1) AS 'Total Docs',
    (((T0.DocTotal - T0.VatSum) - T0.TotalExpns) * -1) AS 'Product Sales',
    ((T0.GrosProfit) * -1) AS 'Gross Profit',
    CASE
    WHEN (((T0.DocTotal - T0.VatSum) - T0.TotalExpns) * -1) = 0.00 THEN 0.00
    ELSE (((T0.GrosProfit) * -1)/(((T0.DocTotal - T0.VatSum) - T0.TotalExpns) * -1)) * 100
    END AS 'Gross Profit %',
    ((T0.PaidToDate) * -1) AS 'Paid To Date',
    ((T0.DocTotal - T0.PaidToDate) *-1) AS 'Open on Docs'
    FROM ORIN T0
    INNER JOIN OSLP T1
    ON T0.SlpCode = T1.SlpCode
    WHERE
    (T1.SlpName LIKE '%%[%0]%%' OR '[%0]' = ' ')
    AND T0.TaxDate >= '[%1]'
    AND T0.TaxDate <= '[%2]'
    UNION
    SELECT
    T0.DocNum AS 'Invoice Nr',
    T0.NumAtCard AS 'Customer Ref Nr',
    T1.SlpName AS 'Salesperson',
    --T0.SlpCode AS 'SP Code',
    T0.DocDate AS 'Posting Date',
    T0.CardCode AS 'Customer Code',
    T0.CardName AS 'CustomerName',
    'Invoices' AS 'Doc Type',
    (T0.DocTotal) AS 'Total Docs',
    ((T0.DocTotal - T0.VatSum) - T0.TotalExpns) AS 'Product Sales',
    (T0.GrosProfit) AS 'Gross Profit',
    CASE
    WHEN (((T0.DocTotal - T0.VatSum) - T0.TotalExpns)) = 0.00 THEN 0.00
    ELSE ((T0.GrosProfit)/((T0.DocTotal - T0.VatSum) - T0.TotalExpns)) * 100
    END AS 'Gross Profit %',
    (T0.PaidToDate) AS 'Paid To Date',
    (T0.DocTotal - T0.PaidToDate) AS 'Open on Docs'
    FROM OINV T0
    INNER JOIN OSLP T1
    ON T0.SlpCode = T1.SlpCode
    WHERE
    (T1.SlpName LIKE '%%[%0]%%' OR '[%0]' = ' ')
    AND T0.TaxDate >= '[%1]'
    AND T0.TaxDate <= '[%2]'
    Thanks again for the replies!

  • IMAQ Particle Analysis Reports VI

    Hello,
    I have written a programme that can take an image, resize it, theshold it and generate an array of particle locations using the IMAQ particle analysis VI. The programme works fine but I was wondering if anyone can answer some questions I have regarding some of the details of how this VI works:
    How does the IMAQ Particle Analysis Reports VI calculate the centre of mass of the particles? Naively I would assume it would be the same as the IMAQ Centroid VI which uses the formula x=Sum(x*PixelValue)/Sum(PixelValue), y=Sum(y*PixelValue)/Sum(PixelValue), however in this case it finds the centre of mass of the entire image and not of the individual particles. Does it therefore apply these formulas to automated regions of interest to generate the list of centroided coodinates for each particle or does it use an altogether different method?
    Is this the fastest and most computationally efficient way to generate these list of centroided coodinates given that it also calculates several other parameters that I do not need?
    Thanks so much! Any help would be greatly appreciated!
    Justin     

    Hi Justin,
    I haven't been able to obtain the formula / algorithm that the VI uses but I found that the particle analysis example in CVI offers some insight into what the function is performing. I've copied the C code for your convience but I found it on this white paper http://www.ni.com/example/26517/en/  - 
    Particle Analysis Examples. 
    int CVICALLBACK ParticleAnalysis (int panel, int control, int event,
    void *callbackData, int eventData1, int eventData2)
    switch (event)
    case EVENT_COMMIT:
    /* Make sure the user has thresholded the image */
    if(!thresholdFlag) {
    MessagePopup ("Image must be thresholded",
    "You must threshold an image before performing the particle analysis.");
    return 0;
    /* This section of our code shows how to run a basic particle analysis.
    imaqGetParticleInfo is used with the parameter IMAQ_BASIC_INFO to get
    basic information on each particle in the image. It returns a pointer
    to a structure array which contains all of the information for each
    particle. Passing IMAQ_ALL_INFO instead of IMAQ_BASIC_INFO will run
    a more detailed report on the particles, but will take longer to execute.
    For more information on the report structure, see vision.h or the function
    panel for imaqGetParticleInfo. */
    /* Reset the max value for the control to (2^32)-1 so that consecutive runs
    are not limited by the number of objects found in previous runs */
    SetCtrlAttribute (panelHandle, PANEL_CURRENT_PARTICLE, ATTR_MAX_VALUE,
    4294967295);
    /* If we have already called imaqGetParticleInfo and thus created a particle report
    we should dispose that report before creating a new one. */
    if (particleRptExists)
    imaqDispose (particleRpt_Ptr);
    particleRpt_Ptr = imaqGetParticleInfo (thresholdImage, FALSE, IMAQ_BASIC_INFO, &particleCount);
    particleRptExists = TRUE;
    /* Simple user interface management - activate the particle report controls */
    SetCtrlAttribute (panelHandle, PANEL_PARTICLE_COUNT, ATTR_DIMMED,
    FALSE);
    SetCtrlAttribute (panelHandle, PANEL_CURRENT_PARTICLE, ATTR_DIMMED,
    FALSE);
    SetCtrlAttribute (panelHandle, PANEL_AREA, ATTR_DIMMED,
    FALSE);
    SetCtrlAttribute (panelHandle, PANEL_CAL_AREA, ATTR_DIMMED,
    FALSE);
    SetCtrlAttribute (panelHandle, PANEL_TOP, ATTR_DIMMED,
    FALSE);
    SetCtrlAttribute (panelHandle, PANEL_HEIGHT, ATTR_DIMMED,
    FALSE);
    SetCtrlAttribute (panelHandle, PANEL_LEFT, ATTR_DIMMED,
    FALSE);
    SetCtrlAttribute (panelHandle, PANEL_WIDTH, ATTR_DIMMED,
    FALSE);
    SetCtrlVal (panelHandle, PANEL_PARTICLE_COUNT, particleCount);
    /* Set the max value on the index control so that the user does
    not try to access particle info for particles that do not exist */
    SetCtrlAttribute (panelHandle, PANEL_CURRENT_PARTICLE, ATTR_MAX_VALUE,
    particleCount - 1);
    /* Simulate an event to immediately update report controls and reset the
    report index to zero */
    ViewReport (panelHandle, 0,EVENT_COMMIT,NULL,0,0);
    SetCtrlVal (panelHandle, PANEL_CURRENT_PARTICLE, 0);
    break;
    return 0;
    Kind Regards,
    Lucas
    Applications Engineer
    National Instruments

  • Standard stock analysis report

    Hi Experts,
    As per client requirement, needed stock analysis report based on following formula, Ratio of
    Stock at the end of month
    Avarage quantity issued per month during year
    if ratio is 5 to 10 then it slow moving material
    if ratio is 10 to 15 then it very slow moving material
    if ratio is 15 to remaining then it non moving material
    which standard reports will help in finding exact solution, please don't suggetst for Z-reports as needs to be done with standard's only.
    Thanks in advance...

    Dear,
    Have a look below as found...
    Formula
    Inventory Turnover = Cost of Goods Sold (COGS) / Average Inventory at value.
    If you are not familiar with the term Cost of Goods Sold, this is the cost of your revenues.
    Average Inventory is measured in value and not in volume.
    If you divide both elements you know how often you sold youu2019re average inventory.  u201CSo what?u201D you ask. I will explain next.
    Concept and use
    I will present you with two business scenariou2019s to point out the significance of the Inventory Turnover ratio.
    Scenario 1
    You sell one product. You invest 10.000 EUR as starting stock. You run your business for one year and at then end of the year you are completely sold out. Your revenue accumulates to 12.500 EUR.  For simplicity sake your gross profit is 2.500 EUR (12.500 - 10.000).
    Revenue = 12.500
    COGS = 10.000
    Average Inventory = 5.000 (10.000 starting stock + 0 end stock / 2 = 5.000 average stock)
    Inventory Turnover = 2
    ROI = 50% > 2.500 (R-C) earned out of 5.000 (A)
    Scenario 2
    Again you sell one product. But this time you invest 5.000 EUR in starting stock. After 6 months you sold your stock and you replenish your stock again for 5.000 EUR. After another 6 months youu2019re sold out. Your revenue is again 12.500 EUR. Your gross profit is 2.500 EUR (12.500 - 5000 - 5000).
    Revenue = 12.500
    COGS = 10.000
    Average Inventory = 2.500 (5.000 starting stock + 0 end stock / 2 = 2.500 average stock)
    Inventory Turnover = 4
    ROI = 100% > 2.500 (R-C) earned out of 2.500 (A)
    Conclusion
    Looking at the two scenarios the increased inventory turnover means increased operating efficiency: your ROI increased from 50% to 100%! Obviously you invested half the money in scenario 2 to achieve the same profits.
    This doesnu2019t mean businesses should try to achieve a maximum inventory turnover per se. Achievable ratios differ per material type (finished goods, semi or raw), but also per moving speed (ABC class). Last but not least the type of industry very much determines what ratio you can achieve: process industries typically have higher inventory turns than, say, heavy equipment manufacturers.
    You can find out what the industry standards are by purchasing metrics from data suppliers like Reuters or Gartner. This will give you an idea how well you are doing compared to your competitors. Or you can just use inventory turnover as an internal benchmark. In this case you periodically review the inventory turnover for different sets of materials and set targets that you wish to achieve.
    Inventory turnover is typically a financial measurement (see relation to ROI). In order to improve the ratio, close cooperation with procurement/production planning is required, since they directly influence the stock levels.
    Again, as with many KPIs and reports donu2019t judge based on this value alone, but use other stock controlling reports to minimize your inventory and still have a sound service level.
    Finally you can read an interesting business case on how inventory turns made Dell a leader in itu2019s business.
    Regards,
    Syed Hussain.
    Have a look at: http://www.kowboyz.nl/blog/mc44-inventory-turnover/
    Edited by: Syed Hussain on Jul 10, 2009 12:16 PM
    Edited by: Syed Hussain on Jul 10, 2009 12:18 PM

  • Sales Analysis Report service warehouse wise

    Dear Experts,
    I've configured 4 service warehouses to an item  in SAP B1 8.8 PL:16.  And now I want to see sales analysis report of that particular item against each service warehouse. But from the Sales Analysis or purchase analysis report I can't able to see service warehouse wise sales quantity & amount.
    N.B.-Those items are created as Sales & Expense item only, no inventory.
    Plz help.
    Subrata

    Hi Subrata,
    in this case you need a customized report trough Query or through Crystal Report.
    regards,
    Fidel

  • Data Ownership in Sales Analysis Report

    The company has sales employees around the world and the company is not interested that each of them
    can see the others sales, so when an employee runs a sales analysis report they should only see
    their own documents but it not happened despite the data ownership funtion was activated and all the
    options related with the sales analysis excluded forms was filtered by header only.
    According to SAP Support team their comments were:
    "We have reproduced the issue in our testing database. After verification, we noted that this is the current system definition as described in the attached Data_Ownership2004_A.pdf file. In page 11, it mentions that Data Ownership Authorizations apply to sales and purchasing documents, the Open Items List, Sales Opportunities and Sales Opportunities Reports. This is why the header filtration does n ot work in Sales Analysis Report.
    As the requirement is currently not available in the standard software version of SAP Business One, we would like to ask you post your requirement in our SAP Business One Product Development Collabora tion forum."
    Due to the current situation and the disconfort that this can produce, I will appreciate a lot your help.
    Thanks in adavance,
    Manuel Barrero

    Hi Vassilis,
    Sorry, but in my opinion it's correct.
    We also use Drop Ship and like you said in the Stock Posting List we don't have any document and it's perfect. In other way when we sell an item we want and it's true the quantity that B1 is showing.
    We want to see the for a itemcode we sold 100qty qith the value of 1000.
    There's no way to avoid this SAP B1 behaviour.
    Kind regards,
    Augusto

  • Query vs Sales Analysis Report

    I wrote a query that does virtually the same thing as a sales analysis report -- add up all invoice totals and calculate a gross sales number.
    In the sales analysis report ItemXXX has a total sales of $1456.94
    My query ItemXXX has a total sales of $1457.73
    A $.79 discrepancy which I assumed was a result of the fact that my query doesn't include A/R Credit Memos. Only some items have this discrepancy.
    The problem is that if I do an inventory posting list on the item there are no A/R Credit Memos listed. Only A/R Invoices, A/P Invoices, and A/P Goods Receipts.
    What other documents could be affecting this number? Any other things that could be causing this?
    Thanks,
    -Steve

    Hi Nagarajan,
    Im user of Sap Business One, i need the completly query for obtain the Sales Analysis Report
    i have this but in some items dont match
    SELECT  ItemCode,   
            Sum(TotFac) - SUM(TotNC) as  'FacturadoNeto',   
            Sum(GBrutaFac)-SUM(GbrutaNC) as  'GBruta',   
            Round((Sum(GBrutaFac)-SUM(GbrutaNC))/case when  (Sum(TotFac) - SUM(TotNC))= 0 then 1 else (Sum(TotFac) - SUM(TotNC)) end  *100,2) as '% Margen'   
    FROM (   
    SELECT    
    ItemCode = T1.ItemCode, 
    Marca = (Select T2.FirmName from OMRC T2 JOIN OITM T3 on T2.FirmCode = T3.FirmCode where T3.ItemCode=T1.Itemcode), 
    TotFac = Sum(T1.Linetotal),    
    GBrutaFac = SUM(T1.GrssProfit),   
    TotNc= 0,   
    GbrutaNC = 0   
    FROM OINV T0 (NOLOCK) INNER JOIN INV1 T1 (NOLOCK) ON T0.DocEntry = T1.DocEntry                                    
    WHERE (T0.[DocDate] >='20140101' AND  T0.[DocDate] <='20141231') 
      and T0.DocType  = 'I' -- solo facturas por articulos   
    Group by  T1.ItemCode  
    Union   
    SELECT    
    ItemCode = T1.ItemCode,   
    Marca = (Select T2.FirmName from OMRC T2 JOIN OITM T3 on T2.FirmCode = T3.FirmCode where T3.ItemCode=T1.Itemcode), 
    TotFac = 0,   
    GBrutaFac = 0,   
    TotNc= Sum(T1.LineTotal),    
    GbrutaNC = SUM(T1.GrssProfit)   
    FROM ORIN T0 (NOLOCK) INNER JOIN RIN1 T1 (NOLOCK) ON T0.DocEntry = T1.DocEntry                                    
    WHERE (T0.[DocDate] >='20140101' AND  T0.[DocDate] <='20141231')
      and T0.DocType  = 'I' -- solo NC por articulos   
    Group by T1.ItemCode 
    Union
    SELECT    
    ItemCode = T1.ItemCode,   
    Marca = (Select T2.FirmName from OMRC T2 JOIN OITM T3 on T2.FirmCode = T3.FirmCode where T3.ItemCode=T1.Itemcode), 
    TotFac = 0,   
    GBrutaFac = 0,   
    TotNc= Sum(T1.LineTotal),    
    GbrutaNC = SUM(T1.GrssProfit)   
    FROM ODPI T0 (NOLOCK) INNER JOIN DPI1 T1 (NOLOCK) ON T0.DocEntry = T1.DocEntry                                    
    WHERE (T0.[DocDate] >='20140101' AND  T0.[DocDate] <='20141231')     
      and T0.DocType  = 'I' -- solo Fact Anticipos por articulos   
    Group by T1.ItemCode
    ) T   
    Group by  ItemCode, Marca

  • Query to mimic the items tab of the Sales Analysis report.

    Hi there,
    I'm currently looking to create a query that mimics the behaviour of the Sales Analysis report in B1. The items tab of the Sales Analysis report provides all the data I require - the only issue is that I would like to merge this data with some other data regarding current on hand stock quantities etc. and therefore I would like to be able to pull out the query behind the Sales Analysis report.
    I'm assuming this cannot be done and therefore I'm attempting to build a query to replicate the results. The query needs to show Item No, Item Description, Quantity Sold, Sales Amt (in system currency), Gross Profit and Gross Profit % for items within a given period.
    If this can be done relatively easily, can the query then be modified to show all items (including items that haven't sold in the date range) merely with '0' for Quantity Sold, Sales Amt etc. if the item hasn't been sold in the period, and the appropriate figures if each of these columns if the item has sold. I assume some kind of CASE statement can be used to generate this.
    So the query needs to show Item No, Item Description, Current quantity in stock, Quantity Sold, Sales Amt (in system currency), Gross Profit and Gross Profit % for all items within a given date range.
    I hope you can assist me with this problem.
    Thanks
    Grant.

    Hi,
    Thanks Gordon that was exactly what I needed.
    I've been trying to add some additional columns to the query but I'm experiencing some errors and I can't quite tell why.
    Basically, here's the code from another working query I have which I wish to merge into the query you've suggested above:
    SELECT T0.[ItemCode],
    T0.[ItemName],
    T3.[ItmsGrpNam],
    T4.[Name] AS [Sub-Category],
    T5.[Name] AS [Sub-Sub-Category],
    T0.[CardCode] AS [Pref Supplier],
    T6.[FirmName] AS [Brand],
    T0.[U_Range],
    T0.[OnHand],
    CASE WHEN T0.[StockValue] = 0 THEN 0 ELSE T0.[StockValue] END AS [StockValue],
    T1.[Price] AS [PBK GBP Price],
    CASE WHEN T0.[OnHand] = 0 THEN T0.[LastPurPrc] ELSE T0.[StockValue]/T0.[OnHand] END AS [Ave Cost],
    CASE WHEN T0.[OnHand] = 0 THEN T1.[Price]-T0.[LastPurPrc] ELSE CASE WHEN T0.[OnHand] > 0 THEN T1.[Price]-T0.[StockValue]/T0.[OnHand] END END AS [Margin],
    CASE WHEN T0.[OnHand] = 0 AND T0.[LastPurPrc] = 0 THEN 0 ELSE CASE WHEN T0.[OnHand] > 0 AND (T0.[StockValue]/T0.[OnHand]) = 0 THEN 0 ELSE CASE WHEN T0.[OnHand] = 0 THEN (T1.[Price]-T0.[LastPurPrc])/T1.[Price]*100 ELSE CASE WHEN T0.[OnHand] > 0 THEN (T1.[Price]-T0.[StockValue]/T0.[OnHand])/T1.[Price]*100 END END END END AS [Margin %],
    T0.[LastPurPrc]
    FROM [dbo].[OITM]  T0 INNER JOIN [dbo].[ITM1]  T1 ON T0.ItemCode = T1.ItemCode INNER JOIN [dbo].[OITB]  T3 ON T0.ItmsGrpCod = T3.ItmsGrpCod LEFT OUTER JOIN [dbo].[@U_SUBCATEGORY]  T4 ON T0.U_Subcategory = T4.Code LEFT OUTER JOIN [dbo].[@U_SUBSUBCATEGORY]  T5 ON T0.U_SubSubCategory = T5.Code INNER JOIN OMRC T6 ON T0.FirmCode = T6.FirmCode
    WHERE T0.[OnHand] >= 0 and T0.U_Range not in ('E','X')  
    ORDER BY T0.[ItemCode]
    Essentially I just wish to add the fields which are specified in the query above, but not in the query you've already suggested:
    SELECT T0.ItemCode,
    Max(T0.ItemName),
    Max(IsNull(T0.OnHand,0)) 'In Stock',
    SUM(IsNull(T1.Quantity,0)) 'Quantity',
    Sum(IsNull(T1.LineTotal,0)) 'Sales Amt',
    SUM(IsNull(T1.GrssProfit,0)) 'Gross Profit',
    Case WHEN Sum(Isnull(T1.LineTotal,0)) = 0 THEN 0 ELSE
    SUM(IsNUll(T1.GrssProfit,0))/Sum(Isnull(T1.LineTotal,0)) * 100 END 'Gross Profit %'
    FROM dbo.OITM T0
    LEFT JOIN dbo.INV1 T1 ON T1.ItemCode=T0.ItemCode
    LEFT JOIN dbo.OINV T2 ON T2.DocEntry=T1.DocEntry AND T2.DocDate Between [%0] AND [%1]
    GROUP BY T0.ItemCode
    I was hoping it would be fairly straight forward but so far I've had limited success.
    What am I missing here?
    Thanks in advance!

Maybe you are looking for

  • Problem updating to os 9.2.1

    I am trying to re update my g3 after doing a clean install from the cd. I want to go to 9.2.2, already have installed 9.1. The problem is trying to get 9.2.1 from this site, all I get is a message: <? header ("Location;../export/"); //Bounce to new e

  • Need help on assessment of security upgrade to ECC .0

    Hi, I am a security guy and am involving in security upgrade from 4.6c to ECC6.0.  I want your suggestions & contribution on preparing the assement of security upgrade.  So can anybody guide me to follow the security strategies <removed_by_moderator>

  • Has anyone ued a pnm2ppa driver in an Intel iMac?

    I can use my old HP 722C printer in the XP partition of my new Intel iMac, but even though the iMac System Profiler recognizes that I have an IEEE-1284 USB cable attached to a 720C series printer, the printer will not print in the OS X partition. A s

  • How to make checkbox to be pre-selected in ALV

    Hi all! I`m creating ALV report and I want to create checkbox in the first column of the row. So I have a field SEL(1) in my structure and I`ve made the fieldcat: gs_fcat-col_pos = 5.   gs_fcat-coltext = 'Check'.   gs_fcat-fieldname = 'SEL'.   gs_fca

  • FlashPlayer 11 (non-debug only) + LCCS v2.1.0 targeting FP 10.0 not loading content

    Is anyone still compiling apps with LCCS 2.1.0 targeting FlashPlayer 10.0 and running the app in a FlashPlayer 11 ( non-debug ) ? * Not an issue when I target LCCS 2.1.0 to FP 10.3 but I can't upgrade just yet because of some of our customers Most of