Sale Analysis Profit Calculation problem

Hello
I create sale Invoice having Qty 2 unit price 150 & tax code is VAT@4% then Base amount is 300 & Total Bill
amt is 312.
My purchase price for the same item is INR 100 so my Gross profit show on Bill is INR 100 & profit percent
is 33.33%
Customer will debit with INR 312
But when Create Rate difference bill ie credit memo of INR 20 per uint ie Qty 2 Tax VAT@4%  (maintain
drop ship warehouse in row level to can't reduce the qty)
Customer will debit -41.60
So Customer Debit balance is 270.40
But when I run Sale analysis report the result shows that Gross profit INR 260 & Gross Profit % is 100%
But actually i calculated manually the real Profit is INR 60 & Profit % should be 23.08 should be show in sale
analysis
So what i do to see the same result

Hi
There is some problem in sales analysis report in some of the sap versions. Refer the following documents.
[https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/sno/ui_entry/entry.htm?param=69765F6D6F64653D3030312669765F7361706E6F7465735F6E756D6265723D3030303130313637303426]
[https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/sno/ui_entry/entry.htm?param=69765F6D6F64653D3030312669765F7361706E6F7465735F6E756D6265723D3135383735363826]
[https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/sno/ui_entry/entry.htm?param=69765F6D6F64653D3030312669765F7361706E6F7465735F6E756D6265723D3136363835363426]
Regards,
Sudhir B.

Similar Messages

  • How is the Sales Amount in the Sales Analysis Report calculated.

    Hi,
    I'm trying to develop a report similar to the sales analysis report of SAP.
    I want to know how does SAP calculate the the Sales Amount column. I was using LineTotal column of Invoices + A/R credit memos, but it's not correct. I know i'm getting all the records because my total quantity and Gross Profit is correct.

    Hi Vj Chris,
    Try This
    SELECT T0.[DocNum] as 'INV NO', T0.[DocDate] as 'INV DT', T0.[CardCode], T0.[CardName], T0.[DocTotal], T0.[GrosProfit], T1.[DocNum] as 'AR CR MEMO', T1.[DocDate] as' AR CR DT' , T1.[CardCode], T1.[CardName], T1.[DocTotal], T1.[GrosProfit], (T0.[DocTotal]-T1.[DocTotal]) as 'Final Amount', (T0.[GrosProfit]-T1.[GrosProfit]) as' Final GR Profit' FROM OINV T0 , ORIN T1 WHERE T0.[DocDate] >=[%0] and  T0.[DocDate] <=[%1]
    But this query better run when you are using in Crystal Report.
    Thanks,
    Srujal Patel

  • Sales Analysis Vs P n L

    Hello Experts,
    Sorry for coming again with the same topic but as of now this is one of my biggest problem, just now i am doing year end stock check, GP check and other consolidation.
    Just need advice to rectify the error
    my Sales Analysis and PnL Figures are as follows :-
    Sales Analysis GP   ---   705870
    P n L GP                   ---   503588
    Nearly 2,00,000 difference
    My Stock valuation method : Standard Cost
    Can someone list out reason for the same so that i can run in right direction to rectify errors ??
    Cheers !!

    Hi Ish ,
    If i am in your position ,I will try this
    1. Find the item and quantity sold  that has gross profit 100%
    2 .Since my price is standard , I will multiply total qty * my actual price to find the total cost  .
    ( I will worry abt variance later
    3.Non inventory item donot hit OINM table ,so I will not be bothered to see it unless I found that items that are found in Sales Order belong to inventory group and still has gross profit hundred percent .
    4 . I will try to find out based on item through drag and relate and check why it is showing hundred percent by looking at GP button,
    You will still not get correct result , if your user has changed pricelist based on calculation .For example - you have set gross profit based on Item cost but some user change it to based on lst evaluated price by doing something or by accident .Then your GP on sales analysis is calculated based on Last evaluated price .You have to go and look who has changed it and how then ..just another time consuming process
    That's why I told you to find out major differnce and try to close the gap of GP diffference. This is only for your satisfaction ..this will let you know what is happening in your system ...
    Hope this helps
    Bishal

  • Sales Analysis - Gross Profit Percentage

    Hello,
    This is a very basic question that hopefully somebody can help me with.
    I ran the Sales Analysis by Customers --> Orders --> for a specific customer.  When I look at the detailed report of the Sales Analysis for this particular customer there are two orders.  I'm confused by how SAP is calculating the gross profit percentage.
    For example, one of the invoices has a sales amount of $76,160.00 and a gross profit of $22,580.00.  The gross profit percentage on the analysis is 42.143. 
    Shouldn't the GP % really be 29.648%?  I used the following formula to calculate this:  (Gross Profit/Sales Amount)*100. 
    What formula is SAP using? 
    Thank you,
    Amanda

    I get it.  It's calculating, however, it's setup on that tab.
    I've been able to calculate both percentages now.
    Thank you so much for your help.  I knew it had to be basic!
    Thanks!
    Amanda

  • Negative Gross Profit figure - Sales Analysis by Employee

    Forum,
    I have a system on 8.81 PL08. When running the sales analysis by sales employee and select one employee in particular the gross profit figure is showing a negative value. 
    Why would this be negative?
    The system is currently configured as follows:
    GP calculated - Profit/Base Price
    The block negative stock option is also selected.
    Regards,
    Juan

    Hi Juan,
    Negative value in the gross profit is due to wrong gross profit calculation in the document. If you get detail of the transaction, you will know why.
    Thanks,
    Gordon

  • Sales Analysis Report Problem

    Hi all.
    I would be glad if I could get a response for this question from someone at SAP. Though all responses are very welcome.
    There seems to be an error on the Sales Analysis report. The report runs fine with selection criteria for Customers and Sales Employees but when you run it with the Items Selection Criteria it returns the correct rows but wrong amounts in the Gross Profit and Gross Profit % columns which also means that the totals are also wrong.
    I have tried to follow the issue but everything seems to be OK.
    My last resolution is that there may be something wrong with the stored proc that B1 runs to produce this report.
    Please help! Urgent.

    Wilfred,
    You should create a message with SAP Support on this issue.
    Eddy

  • Sales analysis problem

    sales analysis problem
    scenario: there are many plants and customers, the relationship between them is n:n, and every
    customer has a classification.
    my question is how to calculate the number of the plant that sold to one classification of the
    customer in BW.
    for example;
    plant: 1000, 1001, 1002
    customer: 2000, 2001, 2002
    classification: A, B
    customer's classification: 2000:A, 2001:A, 2002:B
    transactions:
    plant->customer
    1000 ->2000:A
    1000 ->2001:A
    1001 ->2000:A
    1001 ->2002:B
    1002 ->2002:B
    so the result is : the number of plant that sold to customer classification A is 2;sold to
    customer classification B is 2;
    how to carry out it in bw with a cube, please help help me solve the problem, thank you very
    much!

    Wilfred,
    You should create a message with SAP Support on this issue.
    Eddy

  • SALES Analysis  and profit loss statment

    Hi All ,
    Dear Experts,
                                 My Sales Analysis and profit loss statement Value is deferent .  i want to know that which entry show in sales analysis and which entry show in profit loss statment .
    Thanks & Regard
    AREEBA ALI

    Aree,
    Both report are different. The sales analysis will use document of sales orders, delivery order, invoice and credit memo.
    The P&L use journal entry of invoice and credit memo. Can you be more specific about the different ?
    JimM

  • Mismatch - Profit and Loss Account and Sales Analysis Report

    There is a mismatch between Sales Analysis Report and Profit and Loss account Sales Figure.
    What will be the reason?

    Hi Nishiraj.......
    then you must update or create new Financial Report template for Profit And Loss Account and then check.
    For creating Financial Report Template please check this.....
    Financial--> Financial Report Template.
    http://help.sap.com/saphelp_sbo88/helpdata/en/45/10c8c90b9941dfe10000000a1553f6/content.htm
    Regards,
    Rahul

  • Sales Analysis Comparative

    Dear Experts,
    Hope you are having a great day. I just wanted to confide my problem in regards to my formula for generating the correct GP based on the sales analysis report from sap, for comparative purposes.
    Sales Analysis Report Screenshot from SAP
    The result query generates this:
    As you can see, GP%1 is positive, but on the SAP Analysis it is negative. Is there anyone who could help me generate the correct formula for that?
    Here's the query formula:
    Select
    a1.AM,
    a1.[AR Inv1],
    b1.[AR Inv2] ,
    a1.Year1_Qty,
    b1.Year2_Qty,
    a1.Year1_Amt as 'Total AR Invoice',
    b1.Year2_Amt as 'Total AR Invoice2',
    a1.Year1_GP as 'Gross Profit',
    b1.Year2_GP as 'Gross Profit 2',
    (a1.Year1_GP/NULLif(a1.Year1_Amt,0))*100 as 'GP%1',
    (b1.Year2_GP/NULLif(b1.Year2_Amt,0))*100 as 'GP%2'
    from
    Many thanks for the help..
    Best Regards,
    JZA

    Hello Sir,
    Here's the complete query.
    declare @Date1 datetime
    declare @Date2 datetime
    declare @Date3 datetime
    declare @Date4 datetime
    SET @Date1 = /* t7.DocDate */ '[%0]'
    SET @Date2 = /* t7.DocDate */  '[%1]'
    SET @Date3 = /* d7.DocDate */ '[%2]'
    SET @Date4 = /* d7.DocDate */  '[%3]'
    Select
    a1.AM,
    a1.[AR Inv1],
    b1.[AR Inv2] ,
    a1.Year1_Qty,
    b1.Year2_Qty,
    a1.Year1_Amt as 'Total AR Invoice',
    b1.Year2_Amt as 'Total AR Invoice2',
    a1.Year1_GP as 'Gross Profit',
    b1.Year2_GP as 'Gross Profit 2',
    NUllif(a1.Year1_GP/(a1.Year1_Amt),0)*100 as 'GP%1',
    NUllif(b1.Year2_GP/(b1.Year2_Amt),0)*100 as 'GP%2'
    from
    select
    a.SlpName 'AM', COUNT(distinct a.DocNum) 'AR Inv1',
    SUM( a.Qty)'Year1_Qty', sum(a.Amt) 'Year1_Amt', sum(a.GP) 'Year1_GP' -- , SUM(a.[GP %]) as 'GPercent'
    from
           select t4.SlpName 'SlpName',  t7.docdate ,
           t7.docnum,t3.itemcode,
           CASE when t7.CANCELED = 'Y' then t3.Quantity*-1
           Else t3.Quantity
           end 'Qty',
           CASE when t7.CANCELED = 'Y' then (T3.[LineTotal]- (T3.[LineTotal]* ( ISNULL(T7.DiscPrcnt,0)/100)) )*-1
           else T3.[LineTotal]- (T3.[LineTotal]* ( ISNULL(T7.DiscPrcnt,0)/100)) end 'Amt',
           CASE when t7.CANCELED = 'Y' then T3.[GrssProfit]*-1   
           else T3.[GrssProfit] end 'GP',
           CASE when t7.CANCELED = 'Y' then  ((T3.[GrssProfit] / ((nullif(T3.[LineTotal],0)) - ((T3.[LineTotal])* (ISNULL(T7.DiscPrcnt,0)/100))))*100)*-1
           else (T3.[GrssProfit] / ((nullif(T3.[LineTotal],0)) - ((T3.[LineTotal])* (ISNULL(T7.DiscPrcnt,0)/100))))*100 end as 'GP %'
           from INV1 t3
           left outer join oinv t7 on t3.docentry = t7.docentry
           left outer join oslp t4 on t7.SlpCode = t4.SlpCode
           left outer join OITM t8 on t3.itemcode = t8.itemcode
           where
          t7.docdate >= '[%0]' and t7.docdate <= '[%1]'
           UNION
           select t4.SlpName 'SlpName', T9.docdate ,
           t9.DocNum, t5.itemcode,t5.Quantity*-1 'Qty',
           CASE when t9.CANCELED = 'Y' and t9.DocStatus = 'C' then (T5.[LineTotal]- (T5.[LineTotal]* ( ISNULL(T9.DiscPrcnt,0)/100)))*-1
                when t9.CANCELED = 'C' and t9.DocStatus = 'C' then (T5.[LineTotal]- (T5.[LineTotal]* ( ISNULL(T9.DiscPrcnt,0)/100)))
                when T9.CANCELED = 'N' and T9.DocStatus = 'C' then (T5.[LineTotal]- (T5.[LineTotal]* ( ISNULL(T9.DiscPrcnt,0)/100)))*-1
                when T9.CANCELED = 'N' and T9.DocStatus = 'O' then (T5.[LineTotal]- (T5.[LineTotal]* ( ISNULL(T9.DiscPrcnt,0)/100)))*-1
           else(T5.[LineTotal]- (T5.[LineTotal]* ( ISNULL(T9.DiscPrcnt,0)/100))) end'Amt',
           T5.[GrssProfit]*-1  'GP',
           CASE when t9.CANCELED = 'Y' then  ((T5.[GrssProfit] / ((nullif(T5.[LineTotal],0)) - ((T5.[LineTotal])* (ISNULL(T9.DiscPrcnt,0)/100))))*100)*-1
           else (T5.[GrssProfit] / ((nullif(T5.[LineTotal],0)) - ((T5.[LineTotal])* (ISNULL(T9.DiscPrcnt,0)/100))))*100 end as 'GP %' 
           from ORIN t9
           Left outer join RIN1 t5 on t9.docEntry = t5.DocEntry
           left outer join oslp t4 on t9.SlpCode = t4.SlpCode
           left outer join OITM t8 on t5.itemcode = t8.itemcode
           where
            t9.docdate >= '[%0]' and t9.docdate <= '[%1]'
        ) A
        group by a.SlpName
    )A1
    full  join
    select
    a.SlpName 'AM', COUNT(distinct a.DocNum) 'AR Inv2',
    SUM( a.Qty)'Year2_Qty', sum(a.Amt) 'Year2_Amt', sum(a.GP) 'Year2_GP' --, SUM(a.[GP %]) as 'GPercent'
    from
           select t4.SlpName 'SlpName',  t7.docdate ,
           t7.docnum,t3.itemcode,
           CASE when t7.CANCELED = 'Y' then t3.Quantity*-1
           Else t3.Quantity
           end 'Qty',
           CASE when t7.CANCELED = 'Y' then (T3.[LineTotal]- (T3.[LineTotal]* ( ISNULL(T7.DiscPrcnt,0)/100)) )*-1
           else T3.[LineTotal]- (T3.[LineTotal]* ( ISNULL(T7.DiscPrcnt,0)/100)) end 'Amt',
           CASE when t7.CANCELED = 'Y' then T3.[GrssProfit]*-1   
           else T3.[GrssProfit] end 'GP',
           CASE when t7.CANCELED = 'Y' then  ((T3.[GrssProfit] / ((nullif(T3.[LineTotal],0)) - ((T3.[LineTotal])* (ISNULL(T7.DiscPrcnt,0)/100))))*100)*-1
           else (T3.[GrssProfit] / ((nullif(T3.[LineTotal],0)) - ((T3.[LineTotal])* (ISNULL(T7.DiscPrcnt,0)/100))))*100 end as 'GP %'
           from INV1 t3
           left outer join oinv t7 on t3.docentry = t7.docentry
           left outer join oslp t4 on t7.SlpCode = t4.SlpCode
           left outer join OITM t8 on t3.itemcode = t8.itemcode
           where
           t7.docdate >= '[%=2]' and t7.docdate <= '[%3]'
           UNION
           select t4.SlpName 'SlpName', T9.docdate ,
           t9.DocNum, t5.itemcode,t5.Quantity*-1 'Qty',
           CASE when t9.CANCELED = 'Y' and t9.DocStatus = 'C' then (T5.[LineTotal]- (T5.[LineTotal]* ( ISNULL(T9.DiscPrcnt,0)/100)))*-1
                when t9.CANCELED = 'C' and t9.DocStatus = 'C' then (T5.[LineTotal]- (T5.[LineTotal]* ( ISNULL(T9.DiscPrcnt,0)/100)))
                when T9.CANCELED = 'N' and T9.DocStatus = 'C' then (T5.[LineTotal]- (T5.[LineTotal]* ( ISNULL(T9.DiscPrcnt,0)/100)))*-1
                when T9.CANCELED = 'N' and T9.DocStatus = 'O' then (T5.[LineTotal]- (T5.[LineTotal]* ( ISNULL(T9.DiscPrcnt,0)/100)))*-1
           else(T5.[LineTotal]- (T5.[LineTotal]* ( ISNULL(T9.DiscPrcnt,0)/100))) end'Amt',
           T5.[GrssProfit]*-1  'GP',
           CASE when t9.CANCELED = 'Y' then  ((T5.[GrssProfit] / ((nullif(T5.[LineTotal],0)) - ((T5.[LineTotal])* (ISNULL(T9.DiscPrcnt,0)/100))))*100)*-1
           else (T5.[GrssProfit] / ((nullif(T5.[LineTotal],0)) - ((T5.[LineTotal])* (ISNULL(T9.DiscPrcnt,0)/100))))*100 end as 'GP %' 
           from ORIN t9
           Left outer join RIN1 t5 on t9.docEntry = t5.DocEntry
           left outer join oslp t4 on t9.SlpCode = t4.SlpCode
           left outer join OITM t8 on t5.itemcode = t8.itemcode
           where
           t9.docdate >= '[%2]' and t9.docdate <= '[%3]'
        ) A
            group by a.SlpName
    ) B1
    on a1.am = b1.am
    I am almost done analyzing one whole month sales analysis. Now the problem I got upon testing is
    this 1st query combined from OINV and ORIN. Wherein the result I got has a discrepancy from ORIN with docnum = 100120
    Query
    select t4.SlpName 'SlpName',  t7.docdate ,
    t7.docnum,t3.itemcode,
    CASE when t7.CANCELED = 'Y' then t3.Quantity*-1
    Else t3.Quantity
    end 'Qty',
    CASE when t7.CANCELED = 'Y' then (T3.[LineTotal]- (T3.[LineTotal]* ( ISNULL(T7.DiscPrcnt,0)/100)) )*-1
    else T3.[LineTotal]- (T3.[LineTotal]* ( ISNULL(T7.DiscPrcnt,0)/100)) end 'Amt',
    CASE when t7.CANCELED = 'Y' then T3.[GrssProfit]*-1
    else T3.[GrssProfit] end 'GP',
    CASE when t7.CANCELED = 'Y' then  ((T3.[GrssProfit] / ((nullif(T3.[LineTotal],0)) - ((T3.[LineTotal])* (ISNULL(T7.DiscPrcnt,0)/100))))*100)*-1
    else (T3.[GrssProfit] / ((nullif(T3.[LineTotal],0)) - ((T3.[LineTotal])* (ISNULL(T7.DiscPrcnt,0)/100))))*100 end as 'GP %'
    from INV1 t3
    left outer join oinv t7 on t3.docentry = t7.docentry
    left outer join oslp t4 on t7.SlpCode = t4.SlpCode
    left outer join OITM t8 on t3.itemcode = t8.itemcode
    where
    t7.docdate >= '2014.07.31' and t7.docdate <= '2014.07.31'
    and T4.SlpName = 'PPM'
    UNION
    select t4.SlpName 'SlpName', T9.docdate ,
    t9.DocNum, t5.itemcode,t5.Quantity*-1 'Qty',
    CASE when t9.CANCELED = 'Y' and t9.DocStatus = 'C' then (T5.[LineTotal]- (T5.[LineTotal]* ( ISNULL(T9.DiscPrcnt,0)/100)))*-1
    when t9.CANCELED = 'C' and t9.DocStatus = 'C' then (T5.[LineTotal]- (T5.[LineTotal]* ( ISNULL(T9.DiscPrcnt,0)/100)))
    when T9.CANCELED = 'N' and T9.DocStatus = 'C' then (T5.[LineTotal]- (T5.[LineTotal]* ( ISNULL(T9.DiscPrcnt,0)/100)))*-1
    when T9.CANCELED = 'N' and T9.DocStatus = 'O' then (T5.[LineTotal]- (T5.[LineTotal]* ( ISNULL(T9.DiscPrcnt,0)/100)))*-1
    else(T5.[LineTotal]- (T5.[LineTotal]* ( ISNULL(T9.DiscPrcnt,0)/100))) end'Amt',
    T5.[GrssProfit]*-1  'GP',
    CASE when t9.CANCELED = 'Y' then  ((T5.[GrssProfit] / ((nullif(T5.[LineTotal],0)) - ((T5.[LineTotal])* (ISNULL(T9.DiscPrcnt,0)/100))))*100)*-1
    else (T5.[GrssProfit] / ((nullif(T5.[LineTotal],0)) - ((T5.[LineTotal])* (ISNULL(T9.DiscPrcnt,0)/100))))*100 end as 'GP %' 
    from ORIN t9
    Left outer join RIN1 t5 on t9.docEntry = t5.DocEntry
    left outer join oslp t4 on t9.SlpCode = t4.SlpCode
    left outer join OITM t8 on t5.itemcode = t8.itemcode
    where
    t9.docdate >= '2014.07.31' and t9.docdate <= '2014.07.31'
    and T4.SlpName = 'PPM'
    RESULT:
    But if I am just going to run query for ORIN only this is the result.
    As you can see there are two items in ORIN for docnum 100120, while if i unite it with OINV the result for 100120 only returns 1 data. Kindly help.
    And thank you so much sir for viewing my query.
    Best Regards,
    JZA
    Message was edited by: JZA

  • 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!

  • Sales Analysis report does not match Cost of Sales Account

    My client is running SAP B1 8.81 PL 6.  He has set all items to standard costing method.  He has discovered that the difference between the Sales Amount and the Gross Profit amount on the Sales Analysis report, which should equal the Cost of Sales for the Items, does not match the Cost of Sales G/L account on the P&L report.  If you look at a sample of rows, the above difference divided by the quantity equals the standard cost of the item.  There are no manual journal entries that affect the COS account for the posting period that is being analyzed.  I cannot see any mathmatical difference or problem with the above analysis, nor can I find the problem.  There is about an $85K difference between the reports.  The Sales Amount on the Sales Analysis report matches the revenue account on the P&L to the penny.  Has anyone ever compared these 2 reports?  Thank you for your help.
    Bill Turek

    If you right click on an Invoice and choose "Gross Profit" it will give you a setting on how you want to calculate the Gross Profit for that invoice.
    In the accounting point of view the "Base Price" should be "Item Cost" so that the Gross Profit will be (Net Selling Price - Item Cost = Gross Profit). This will give you the same Gross Profit amount between P and L and Sales Analysis Report.
    However, SAP B1 gives the user the ability to select a different base price other than the Item Cost.
    This gives the user the flexibility for the Sales Report. Example (Net Sales Price - Vendor Sales Price = Gross Profit). People do this sometimes because  the item's cost fluctuates if you use FIFO or average cost and they want a uniform cost to calculate their Gross Profit.
    In summary if the Base Price is not set to "Item Cost" then there will be difference in the Gross Profit between the P and L and Sales Analysis Report.
    See screenshot:
    -Eric Alo-
    B1 Financial Consultant

  • A/R Credit Memo Gross Profit calculated incorrectly

    My client created an A/R Credit Memo by opening an A/R Invoice and copying to the A/R Credit Memo.  They deleted all the rows in the credit memo, changed the type to Service, typed a description, added the correct G/L account, and entered the total amount.  The controller of the company looked at the Sales Analysis for the Business Partner by clicking on the graphic icon on the BP form.  He noticed the Gross Profit for the above credit memo showed the exact gross profit as the original invoice from which it was copied, except the value was negative.  The original gross profit was -$73,777 so the Sales Analysis report was significantly incorrect.  I think this is a bug in how the gross profit was calculated on the credit memo.  Am I correct?

    Gordon,
    I totally agree with you.  I told them to not do this any more. 
    I was just wondering if maybe the calculation should be been performed using the final numbers on the Credit Memo instead of using numbers from the original invoice.  Should I raise this issue to SAP?

  • XL-Reporter - sales analysis including row discount and document discount

    Hello World!
    In XLR I want to report all item-sales to customers grouped by item-groups based on invoives.
    Since I am interested only in net amounts (without tax, freight and other expenses) and discounts I use 'S0_LineTotal' as attribute.
    'SO_LineTotal' includes the discount of each item-row in the document.
    The row selection is as follows:
    FACT
    ARDT(Code = "ARCreditMemo","Invoice")
    FIG(SO_DocType = "I")
    ITM( * ) 
    Group By ITM.ItmsGrpCod
    The problem is that I also have to include the document discount 'OINV.DiscSum' in the result.
    In combination with the row selection specified above the attribute 'Total Discount' delivers no results (always 0).
    In the standard SAP report 'Sales - AR/Sales reports/Sales Analysis' the total discount is averaged to all items in the matrix of a document.
    How can I achieve this in my XL-Report?
    Thank you very much for your support!
    Frank Romeni
    Edited by: Frank Romeni on May 15, 2008 3:55 PM
    Edited by: Philip Eller on May 29, 2008 8:53 AM

    Hello,
    To get this, I tried drag following information from Report composer:
    Under Sales tab, choose Items(Display more atrributes to choose Item Group), Document Number(choose this one because same items may have different discount in different documents), Discount % Per Row(light dimension),Discount % Per Document(light dimension), Row Total(measure).
    Drag the Item Group to the Group region.
    Run the report and the result should be all items are grouped by item Group and discounts and total in different document for each item will be listed.
    Hope this helps you.
    Regards,
    Maggie An
    SAP Business One Forum Team

  • Manually closed DN appear with value 0 on sales analysis - items

    Hello everyone,
    When i manually close a Delivery Note (DN) using Data->Close that DN still appears on my sales analysis -> customer. (using the filter -> Delivery Notes)
    However when i use sales analysis -> items i only get the list of items contained on that DN. All the columns (quantity, sales amount, gross profit, etc) are with zero values.
    Is there any way of showing those values on the sales report? Or any other report? Is this standard system behavior? Shouldn't the items disappear completely then? What is the purpose of showing them without any further information?
    Looking forward to be hearing from you.
    Regards,
    Sérgio Romã

    Hello Gordon,
    Thanks for the quick reply.
    The business process requires me to close the DN manually:
    The customer has something like 4000 employees that are created as customers. Each of those employees has a pre-defined creditline amount. DNotes can be created for each employee until that amount. On the second week of every month i need to close all these DNotes (i am doing this using an addon that runs based on schedule defined in a user table and that closes all DN that meet certain conditions) so that i can add more DNotes to each employee. At the end of every month i have another addon that totals all DN added that month (closed and open) and creates a single service invoice for a customer (defined in each employee).
    So i need to close them manually because i cannot copy them to a consolidation partner (release of employee creditline and invoicing occur at the different moments during the month).
    My disagreament with the system behavior is the following:
    - I get the correct the results if i create a sales analysis -> customer. If they don't result in a sales transaction they shoudn't appear on this report either. (according to the logic you presented)
    - Sales analysis -> Item. The item lines appear with zero. Once again, if it is not a sales transaction they shoudn't appear at all (according to the same logic). The system is doing the same thing as if the DN has been copied to an invoice which is a wrong behavior. This is a different situation and the item detail should be visible on the sales analysis report.
    What do you think?
    Regards,
    Sérgio Romã

