Report Sales Per Customer

Hello to all!
i have a requirement to make a query that will bring me report for Sales Per Customer
the desired fields are the following
CardCode
CardName
--, (Select sum(T6.LineTotal) from inv1 t6  where t6.docentry=t0.docentry) 'Price Bef. Disc.'
, (Select t5.linetotal from inv3 t5 where t5.docentry=t0.docentry and t5.expnscode in ('6','7')) as 'Freight'
--, (Select t5.linetotal from inv3 t5 where t5.docentry=t0.docentry and t5.expnscode='11') as 'W/TAX'
VatSum
.DocTotal
SlpName
till now i have written the following code
SELECT t0.docdate as 'Doc. Date', t0.docnum as 'Doc No.', T0.CardCode AS 'Customer Code', T0.CardName as 'Customer Name', (Select sum(T6.LineTotal) from inv1 t6 where t6.docentry=t0.docentry) 'Price Bef. Disc.', (Select t5.linetotal from inv3 t5 where t5.docentry=t0.docentry and t5.expnscode in ('6','7')) as 'Freight', (Select t5.linetotal from inv3 t5 where t5.docentry=t0.docentry and t5.expnscode='11') as 'W/TAX',T0.VatSum,  sum(T0.DocTotal) 'Doc. Total', T1.SlpName as 'Account Manager' FROM OINV T0 INNER JOIN OSLP T1 ON T0.SlpCode = T1.SlpCode inner join ocrd t2 on t0.cardcode=t2.cardcode inner join ocrg t3 on t2.groupcode=t3.groupcode WHERE (T0.DocDate between '[%0]' and '[%1]')
group by T0.CardCode, T0.CardName, T1.SlpName, t0.docnum, t0.totalexpns, t0.docentry, t0.docdate,T0.VatSum
union
SELECT t0.docdate as 'Doc. Date', t0.docnum as 'Doc No.', T0.CardCode AS 'Customer Code', T0.CardName as 'Customer Name',(Select (-1)*sum(T6.LineTotal) from rin1 t6 where t6.docentry=t0.docentry) 'Price Bef. Disc.', (Select (-1)*(t5.linetotal) from rin3 t5 where t5.docentry=t0.docentry and t5.expnscode in ('6','7')) as 'Freight', (Select (-1)*(t5.linetotal) from rin3 t5 where t5.docentry=t0.docentry and t5.expnscode='11') as 'W/TAX', (-1)*T0.VatSum, (-1)*sum(T0.DocTotal) 'Doc. Total',T1.SlpName as 'Account Manager' FROM ORIN T0 INNER JOIN OSLP T1 ON T0.SlpCode = T1.SlpCode inner join ocrd t2 on t0.cardcode=t2.cardcode inner join ocrg t3 on t2.groupcode=t3.groupcode WHERE (T0.DocDate between '[%0]' and '[%1]')
group by T0.CardCode, T0.CardName, T1.SlpName, t0.docnum, t0.totalexpns, t0.docentry, t0.docdate,T0.VatSum
but i would like only once to be displayed each customer
do you have any idea?

