Report for Sales Comparison

Hi Guys,
I need a report in the below format for a given date range
DOC NO1===DOCDATE1===NUMATCARD 1===CARD CODE1===CARD NAME1===TAXCODE1===TAXAMOUNT1== DOCTOTAL1
DOC NO2===DOCDATE2===NUMATCARD 2===CARD CODE2===CARd NAME2===TAXCODE2===TAX AMOUNT2 == DOCTOTAL2
DOC NO3==DOCDATE3==NUM AT CARD 3==CARD CODE3 == CARD NAME3 == TAXCODE 3=== TAX AMOUNT3 == DOCTOTAL3
DOC NO N==DOCDATE N==NUM AT CARD N==CARD CODE N == CARD NAME N == TAXCODE N == TAX AMOUNT N == DOCTOTAL N
EACH INVOICE NUM AND DOC TOTAL TO BE APPEAR ONCE
Thanks in advance,
Regards,
Vamsi

Hi Vamsi,
You can use an almagamation of Gordons query and Jrajput post to give you the query.  You can also add DISTINCT after the word SELECT.
Incidentally, the WHERE section would be something like:
WHERE T0.DocDate >= \[%0\] AND T0.DocDate <= \[%1\]
One point to mention though, if you use multiple VAT codes on one invoice then you will get multiple lines with each line showing the full DocTotal against each VAT Code which ultimately will over inflate the sum of the DocTotal column.  If you want that then you may need to get the DocTotal (LineTotal) and VAT Total (not sure of field name without looking) from the INV1 table instead.  Alternatively,if you remove the VAT Code column then you can get everything you need from the OINV table.
Regards,
Adrian

