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.

Similar Messages

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

  • How to extract User status for Sales and purchase contracts

    Hello,
    We need to load the User status linked to sales and purchase contract.
    I think that there is no datasource in BI content.
    What is the better solution ?
    - Enhance a standard datasource like 2LIS_11_VASTH with a status field (This solution is not ok for Purchase contract)
    - Create a spécific datasource to extract this status
    - Others
    Thanks for your help
    Best regards
    Christophe

    Hi,
    In your scenario its better to use generic extractor to get the reqd data. This data can than be stored in a DSO on the BI side.
    And you can look up for the user status using a routine .
    Regards,
    Rahul

  • Badi/user exit for sales and purchase order

    HI folks,
    I have to export the value of order type to a memory id for create and change transaction of sales order and the purchase order, I serached a lot for badis in purchase order and created implementation for that, but it didnt work. Please help me out....
    thanks in advance

    Hi,
    As written I need to export the value of order type into a memory id at the moment below transactions are hit:
    va01,va02, me21n, me22n.
    for va01 first u need to enter the order type and then press enter...at this event I need to export its value,
    for va02 the value of order is entered and then press enter,
    similarly I have to export the purchase order type during execution of ME21n and ME22n.
    I hope u will understand the problem better....If not please tell me

  • Is there any ECC report with PurchOrder and Purchase Requisition Selection

    Hi there,
    for one of my BI report reconciliation with ECC requirement, I would like to know how many POs are there without Purchase requisitions, same way want to know how many POs are there with Purchase requisition.
    I know some tables where we can find this info, unfortunately I cannot ask my user to go and check in Tables for Acceptance testing. So I am looking for any standard ECC report with POs and PRs as Columns
    Due to time constraints, I cannot go build any ABAP queries in ECC at the moment,
    Any insights are greatly appreciated.
    Thanks

    Hi Curious ,
    Check if the following link is helpful. The link is from the SDN Wiki for creating a Z Report in R/3 for Purchase Requisition.
    http://wiki.sdn.sap.com/wiki/display/ABAP/PurchaseRequisitionDetail+Report
    Or try the following transactions:
    ME5A - Purchase Requisitions: List Display
    ME53  - Display Purchase Requisition
    ME53N - Display Purchase Requisition
    Hope this helps your cause.
    Regards,
    Kush Kashyap

  • Syntax error while creating tax codes for sales n purchases

    Hi all,
    While creating the tax codes for sales and purchases, i got the below error:
    Report RB13A003 has a syntax error.
    What should be done?
    Thank you

    Hi,
    I believe, it's RV13A003 report and not RB13A003... What is the exact error message (or is it a dump)?
    Regards,
    Eli

  • S_ALR_87012357 report - Advance Return for Tax on sales and purchase

    Hi Friends,
    I would like to know few things in regards the VAT report S_ALR_87012357 report - Advance Return for Tax on sales and purchase:
    (1) What information brings the S_ALR_87012357 report?
    (2) As of now this report displays tax against vendor line item and not expense line item. Is there any other report that shows all the positions lines affected to tax?
    (3) Is it possible that the tax line stays only in the expense line account and not in the vendor line account or not any intercompany line account?
    (4) Is it possible S_ALR_87012357 report shows information about the tax allocanted in expense accounts and not in vendor accounts?
    Appreciate a faster response.
    Thanks in advance.

    Please try report S_ALR_87012359. This report gives you opportunity to choose account selection.
    I am unsure how the SAP is setup in your organisation. S_ALR_87012357 should pick up expenses selection as well.
    This report entirely depends on tax code selection.

  • 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

  • Tax on sales and purchase

    could anybody plz forward me the step-by-step config for "TAX ON SALES AND PURCHASE"- i am facing problem as my config could not calculate taxes
    thanq

    hi
    http://help.sap.com/erp2005_ehp_03/helpdata/EN/cf/540ef7d61a11d2955500a0c929f4c9/frameset.htm
    http://help.sap.com/erp2005_ehp_03/helpdata/EN/76/f3043b39eec71fe10000000a114084/frameset.htm
    http://help.sap.com/erp2005_ehp_03/helpdata/EN/01/a9ca79455711d182b40000e829fbfe/frameset.htm
    for furthur notes
    http://help.sap.com/search/search_overview.jsp
    nagesh

  • Vat or sales and purchase tax

    hi,
    can anyone explain
    1) how purchase tax (input tax) happens and
    2) how sales tax (output tax) happens
    thanks
    rgds

    Hello,
    If you're posting an incoming invoice you must use purchase tax. In FTXP you can define purchase tax with using VST account key. Otherwise If you're posting outgoing invoice you must use sales tax. ın FTXP you can define sales tax with using MWS account key.
    In FTXP give percantage to account key VST for purchase tax (for sales MWS account key) and click Tax account for assigning tax G/L accounts.
    After that for example in FB60, give amount for vendor and G/L item, give tax codes and click calculate tax. In simulation screen you should see the tax calculation.
    I hope it's enough for you.
    Regards,
    Burak

  • Standard reports for materials begning,purchase,sale,closing stock

    Dear Experts,
    Is there any standard report for
    Opening stock
    Purchase
    Sale
    Closing stock
    in terms of QTY and value for all materials.
    regards
    RR

    Hi
    you can use MB5B (with Non hierarchial Display) and MB5L
    br, Ajay M

  • Definig tax codes for sales and procedure

    Hi,
    I am getting an error in definig tax codes for sales and procedures.It's asking for Tax Jurisdiction.But can't accept whatever I enter.Please advice.

    Check availability at SPRO-Financial Accounting (New)-Tax on Sales/Purchases-Basic Settings-Specify Structure for Tax Jurisdiction Code   OR Define Tax Jurisdictions
    Srinivas

  • Tax Conditions for Sales and Distribution using Jurisdiction Code in Canada

    Hello everyone,
    I would like to share with you a doubt relating taxes for Sales and Distribution in Canada.
    The Tax conditions for Sales and Distribution in Canada are the CTX1 (GST - Canada), CTX2 (PST - Canada) and CTX3 (Base + GST). These are the Tax Conditions which appear when creating a Material or a Client for the Canada Region, and are also the ones included in the Canada Standandard Pricing Procedure.
    I tried to apply the standard method of creating a Master Record for these conditions, but an error relating the Jurisdiction Code came out while releasing to accounting.
    Does anyone one how to procceed? Which are the important issues with Finance Accounting to take in to account?
    I would really appreciate any comment relating this issue.
    Thank you very much in advanced.
    Víctor

    Dear Mr. Lakshmipathi,
    In first place, thank you very much for your quick response.
    I have tried many different procedures to get the aim, and among others, a new access sequence was created to allow the introduction of the Jurisdiction Code (UTXJ is not available for Sales Conditions) but once the Condition is created, it is not recognized when creating the Order ("pricing error: Mandatory condition CTX is missing"). Maybe it has something to do with the fact that these conditions are not included in the Finance Accounting Tax Procedure, where the conditions, which represent the same taxes but with different condition names, are defined for a certain Tax Code and Jurisdiction code.
    Among the different SAP notes for the error relating the Jurisdiction code, there was one proposing to change the Condition Category from "D" (Taxes) to a value between "1 and 4". By doing this a new error appears while creating the order, saying that there are conditions in the Tax procedure (JRC1, JRC2)which are not included in the Sales Pricing procedure. By including this conditions in the Pricing procedure, the Tax Conditions existing in the Finance Accounting Tax Procedure are brought to the Order Conditions, in addition to the Sales Tax Conditions. And there is something more, each Tax Condition from the Finance Accounting Procedure appears twice, one with the application V (Sales) with value zero, and one with application TX (Taxes) with the value existing in the Finance Accounting Taxes Procedure. This is how at the end, the corresponding %value of the taxes is brought to the Invoice with the correct Tax Code, and the proper Jurisdiction Code, which is different for each condition.
    Thank you very much for your time.
    Víctor Liedo

  • Getting the default zero-rated sales and purchase tax codes

    Hi,
    Does anyone know how to obtain the default zero-rated sales and purchase tax codes? ie the tax exempt sale and purchase tax codes.  The OADM holds the default sales and purchase tax codes but not the default zero-rated sales and purchase tax codes. Is this set by region?
    Lita

    Hi Lita,
    I don't know much about the zero rated tax codes or where it is set up, but what I can suggest is if you know where the system retrieves it (say on an Invoice) that you use SQL Profiler to possibly investigate where the queries are pulled from.
    Where in SBO is the zero-rated tax codes used?
    Hope it helps,
    Adele

  • Customizing for Back to Back Sales and Purchase Order

    Dear Gurus,
    Can anybody give me detailed customizing steps so that I can create a back to back sales and purchase order ? How does this process work ?
    Would really appreciate if you dont just paste the SAP help URL over here.
    Thanks

    Dear,
    Please check: http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/business_maps/guid/eg1slxvyat1odhrwoi8vc29sdxrpb25jb21wb3nlci5zyxauy29tl3nvy292awv3l21jcgdl%0d%0adc5hc3a/cgfja2fnzwlkpsz2awv3pxnty3jlbmrlcjimawq9muu2rtqwmjk5mue2nduwmzk0m0fg%0d%0aqtnfnjg1rjbgmkymjnhzbc1iyxnlpwh0dha6ly9zb2x1dglvbmnvbxbvc2vylnnhcc5jb20vc29j%0d%0ab3zpzxcvbwnwz2v0x21pbwuuyxnwp3vybd1zzg5fbmv3lyymd2vilxvybd1odhrwczovl3nvbhv0%0d%0aaw9uy29tcg9zzxiuc2fwlmnvbs9zb2nvdmlldy9ty3bnzxrfbwltzs5hc3a/dxjspsymehnslwxp%0d%0ac3q9c2rux2dlbmvyywxfcmvuzgvylnhzbhq7c2rux2xpbmtyzxdyaxrpbmcuehnsddtnzw5lcmf0%0d%0azuhutuxfu0rolnhzbhqmjnbhy2thz2utawq9jizyzxnvdxjjzxr5cgu9c2rux3nvbhv0aw9ux2nv%0d%0abxbvc2vyx2z1bgxwywdljizwyxjlbnrssuq9l3dlymnvbnrlbnqvd2vicgfnzxmvynb4lzqwielu%0d%0azhvzdhjpzxmvuhvibgljifnly3rvci9cdxnpbmvzcybqcm9jzxnzifbsyxrmb3jtigluifb1ymxp%0d%0ayybtzwn0b3imjnrpdgxlpckgr2xvymfsifryywrlie1hbmfnzw1lbnq6iejhy2stdg8tqmfjaybu%0d%0acmfkaw5nifbyb2nlc3mmjnzpcnr1yww9dhj1zq==;jsessionid=(J2EE3417300)ID0462866350DB00827079450451046937End?prtmode=default
    http://help.sap.com/bp_cp1600/CP_Global/Solution_Map/1E6E402991A64503943AFA3E685F0F2F.htm
    http://help.sap.com/saphelp_gts71/helpdata/en/0b/333a426ea5b26be10000000a155106/frameset.htm
    Regards,
    Syed Hussain.

Maybe you are looking for