issue resolved
SELECT
T0.CardCode AS 'Customer Code'
, T0.CardName as 'Customer Name'
,(select sum(t5.linetotal) from inv1 t5 INNER JOIN oinv T6 ON T6.DOCENTRY=T5.DOCENTRY where t6.cardcode=t0.cardcode and t5.docdate between '[%0]' and '[%1]') 'Price Bef. Disc.'
,(Select sum(t7.linetotal) from inv3 t7 inner join oinv t6 on t6.docentry=t7.docentry where t6.cardcode=t0.cardcode and t7.expnscode in ('6','7') and t6.docdate between '[%0]' and '[%1]') as 'Freight'
,(Select sum(t7.linetotal) from inv3 t7 inner join oinv t6 on t6.docentry=t7.docentry where t6.cardcode=t0.cardcode and t7.expnscode ='11' and t6.docdate between '[%0]' and '[%1]') as 'W/TAX'
,(select sum(t8.vatsum) from oinv t8 where t8.cardcode=t0.cardcode and t8.docdate between '[%0]' and '[%1]') as 'VatSum'
,sum(T0.DocTotal) 'Doc. Total'
, T1.SlpName as 'Account Manager'
FROM OINV T0
INNER JOIN OSLP T1 ON T0.SlpCode = T1.SlpCode
WHERE (T0.DocDate between '[%0]' and '[%1]')
group by T0.CardName, T1.SlpName,T0.CardCode
union
SELECT
T0.CardCode AS 'Customer Code'
, T0.CardName as 'Customer Name'
,(select sum(t5.linetotal) from rin1 t5 INNER JOIN orin T6 ON T6.DOCENTRY=T5.DOCENTRY where t6.cardcode=t0.cardcode and t5.docdate between '[%0]' and '[%1]') 'Price Bef. Disc.'
,(Select sum(t7.linetotal) from rin3 t7 inner join orin t6 on t6.docentry=t7.docentry where t6.cardcode=t0.cardcode and t7.expnscode in ('6','7') and t6.docdate between '[%0]' and '[%1]') as 'Freight'
,(Select sum(t7.linetotal) from rin3 t7 inner join orin t6 on t6.docentry=t7.docentry where t6.cardcode=t0.cardcode and t7.expnscode ='11' and t6.docdate between '[%0]' and '[%1]') as 'W/TAX'
,(select sum(t8.vatsum) from oinv t8 where t8.cardcode=t0.cardcode and t8.docdate between '[%0]' and '[%1]') as 'VatSum'
,sum(T0.DocTotal) 'Doc. Total'
, T1.SlpName as 'Account Manager'
FROM orin T0
INNER JOIN OSLP T1 ON T0.SlpCode = T1.SlpCode
WHERE (T0.DocDate between '[%0]' and '[%1]')
group by T0.CardName, T1.SlpName,T0.CardCode