Similar Messages

  • Centralised Report for Sales/Purchase

    Hi guys,
    One of my client needs a Centralised report for Sales & Purchase for a particular period .
    Like we are mainting multiple taxcodes  like
    BED,eCess,HeCEss,
    VAT 4,VAT 2,VAT12.5,
    VAT10.3,TAXEXEMPTED,ETC...
    So every month they need to know total sales and purchase value in a single report to be displayed respective of each tax code
    lie
    Taxcode 1 = tax Value1,total value
    Taxcode 2 = tax value 2,total value
    Total Sales value = Sum of all tax values, sum of total values
    Total Purchase value = Sum of all tax values, sum of total values
    And  needs Item Wise Sales For Each customer.
    I tried in system defined Sales and Purchase analysis report but our client needs the above type of report..
    Pls give us some solution for this..
    Regards,
    Vams

    Hi VamSam......
    Try the below query for purchase details alongwith tax amt.....
    SELECT T0.[DocNum], T0.[DocDate], T0.NumAtCard As 'Bill No.', T0.[CardName], T1.[Dscription], T1.[Quantity], T1.Price As 'Rate', T1.[LineTotal] As 'Value', T0.[DocTotal] As 'Total Value', (ISNULL((SELECT SUM(T2.QUANTITY) FROM rpc1 T2 WHERE T2.DocEntry=T0.DocEntry),0)) RetQTY, (ISNULL((SELECT SUM(T2.LineTotal) FROM RPC1 T2 WHERE T2.DocEntry=T0.DocEntry),0)) RetValue, (isnull((SELECT SUM((case when upper(t4.STACode) like 'BED%' then T4.TaxSum else 0 end))
          FROM PCH4 T4 WHERE T4.DocEntry=T0.DocEntry ),0)) ExciseDuty,
         (isnull((SELECT SUM((case when upper(t4.STACode) like 'eCess%' then T4.TaxSum else 0 end))
          FROM PCH4 T4 WHERE T4.DocEntry=T0.DocEntry ),0)) ECess,
         (isnull((SELECT SUM((case when upper(t4.STACode) like 'hes%' then T4.TaxSum else 0 end))
          FROM PCH4 T4 WHERE T4.DocEntry=T0.DocEntry ),0)) HEdCess, (isnull((SELECT SUM((case when upper(t4.STACode) like 'VAT%' and t4.TaxRate=12.5 then T4.TaxSum else 0 end))
    FROM pch4 T4 WHERE T4.DocEntry=T0.DocEntry ),0)) As 'VAT12.5',
    (isnull((SELECT SUM((case when upper(t4.STACode) like 'VAT%' and t4.TaxRate=4 then T4.TaxSum else 0 end))
    FROM pch4 T4 WHERE T4.DocEntry=T0.DocEntry ),0))VAT4, (isnull((SELECT SUM((case when upper(t4.STACode) like 'VAT%' and t4.TaxRate=2 then T4.TaxSum else 0 end))
    FROM pch4 T4 WHERE T4.DocEntry=T0.DocEntry ),0))VAT2, (isnull((SELECT SUM((case when upper(t4.STACode) like 'CST%' and t4.TaxRate=2 then T4.TaxSum else 0 end))
    FROM pch4 T4 WHERE T4.DocEntry=T0.DocEntry ),0)) As 'CST2',
    (isnull((SELECT SUM((case when upper(t4.STACode) like 'CST%' and t4.TaxRate=4 then T4.TaxSum else 0 end))
    FROM pch4 T4 WHERE T4.DocEntry=T0.DocEntry ),0)) As 'CST4', T2.TransCat As 'Form No.'  FROM OPCH T0  INNER JOIN PCH1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN PCH12 T2 ON T0.DocEntry = T2.DocEntry WHERE (T0.[DocDate]>='[%0]' and T0.[DocDate]<='[%1]')
    Regards,
    Rahul

  • How to create a daily report for sales order

    hi
    how to create a daily report for sales order. what fields it must consists of. what are the tables it need?

    Hi
    You have to use the sales order tables VBAK,VBAP and VBEP
    So keep date field on selection screen
    and treat this date as Order creation data audat field in VBAK.
    based on this fetch the data from VBAK and VBAP  with the following fields like
    VBELN, KUNNR,NETWR,POSNR, MATNR,ARKTX,KWMENG,WAERS  etc and display in the report
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • Report for sales target & Production target

    Report for sales target & Production target which should include the following fields
    Sales Target
    Revised Sales Target
    Production Target
    Revised Production Target
    Action Need to be taken

    Hi
          If you are using sales and operation planning in make to stock scenario its simple . As You input target sale plan and target production plan for whole one year (MC84) . So this data can be pulled out from the tables .
    For Action Need to be taken and revision you may need to have new table .
    Neal

  • Standard report for sales history.

    hi,
        i need a standard report for sales history(all sales order ) for my company code. in va05 transaction it shows only for sales area. give the tcode .
    regards
    muthuraman.d

    Hi,
    There is no standard report for sales order list on the basis of company code.u have to develop it.
    OR
    Create report with SAP Qury
    OR
    u can us VA05N tcode >>> Speciefy sales organization from - to (all sales organizations from one company code).
    Kapil

  • To build some Custom reports for Sales and Distribution

    I want to build some Custom reports for Sales and Distribution.
    I do not know how to do that.
    I reviewed lots of threads earlier, but couldnt understand how to do that.
    If any one can send me suitable step by step guide, I will really appreciate it.
    Or send me some link or some documents with couple of nice exampples of how to do that.
    Which setting to make in B  ex and everything.
    I am new to BI.
    Please advise.
    Points will be awarded

    Hi,
    Could you be more specific about your requirement. I could understand that you wanted to know what all are the Customer sales reports could be provided in SD.
    Generally irrespective of projects few reports are considered as baseline reports for any SAP implementations.
    For example: 1. Order intakes daily
                          2. Order intakes monthly
                          3. Order magin (daily,monthly)
                         4. Order analysis.
    Best regards.

  • Crystal Report for Sales, Delivery and Payment.

    Hi Guys,
    Need some expert advice over here. Currently, our sales team are using 3 separate report, one report on sales per month for each specific customers, one report on delivered amount per month for specific customers again and the last one report on payment received per month for specific customers as well.
    We have the idea of joining this 3 report so that I can report on sales, delivery and payment all at once so that they can see the trend better. However, after trying for quite a few times, we fail to create a common joining between ORDR, ODLN and ORCT. Is there any possible way to work something out ?
    I have thought of using subreport, but I just cant find the way to plug in the figure correctly.
    Need some advice over there.
    Thank you.
    Best Regards,
    Alex

    Based on what you have told me, then you should then join Sales Order, Delivery, Invoice and Incoming Payments into one.
    The reason I say Invoice table also is because, you cannot directly link Delivery and Incoming Payments window.
    Also you it is not enough that you link the ORDR, ODLN and ORCT, you will need to get the details from RDR1 and DLN1.
    In SAP Business One, each line in SAP Business One can have a different Delivery documnet.
    The TrgetEntry, TargetType will give you this information. For example, if a line for Sales Order has TargetType 15, then TrgetEntry will be the DocEntry in the ODLN. But if it TargetType is 13 it means the Sales order was converted directly to and Invoice and bypassed the creation of Delivery step, which is possible in SAP.
    So here is how I think you will need to link Sales order and Delivery
    RDR1.TrgetEntry INNER JOIN DLN1.DocEntry AND
    RDR1.TargetType INNER JOIN DLN1.ObjType AND
    RDR1.LineNum INNER JOIN DLN1.BaseLine
    Now this could get a little more complicated if you do partial deliveries. For example if a line in your Sales Order has say 10 items and 6 of them are delivered using Delivery Note 123 and the remaining are delivered using Delivery Note 124, then the join will give you 2 different lines.
    So basically you will need to link the tables in this fashion
    ORDR <-> RDR1 <-> DLN1 <-> INV1 <-> RCT2 <-> ORCT
    Unfortunately, this linking process can get complicated if you do not follow certain steps, like for example if you do not create a Delivery Note and converted your Sales order to Invoice. Then the link would be
    ORDR <-> RDR1 <-> INV1 <-> RCT2 <-> ORCT
    I hope I didn't confuse you.
    Krishnan

  • Report for Sales and purchase tax (selection criteria-Tax code)

    Hi
    I have one query for sales tax details which gives me detail for all A/R invoices and taxes involved in it. But i want that while executing query system should ask tax code and gives detail of tax amount in front of item and invoice according to tax code selected.
    The query is:
    SELECT M.DocNum AS 'Inv.No ', M.DocDate as 'Date', M.CardName as 'Customer Name',L.Dscription,L.Quantity,L.Price, (Select Sum(LineTotal) FROM INV1 L Where L.DocEntry=M.DocEntry) as 'Base Amt.(Rs.)', (SELECT Avg(TaxRate) FROM INV4 where statype=1 and DocEntry=M.DocEntry) as ' VAT % ', (SELECT Sum(TaxSum) FROM INV4 where statype=1 and DocEntry=M.DocEntry) as ' VAT (Rs.) ', (SELECT Avg(TaxRate) FROM INV4 where statype=4 and DocEntry=M.DocEntry) as ' CST % ', (SELECT Sum(TaxSum) FROM INV4 where statype=4 and DocEntry=M.DocEntry) as ' CST (Rs.) ', (SELECT Avg(TaxRate) FROM INV4 where statype=7 and DocEntry=M.DocEntry) as ' TAXEXEMPT % ', (SELECT Sum(TaxSum) FROM INV4 where statype=7 and DocEntry=M.DocEntry) as ' TAXEXEMPT ', (SELECT Avg(TaxRate) FROM INV4 where statype=8 and DocEntry=M.DocEntry) as ' VAT% ', (SELECT Sum(TaxSum) FROM INV4 where statype=8 and DocEntry=M.DocEntry) as 'VAT12.5 ', (SELECT Avg(TaxRate) FROM INV4 where statype=9 and DocEntry=M.DocEntry) as ' CST 2% ', (SELECT Sum(TaxSum) FROM INV4 where statype=9 and DocEntry=M.DocEntry) as ' CST @2 ', (SELECT Avg(TaxRate) FROM INV4 where statype=11 and DocEntry=M.DocEntry) as ' CENVCST % ', (SELECT Sum(TaxSum) FROM INV4 where statype=11 and DocEntry=M.DocEntry) as ' CENVCST ', (SELECT Avg(TaxRate) FROM INV4 where statype=-90 and DocEntry=M.DocEntry) as ' BED % ', (SELECT Sum(TaxSum) FROM INV4 where statype=-90 and DocEntry=M.DocEntry) as ' BED ', (SELECT Avg(TaxRate) FROM INV4 where statype=-60 and DocEntry=M.DocEntry) as ' Cess% ', (SELECT Sum(TaxSum) FROM INV4 where statype=-60 and DocEntry=M.DocEntry) as ' Cess ', (SELECT Avg(TaxRate) FROM INV4 where statype=-55 and DocEntry=M.DocEntry) as ' HCess % ', (SELECT Sum(TaxSum) FROM INV4 where statype=-55 and DocEntry=M.DocEntry) as ' Hcess ', L.LineTotal as 'Row Total (Rs.)',M.DocTotal as 'Doc Total' FROM OINV M LEFT OUTER JOIN INV1 L on L.DocEntry=M.DocEntry LEFT OUTER JOIN INV4 T on T.DocEntry=L.DocEntry and L.LineNum=T.LineNum LEFT OUTER JOIN INV5 J ON M.DocEntry = J.AbsEntry LEFT OUTER JOIN INV3 Q ON M.DocEntry = Q.DocEntry WHERE (M.DocDate >= '[%0]' AND M.DocDate <= '[%1]') AND TargetType ! = 14 GROUP BY M.DocNum,M.DocDate,M.CardName,M.NumAtCard,M.DocEntry,M.DiscSum,M.WTSum,L.Dscription,L.Quantity,L.Price,L.LineTotal,M.DocTotal ORDER BY M.DocNum,M.DocDate,M.CardName,M.NumAtCard,M.DocEntry,M.DiscSum,M.WTSum,L.Dscription,L.Quantity,L.Price,L.LineTotal,M.DocTotal
    I want 2 queries which asks tax code during selection criteria for both cases sales and purchase.

    Hi Malhotra,
    Try this,
    1st remove the FROM/TO Doc. Date where Condition in your Query report.
    AND add the below where condition in your Query report.
    WHERE statype = '[%0]'
    OR
    Try this Query Report.
    SELECT
    M.DocNum as 'A/R Invoice No.',
    M.DocDate as 'Inv. Date',
    M.CardCode as 'Customer Code',
    M.CardName as 'Customer Name',
    M.NumAtCard as 'Bill No. & Date',
    ISNULL(L.ItemCode,'Service Item') as 'Item Code',
    L.Dscription,
    L.Quantity,
    L.LineTotal,
    L.TaxCode,
    L.[VatSum],
    M.WTSum AS 'TDS (Rs.)',
    M.DocTotal as 'Total (Rs.)'
    FROM OINV M
    LEFT OUTER JOIN INV1 L on L.DocEntry=M.DocEntry
    LEFT OUTER JOIN INV4 T on T.DocEntry=L.DocEntry and L.LineNum=T.LineNum
    LEFT OUTER JOIN INV5 J ON M.DocEntry = J.AbsEntry
    LEFT OUTER JOIN INV3 Q ON M.DocEntry = Q.DocEntry
    WHERE
    (M.DocDate >= '[%0]' AND M.DocDate <= '[%1]')
    AND
    L.TaxCode='[%2]'
    GROUP BY
    M.DocNum,M.DocDate,M.CardCode,M.CardName,M.NumAtCard,L.ItemCode,L.Dscription,L.Quantity,
    L.LineTotal,M.DocEntry,M.[DiscSum],L.TaxCode,L.[VatSum],M.WTSum,M.DocTotal
    ORDER BY
    M.DocNum,M.DocDate,M.CardCode,M.CardName,M.NumAtCard,L.ItemCode,L.Dscription,L.Quantity,
    L.LineTotal,M.DocEntry,M.[DiscSum],L.TaxCode,L.[VatSum],M.WTSum,M.DocTotal
    Regards,
    Madhan.

  • Report for Sales orders with the consumed credit limit value

    Dear Gurus,
    In my company, the credit check is at sales order level. We want a report which shows up the credit value consumed from the credit master by Sales order.
    Going into the details, Say Credit limt is setup for a customer at Credit master for 10000 $.
    I want a report showing Sales order 59235 has consumed 500 $, Sales order 59277 has consumed 1500 $, Sales order 59333 has consumed 2500 $.
    Is their a report in standard SAP for the above functionality. If not, any ideas of how to achieve it?
    Thank you for your responses.
    Regards,

    Hi,
    Try the following transaction codes
    S_ALR_87012218
    FDK43
    F.31
    But if you want to a report like what you explained in thread i think in standard not available we need to develop a customized one.
    Regards

  • Report for sales order

    I need to create a report for all sales order that have line items with a Material Tax Class '2' - One time exemption. Tax will require a report that identifies/displays all line items with Tax Classification = '2'.
    Report layout specifics:
    Bill-To
    Ship-To
    Order No.
    Tax classification
    Internal Item Notice Text.
    For bill-to, ship-to, order no are all fields of structure KOMK, but I need to know which table it comes from so I retrieve the data by a select statement to display this. Can anyone guide me on this ? Thanks in advance !!!
    Nimesh

    I dont know where that tab is either. I will have to find out and let you know. For now I just left it out and I have written the following code - please let me know if this looks right according to the requirement.
    REPORT ZMAT_TAX_REPORT .
    TABLES: VBAK, VBPA, VBAP, MLAN, KOMK.
    DATA: begin of jtab occurs 0,
            kunnr like vbak-kunnr,
            vbeln like vbak-vbeln,
            parvw like vbpa-parvw,
          end of jtab,
          wa_vbak like vbak occurs 0 with header line,
          wa_vbpa like vbpa occurs 0 with header line,
          wa_vbap like vbap occurs 0 with header line.
    PARAMETERS: TAXM1 like MLAN-TAXM1 default '2'.
    select single taxm1 from vbap into vbap-taxm1 where TAXM1 = MLAN-TAXM1.
    if sy-subrc eq 0.
      if vbap-taxm1 = '2'.
        select single * from vbak into wa_vbak
                        where kunnr = komk-kunre.
        select single * from vbpa into wa_vbpa
                        where parvw = komk-kunwe.
        select single * from vbap into wa_vbap
                        where taxm1 = mlan-taxm1.
        move wa_vbak-kunnr to jtab-kunnr.
        move wa_vbak-vbeln to jtab-vbeln.
        move wa_vbpa-parvw to jtab-parvw.
      endif.
      if sy-subrc eq 0.
        if not jtab[] is initial.
          write:/(95) sy-uline.
          format color col_heading intensified on.
          write:/1 sy-vline,
                 2 'Bill-To',
                 21 sy-vline,
                 3 'Ship-To',
                 21 sy-vline,
                 4 'Order No.',
                 21 sy-vline.
          write:/(95) sy-uline.
          loop at jtab.
            write:/1 sy-vline,
                   2 jtab-kunnr,
                   21 sy-vline,
                   3 jtab-parvw,
                   21 sy-vline,
                   4  jtab-vbeln,
                   21 sy-vline,
                   95 sy-vline.
          endloop.
        endif.
      endif.
    endif.

  • URGENT : REPORT for sales register

    Hi Guys,
    Anybody is having the report on sales register? logic follows like this:-
    The logic which needs to be developed is, as per input criteria given by user, which will be sales organization, plant & date range.Program needs to pick all the billing document which will satisfy the above criteria.
    Except for document cateroty N i.e. invoice cancellation (VBRK -VBTYP not equal to N) and which are marked for cancellation (VBRK-FKSTO not equal to
    X)
    From the VBRK table pick up the document condition number (VBRk-KNUMV) and then go to KONV table you will find all condition with value over their. Pick up the values as per condition type and print it. (Condition types are already mentioned in format attached).
    Their are 3 different format they have asked for, the format types will depend on the plant i.e. if plant start with 21 then it is RMC plant and accordingly appropriate format needs to be picked. Please check config for plant descrption.
    By looking at format, i feel that some changes needs to be done into it like their is no material number or descprtion mentioned in format but qty & base rate fields their. Now whether register needs to printed for every line item in invoice or ony one line item for every invoice i.e.
    consoliadted  per invoice number. If it is consolidated then what about base rate which can be different for each line item. In this case what rate needs to be print.
    Always print the invoice values line item by line item, giving each line item quantity, base price, and other pricing conditions but should have facility to sum up     fields like Quantity, Base price, all pricing conditions each customer wise. 
    I have to get this report in ALV format.
    I will reward points for useful answers.
    My mail id is [email protected]
    Waiting for reply...
    Thanks,
    Sundeep.

    Hi
          If you are using sales and operation planning in make to stock scenario its simple . As You input target sale plan and target production plan for whole one year (MC84) . So this data can be pulled out from the tables .
    For Action Need to be taken and revision you may need to have new table .
    Neal

  • Report for Sales Order Change History   CDPOS and CDHDR

    How to take a report of the data for the Sales Order Change history for a particular period of time. It is required to take a report of all the Sales Orders for which the basic price has been changed. Please let me know the procedure. I could not get the data from the table CDPOS and CDHDR
    Helpful answer would be rewarded.
    Regards
    Praveen

    Dear Praveen Kumar
    Have you tried with VBAP where sale order details at item level would be stored.
    Moreover, to my knowledge, there won't be any changes as for as pricing is concerned at sale order level but there is at billing level.  Normally, any price increase / decrease would reflect in billing.  So why dont you to table join through SQVI VBAP (for sale order details) and VBRP (for billing details) so that you can compare the selling price in sale order with billing. 
    Thanks
    G. Lakshmipathi

  • Interactive report for sales order

    how to create an Interactive Report which displays all the sales orders for one particular customer, the materials ordered, quantity ordered, goods issue date of that particular order and contact information about that particular customer.

    http://www.sap-img.com/abap/program-for-sales-order-by-customer-date-sales.htm
    https://forums.sdn.sap.com/click.jspa?searchID=2651341&messageID=1671145.
    Have a look at the demo programs,
    DEMO_LIST_INTERACTIVE_1
    DEMO_LIST_INTERACTIVE_2
    DEMO_LIST_INTERACTIVE_3
    DEMO_LIST_INTERACTIVE_4
    DEMO_LIST_HIDE
    Please give me reward points.
    Regards,
    Murali Poli

  • Standard report for sales order

    HI all
    I would like to know whether there is any standard report for sending confiramtion mail to customers once the shipments are planned.
    Or atleast to track the status of sales order (to find out whether the shipment is planned) so that i can club the mail program with this.

    Hi,
    Check the following links:
    http://sap-img.com/abap/make-e-mail-sender-of-po-the-po-creators-name.htm
    http://sap-img.com/abap/sending-mail-when-the-purchase-order-is-released.htm
    Regards,
    Bhaskar

  • Tcode/report for sales invoices list

    Hi,
    anybody tell me what is the tcode/report for list of invoices in a specific period. ( i tried vf05 but in that payer/material is mandatory i need total list for a particular period.
    regards,
    Lakshmi

    Hi,
    Did you have a look at Transaction VF31 ?
    VF31 -> Output from Billing.
    maybe you can get the required invoice information here.
    Kind Regards
    Edited by: Raymond Friston on Jul 17, 2008 9:02 AM

Maybe you are looking for

  • My Iphone 4s doesn't work in India. says no sim installed. what to do?

    I have bought Iphone 4s from Dubai and it was working fine there. But after i reached India the phone doesnot work. It says no sim installed. what needs to be done to make IPhone working?

  • Class instantiation through mxml - setting properties

    Hi, I'm trying to create a reusable component with an actionscript class. I'd like to be able to set a handful of the class' properties withmxml attributes. So far, I've had no success doing so. I've subset my problem into a separate, simplied projec

  • Not printing in color

    I just downloaded the drivers for my hp officejet 6500 wireless to my macbook pro and it won't allow me to print in color.  All it is says is "last used settings" and "save current settings."  I have pictures I would like to print, but cannot due to

  • Sp;. Procurement Field in Material Master

    Hello I just wanted to know the  relevance of Special Proc field in MRP 2 View of the Material Master. What is the impact of it if we mark it as 20 in case of a Consignment stock material ?? How a Consignment material is treated with this ?

  • Maintain different unit of measure at operation level

    HI I am working on a scenario where I have to maintain product in different units after each operation for a material. like i am working on SFG to get FG in 3 steps. my base unit of measure is lb. I maintain my product after 1st operation in lb, afte