Maybe you are looking for

  • Connecting VGA to Appletv

    I have a large Sony VGA television and I would like to connect Apple tv to it. What is the best connector to use, or should I just get a flat panel with HDMI connecter?Conneting VGA to

  • COLLECT_OVERFLOW Dump

    Hello, The SAP_COLLECTOR_FOR_PERFMONITOR Job has been cancelling for last two days onwards. Job log overview for job: SAP_COLLECTOR_FOR_PERFMONITOR is ABAP/4 processor: COLLECT_OVERFLOW. Actually We have set the stat/tabrec parameter value 5 constant

  • Text file into Forms

    Hi suppose in text file the data is No Name 1 abc 2 xyz and a table st_rec that has attribute no and name and i want populate my form field that are no and name with text file data and populate i can store this data into database. how i can.... Thank

  • How to control Adobe Software Updates

    Hello All, A user reported an issue with software updates for the Creative Cloud Suite, it's not support for the update I am asking for I wanted to ask if there is a way of controlling all Adobe Software updates for my network. Similar to how you can

  • 2 entries deleted in PROJ table

    Hi Gurus, 2 enteries in the PROJ table got deleted (not sure how it got deleted) and it caused failure in BI process chain during infopackage loading for WBS hierarchies because of inconsistency. The childrens entries exist in PRPS table and they sti