Similar Messages

  • Sample Report: Sales per Customer by Period - WITH QUANTITIES

    I am trying to make some modifications to the 'Sales per Customer by Period'  sample report, but am having problems. I want it to be YTD and comparative, so YTD-12. That part was easy enough. Then I wanted to add the quanty. So i want the report to show the sales amount and quantity for each customer, ytd and prior year ytd. This seemed easy enough also, until I looked further into the data. It doesn't match up with reports from Business One. The problem seems to be my items that are packs, like an item that is sold in packs of 10. If the invoice has 10 10 Packs on an invoice, my report shows a quantity of 10. The SBO report shows it as a quantity of 100 (10x10). I have tried to add Item level stuff, so I could go get the 'Items per Sales Unit' value and multiply it by the quantity. When I do this the report crashes.
    Does anyone have any suggestions? Has anyone created a report like this? Any help would be appreciated.

    Hi,
    What is your B1 version and PL? Is this a Crystal Report or PLD?
    Thanks,
    Gordon

  • Report as per Customer Account Assignment group or Material Account Assig

    Hi,
    I require report as per customer account assignment group or material account assignment group.
    Can you please tell me how to fullfill this requiremetn.
    I have go for ZReport or any standard report is available.
    Regards,
    ch.srinivas

    Hi,
      You could have gone for a query but unfortunately,you cannot use table TSTMT in a query so I think ZREPORT would be a better option.
    Regards
    Karan

  • Sales report per Customer Hierarchy

    Hello
    We manage the credit of some customers by Customers Hierarchy, this is, we assign the credit limit to the main customer, and then, that credit could be used by the dependent nodes.
    Does anyone know if there is a report where we could check the sales per main customer, that includes the sales of the dependent nodes?
    Thank you in advance

    Enrique
    Can you not see it in the field 'Credit exposure' for the main customer in transaction FD33?
    You should get the cumulative exposure there.
    If not use VA05 or VA05n and create a variant for each hierarchy with all the customers and get a full listing with total sales.
    or you can use SIS to perform Standard Analysis for customer ( T code MCTA) and create a variant here again with all the customers in a hierarchy.
    Does it work?

  • Finding brand penetration per customer for sales representative

    Material-Brand-----Sales-Rep----Customer
    GW--XYZ--
    Super-Cuts
    SE--XYZ--
    Super-Cuts
    GW--XYZ--
    Super-Cuts
    SE--ABC--
    Scissors
    GW--ABC--
    Scissors
    Wella--ABC--
    Scissors
    Wella--XYZ--
    Colors-and-Cuts-Salon
    GW--XYZ--
    Colors-and-Cuts-Salon
    SE--XYZ--
    Colors-and-Cuts-Salon
    SE--ABC--
    Planet-Beuty
    Wella--ABC--
    Planet-Beuty
    Kadus--ABC--
    Planet-Beuty
    Clariol--ABC--
    Planet-Beuty
    SE--ABC--
    Planet-Beuty
    Clariol--ABC--
    Planet-Beuty
    Wella--XYZ--
    Colors-and-Cuts-Salon
    GW--XYZ--
    Colors-and-Cuts-Salon
    SE--XYZ--
    Colors-and-Cuts-Salon
    Clariol--XYZ--
    Colors-and-Cuts-Salon
    the requirement is to find the brand penetration which
    is defined as  average no of brands per customer for a sales representative.
    in the above case XYZ is having two customer super cuts and color and salon
    XYZ----
    Brand pentration
    Super-Cuts--     2--(NO-OF-DIFFERENT-BRAND)
    Color-and-Cuts-Salon----
    4
    Average-Brand-Penetration-per-Account----
    3
    ABC----
    Brand-Penetration
    Planet-Beauty--4--(NO-OF-DIFFERENT-BRAND)
    Scissors----
    3
    Average-Brand-Penetration-per-Account----
    3.5
    THE REPORT LAYOUT SHOULD BE
    SALES-REP-----BRAND-PENTRATION
    XYZ----
    3
    ABC----
    3.5
    HOW  this requirement can be achieved in bex 3.5?
    Edited by: Omprakash Mishra on Jun 27, 2008 5:53 AM

    Hi praveen,
                     Actually this is much complex report .
                     there are many other complex key figures along with it .
                     i have just published a part of it as i am unable to find solution for it.
                     it is just an example so that people can understand it easily.

  • Report to show customer without sales rep

    Dear Experts.
    Is there anyway or any report to show customer that don't have sales rep tag to it in Partner Function?

    Hi Nehemiah -
    I know this is very painful but if volume of customer is less then use following method -
    1.Extract all Sold to Party's and their sales area in separate sheet
    2.Create a query joining KNA1 and KNVP where partner function (PARVW) = PE ( or partner function of  Sales Rep).Download Sold to and its sales area in another sheet.
    3.Now using excel compare both sheets by Vlookup and extract the customers from Step 1 which are not present in Step 2.
    If the volume of customer is very large,then we can also use MS Access Queries otherwise we can simply write an ABAP Program.
    Let us know, if you need more explanation on any of the method explained above.
    Thanks & Regards
    Amit Gupta

  • Can i view customer report as per the business area wise , region-wise how?

    can i view customer report as per the business area wise , region-wise how?

    Hi,
    You can view the report business area wise, extract the report and go to dynamic selection and selection business area. When the report is display just sub total on business area. System is showing report as per your requirement.
    Regards,
    Pankaj

  • FI-AR-CR Customer Sales per Credit Control Area

    Hi,
    Do you know any table or funtion that may calculate the Customer Sales Volume per Credit Control Area? I need to calculate a customer specfic DSO (Day Sales Outstanding) figure. The standard AR Summary doesn't return such information. This nay be obtained via BSEG, but it requires a complex query.
    I have found the function module CUSTOMER_BALANCE, but it returns customer sales per company code, which still requires additional calculation to totalize the balances for all the company codes that belong to a credit control area which the customer is assigned to.
    I appreciate any input that may provide a simplier solution for this question.
    Thanks and regards.
    Gonçalo

    Hi,
    I have decided to use the function module CUSTOMER_DSO_CALCULATION, and I will try get the sales volume from some internal variable that this FM uses to calculate the standard DSO. Then I'll store it on a  Z table in order to compute the new specific DSO
    Thanks and regards,
    Gonçalo

  • Sales BOM per customer

    This might be a strange question but still. We have a customer who ships out pallets and crates to their customers. They want to be able to track these items of course and bill the customers according to the number of items they received. N.B. these items are not returned so returnable packaging is out of the question.
    We are looking at the use of a sales BOM so we can calculate the number of pallets and crates per sales order and delivery based on the number of finished products they ship out and of course create an invoice where these items are listed as part of the delivery with the actual costs. This works quite satisfactory BUT it will only work when either all customers use the sales BOM or all customers do not use the sales BOM.
    What's the problem, as this is a new process, they will not be able to convince all customers to directly pay for pallets and crates that are being shipped out. We are now facing the problem that for part of the customers they want to use a sales BOM and invoice them for the pallets and crates they receive BUT for part of the customers they do not want to invoice them for the pallets and crates they receive. This means that we are looking for a way where we can indicate, per customer, whether to use a sales BOM (ship out and invoice pallets and crates) or not to use a sales BOM (do not logically ship out and invoice pallets and crates).
    Is this possible yes or no? Maybe with a user exit that checks for a specific field in the customer master? We have already defined two sales BOM's per material, one where pallets and crates are used and one without pallets and crates so we could mis-use the alternative sales BOM principle, but we still need a trigger to call either sales BOM.
    Any help would be appreciated.

    Hi Roberto and Biju,
    We looked at both options but neither are workable. Not all warehouses use HUM because not all warehouses are their own warehouses, some are from logistics service providers who have not SAP access, otherwise the problem would be a bit easier, plus the customer does not use packing and will not use packing in the future.
    The dynamic product proposal was a bit more promising but also there, we encounter a problem because we cannot make a calculation on the number of crates and pallets shipped out to a customer, which is one of the requirements.
    The problem still lies in the fact that
    - Customer A does not want a bill for crates and pallets and therefore does not want to see the items on the delivery and the invoice.
    - Customer B does want a bill for crates and pallets and therefore needs a calculation for the number of pallets and crates he received.
    We cannot set a field somewhere that says customer A without these items, customer B with these items and then trigger something else.
    Thanks for the help but we still haven't solved the problem.

  • Need P&L and B/S report per customer

    Hello Experts,
    Client wants P&L and B/S report for each customer.
    Is there any standard report to get it
    or
    Can we use Customer Fields available under SPRO--> Financial Accounting Global Settings (New) --> Ledgers --> Fields --> Customer Fields -->Edit Coding Block?
    Thanks in advance for you valuable suggestions.
    Regards
    Kiran
    Moderator: Please, search before posting

    I never come across such P&L and B/S. I wonder whether such things does really exists?
    P&L is prepared for business but not per each customers. This shows the profit or loss for a particular period.
    Balance Sheet is a position statement showing the assets and liabilities on a particular date.
    Ask your client to check the fundamentals of accountancy.

  • Reporting of unused customer master data

    Hy experts.
    I have to fulfil one issue: There should be many unused/redundant customer master data on our system.
    Do anyone knows an report, which shows all unused/unbooked customers?
    I have tried RFDUML00 and set the flag "accounts w/o sales", this would work. But one big issue, it doesn't consider archived bookings.
    Thanks a lot
    best regards
    Roland

    Thanks for your answer, but there is still a question open...
    We have 25000 customers with about 1.000.000 postings in BSID and BSAD. If I would run FBL5N I would get a very long list of all postings. Beside this, how can I match this list with the list of all customers?
    The solution would be a generated list with one sum per customer. If I would have such a list, it won't be a problem to compare this with the list of all customers in Excel. But up to now, I do not find any list, which would offer this information for all years.
    Regards
    RoBr

  • 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

  • REPORT-Sales Order Qty minus Delivery Qty

    How to find Sales Order Qty minus Delivery Qty  in a STd report  other than t.code v.02
    THanks in advance
    Paul

    Dear Paul
    The report which you are asking is a Pending Order Report.
    You  better go for a Zreport & call your required fields in the report.
    The selection field will be plant
    Eg: You can incorporate in the report Sales Doc, Order type, Doc date, SP, SH, Region, sales area, material code, material description, Order qty, Pend qty, Pending value, pant, PO ref no., date, Customer currency etc.
    Once all items delivered the doc number wont be in the report.
    Regards
    Deepu Pillai

  • AR aging report (summary by customer)

    Hi Experts,
    I would like to ask if how to create an aging report showing only the:
    1. Customer
    2. Credit Limit
    3. Payment Term
    4. Total AR
    5. Due 0-30
    6. Due 31-60
    7. Due 61-90
    8. Not Due
    Hopefully the balance should be the same as with FBL5N. We have around 100 customers and we would like to see in one file only the summary per customer not not really the line items. Thanks.
    I have consumed a lot of time searching for the answers in the forum but I cannot clearly figure out how to proceed. Which tcode do I configure this? Thanks in advance

    If standard report does not suffice your requirement, then create your own.
    FOR vendor USE K in transaction code instead of D.
    Hello,
    The following example I have given is for customers.
    The only difference is in transaction codes. For customer you go to FDI1, for vendor you go to FKI1 (reports).
    For Customer you go to FDI4, for vendor you go to FKI4 for forms.
    Remaining all are the same.
    Hello,
    Go to transaction code FDI4
    Select Form Type RFFRRD20 Line item analysis
    Give your form name and description
    Structure (Two axis) - as defaulted
    Click on Create
    You will have lead column
    Delete the rows 2, 3 and 4
    Double click on column 1
    Enter the customer numbers from 1 to 999999
    First column double click (A)
    Slelect following values
    Due date analysis 1
    Days for net due date 0 to 30
    Give the short name, medium name and long text for the column.
    Repeat this step in next columns like 31 to 60, 61 to 90, 91 to 120 and 121 to 99999 days etc in other columns and select due date analysis 1. (B,C,D,E)
    Create one more column by way of formula. To create a new column you need to double click on blue line. Put formula add all five columns you have created above. (F = ABCDE)
    You prepare one more column with
    Due date analysis 2 (G)
    Now you prepare one more column add (F+G) = This will be total open items = over due and not due.
    Now go to FDI1 and prepare a report - assign the form created in FDI4 to the report.
    Characteristics you need to select are
    Account Type (Select Account Type as D for customers)
    Currency
    Customer
    Document Type
    Special G/L Ind
    Company Code
    Change the output types and options according to your requirement.
    Refer FDI2 and FDI3 for other standard reports created.
    Refer FDI5 and FDI6 for other standard forms created.
    Save your report and execute.
    Regards,
    Ravi

  • Sales per Working Days

    I have a requirement to report the average sales per number of working days in the period. I have created a function module that can access the factory calendar and compute the number of working days in a given year/month and have populated a key figure on each record with the number of work days in the period the transaction took place in.
    When I display the number of working days by year/period in a report of course it adds up the days from each transaction and gives false numbers. This seems like it should be a no brainer, but I can't find an easy solution. Can anyone help me with displaying the correct number?
    Thanks in advance.

    Hi
    Try this logic:
    create an avarage Working Days KF1.
    its the working days / Rec Count.
    This KF if you group on CalYearMonth will show the sum
    of the numbers for that motnh.
    then if you want you can take KF1 and create another KF,
    lets say KF2 that is total Sales / KF1.
    I hope it helps.
    Reg's
    Edan

Maybe you are looking for

  • How to sync my iphone 4 (which is synced on my laptop currently) with my home computer where I also sync my iPad 2 without losing the data on my iphone 4?

    Hi there.  I have an iphone 4, which is currently synced with itunes on my laptop.  I also have an ipad 2 which is currently synced with a more powerful and storage capable home computer.  I would like to know if there is a way to sync my iphone 4 wi

  • Sudden change of font settings!?

    EDIT:  Original problem with orage and other fonts fixed.  My current problem relates to Chromium and certain other type in apps like Thunar.  Here's a shot of that.  The huge fonts are what I want to bring down to my system standard (bitstream vera

  • Inspection Type 05 require input purchase order number for rejection

    Hi Experts, I have inspection and needed to reject in QA12. When inputting the stock posting quantity to return, it prompts the reason for rejection, and required to input purchase order number also. Since that is material return from production(insp

  • Whats a String constant pool?

    I was reading an article about weak references and came across a peice of code    Map<String,String> map = new WeakHashMap<String, String>();       map.put(new String("Scott"), "McNealey");They also said if you don't call new String(), the reference

  • HP Support Forum Ranking Overview

    Welcome to the forum! We use an academic theme for the ranking structure in our community.  You rank is right by your Forum name in your posts. Ranks represent the contribution that a member has made to the community.  As you spend more time on the F