Tax conditions in purchase register report

Hi all,
I am developing a Purchase Register Report, I have a small doubt regarding Tax conditions.
From which tables we will get the Tax Conditions like CST, SERVICE TAX, VAT etc.
Previously I have developed Purchase Requisition Report,in that I have used the FM    'CALCULATE_TAX_ITEM' to get the Tax Condition Values. But in this purchase register report I am getting wrong values for the same FM.
Please suggest me.
Regards,
Pradeep.

Hi Pradeep,
First of all let me clarify that you are generating report for Purchase orders generated or for MIRO posted documents
If you are generating for purchase orders
First use FM 'REFRESH_TAX_TABLES' for updating tax tables with latest changes
Next use FM 'FIND_TAX_SPREADSHEET' to find out tax procedure or schema
Then use FM 'CALCULATE_TAX_ITEM' to get taxes
If you are generating report for MIRO documents
Use BSET table for accounting document generated against MIRO
Regards
Krishna

Similar Messages

  • Purchase Register Report issue

    Hi,
    I am working Purchase Register report.
    In this, we have a PO with 10 Quantity.  But at the time of MIGO we receive 5 qty out of 10.
    Now how can we pick the amount according to 5 qty received from MIGO because we want show MIGO condition in our report not from PO.
    What should be the table link for this...
    Plz guide..

    As per ur reference: -
    In PO, Condition are like--- PO Qty is 10
    Basic Amount..........1000
    taxes.........................100
    Freight.........................50
    Other...........................20
    and we have receive only 5 qty out of them, means all the condition amount will be 50%. like...
    Basic Amount..........500
    taxes.........................50
    Freight.......................25
    Other.........................10
    all condition will be calculate according to qty 5 not for 10 as showing in PO..
    I want to pick these condition. (according to 5 qty.)..
    Now suggest...

  • Purchase Register report in SAP BI

    Dear All,
    Please suggest me any standard Purchase Register report  is available in BI or how to achieve this requirement in BI.
    Please let me know process.
    Thank
    Regards,
    Sai.k

    Hi,
    while there is always a new requirement, one needs to discuss  with the functional consultants and find out which tables are being used which may fulfill the scenario. We also need to identify the list of characteristic and Keyfigues the client wants to analyze.
    Also SAP Help is a good source to find more of a standard stream lined objects. Need to analyze if standard objects satisfy the requirement or customization is required.
    Please perform the steps as Rama has suggested...
    thank you

  • Purchase Register Report

    Hi Friends,
             I need to develop the Purchase Register Report with Vendor details, TIN number, Invoice details, E1 purchases with purchase base value and VAT and CST percentages. But Iam new to the Purchase module. I know the basic tables for purchasing. but can anybody guide me the tables for TIN number with VAT and CST percentages and how to proceed?
    Thanking you in advance
    Regards,
    Murali

    I don't know the fields but a few pointers that might be helpful:
    1) Ask your functional analyst - it's part of their job to provide you with the field location or any guidance on that
    2) At least someone should be able to point you where the fields are on the screen. Then you should be able to go the usual route - F1 -> Technical info, etc.
    3) Respective functional forum might be a better place for such questions if for some reason p. 1 and 2 above are not feasible.
    4) You can always use SQL Trace (ST05) to find where the information is being read from or written to. Start the trace, run the transaction, stop the trace and analyze the list. Voila - no need to ask anyone ever again.

  • Purchase register report problem

    Hi experts - please help
    we have a requirement to create a purchase register for material from PO- to Invoice.
    we have PO number -> GRnumber -> Invoice number in our rows . In our keyfigures we have PO Quantity, PO value , GR quantity,GR Value, Invoice quantity and invoice amount .
    Becoz of invoice and GR number relationship which is m: m in our report we see that the key figure values are showing up like
    for 1 purchase order multiple line items , with multiple gr's, with multiple  invoices , becoz of which we see PO quantity field showing like say if it is 30 for 1 PO it is showing 30 for all the invoice numbers in the report which not want , the same case is with Gr quantity and invoice quantity
    PO.no  / po item / gr no / inv number / po quanitity / po value
    1000/10,20,30,40/1000/2000,3000,4000,5000/ 30,30,30,30,30/ 120,120,120,120,120
    this way for 1 PO the report is showing same po quantity based on say if 10 invoices it is showing same P0 Quantity 10 times which is not want and the result row shows up (POvalue *10).
    how to get rid of this situation..
    please suggest any way if anyone has done a similiar report..
    any documents related to such purchase register report is highly appreciated.
    thanks & regards
    krishna

    Hi Krishna,
    Your PO DSO will have records like this.
    PO      Item    POquantity GR Quantity
    PO1      1           100              35
    Your GR DSO will have information as shown below.
    GR Doc      Item      Posting date   GR Quantity   PO     PO Item
    DOC1           1         01.07.2011          20            PO1       1
    DOC2           1         10.07.2011          15            PO1       1
    If the report is based on PO, ( Document date of PO ), then you can show information from the first DSO. If the user wants to have the details of GR documents that constitute GR quantity of 35, you can create a 'Jump to' report on the second DSO and in the RRI Connection map the PO and Item numbers.
    This way you will be able to store the information at different granularity and combine them in reporting.
    Hope this explains,
    Thanks,
    Krishnan

  • Sales and Purchase Register Reports

    Hi all
            Here i am asking how to get purchase and sales register reports in sap business one 2005?
    I tryed in Excel Reporter but Tax Breakup is not coming.
    Thanks & Regards
    Amit

    For Sales Register:
    SELECT M.DocNum AS 'AP Inv. #', M.DocDate as 'Date', M.CardName as 'Vendor Name',M.NumAtCard as 'Bill No. & Dt.',L.ItemCode, L.Dscription,L.LineTotal as 'Amount',L.vatsum ,L.PriceBefDi as 'Rate',
    (Select Sum(LineTotal) FROM INV1 L Where L.DocEntry=M.DocEntry) as 'Base Amt.(Rs.)',
    (SELECT Sum(TaxSum) FROM INV4 where statype=-90 and DocEntry=M.DocEntry) as 'BED (Rs.)',
    (SELECT Sum(TaxSum) FROM INV4 where statype=7 and DocEntry=M.DocEntry) as 'HSCess_New (Rs.)',
    (SELECT Sum(TaxSum) FROM INV4 where statype=-60 and DocEntry=M.DocEntry) as 'EDCS (Rs.)',
    (SELECT Sum(TaxSum) FROM INV4 where statype=-55 and DocEntry=M.DocEntry) as 'HECS (Rs.)',
    (SELECT Sum(TaxSum) FROM INV4 where statype=1 and DocEntry=M.DocEntry) as ' VAT (Rs.) ',
    (SELECT Sum(TaxSum) FROM INV4 where statype=4 and DocEntry=M.DocEntry) as ' CST (Rs.) ',
    (SELECT Sum(TaxSum) FROM INV4 where statype=-10 and DocEntry=M.DocEntry) as ' CVD (Rs.) ',
    (SELECT Sum(TaxSum) FROM INV4 where statype=5 and DocEntry=M.DocEntry) as ' Ser.Tax (Rs.) ',
    (SELECT Sum(TaxSum) FROM INV4 where statype=6 and DocEntry=M.DocEntry) as 'CS on Ser.Tax (Rs.)',
    (SELECT Sum(TaxSum) FROM INV4 where statype=4 and DocEntry=M.DocEntry) as 'HECS_ST (Rs.)',
    (Select Sum(LineTotal) From INV3 Q Where Q.DocEntry=M.DocEntry) AS 'Freight (Rs.)',
    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]')
    GROUP BY
    M.DocNum,M.DocDate,M.CardName,M.NumAtCard,M.DocEntry,M.DiscSum,M.WTSum,M.DocTotal,L.ItemCode,L.Dscription,L.LineTotal,L.vatsum,L.PriceBefDi
    ORDER BY
    M.DocNum,M.DocDate,M.CardName,M.NumAtCard,M.DocEntry,M.DiscSum,M.WTSum,M.DocTotal,L.LineTotal,L.vatsum,L.PriceBefDi
    For Purchase Register:
    SELECT M.DocNum AS 'AP Inv. #', M.DocDate as 'Date', M.CardName as 'Vendor Name',M.NumAtCard as 'Bill No. & Dt.',
    (Select Sum(LineTotal) FROM PCH1 L Where L.DocEntry=M.DocEntry) as 'Base Amt.(Rs.)',
    (SELECT Sum(TaxSum) FROM PCH4 where statype=-90 and DocEntry=M.DocEntry) as 'ED (Rs.)',
    (SELECT Sum(TaxSum) FROM PCH4 where statype=-60 and DocEntry=M.DocEntry) as 'EDCS (Rs.)',
    (SELECT Sum(TaxSum) FROM PCH4 where statype=7 and DocEntry=M.DocEntry) as 'HECS (Rs.)',
    (SELECT Sum(TaxSum) FROM PCH4 where statype=1 and DocEntry=M.DocEntry) as ' VAT (Rs.) ',
    (SELECT Sum(TaxSum) FROM PCH4 where statype=4 and DocEntry=M.DocEntry) as ' CST (Rs.) ',
    (SELECT Sum(TaxSum) FROM PCH4 where statype=10 and DocEntry=M.DocEntry) as ' CVD (Rs.) ',
    (SELECT Sum(TaxSum) FROM PCH4 where statype=5 and DocEntry=M.DocEntry) as ' Ser.Tax (Rs.) ',
    (SELECT Sum(TaxSum) FROM PCH4 where statype=6 and DocEntry=M.DocEntry) as 'CS on Ser.Tax (Rs.)',
    (SELECT Sum(TaxSum) FROM PCH4 where statype=8 and DocEntry=M.DocEntry) as 'HECS_ST (Rs.)',
    (Select Sum(LineTotal) From PCH3 Q Where Q.DocEntry=M.DocEntry) AS 'Freight (Rs.)',
    M.WTSum AS 'TDS (Rs.)',
    M.DocTotal as 'Total (Rs.)'
    FROM OPCH M LEFT OUTER JOIN PCH1 L on L.DocEntry=M.DocEntry
    LEFT OUTER JOIN PCH4 T on T.DocEntry=L.DocEntry and L.LineNum=T.LineNum
    LEFT OUTER JOIN PCH5 J ON M.DocEntry = J.AbsEntry
    LEFT OUTER JOIN PCH3 Q ON M.DocEntry = Q.DocEntry
    WHERE (M.DocDate >= '[%0]' AND M.DocDate <= '[%1]')
    GROUP BY
    M.DocNum,M.DocDate,M.CardName,M.NumAtCard,M.DocEntry,M.[DiscSum],M.WTSum,M.DocTotal
    ORDER BY
    M.DocNum,M.DocDate,M.CardName,M.NumAtCard,M.DocEntry,M.[DiscSum],M.WTSum,M.DocTotal
    Hope this will help you,
    Regards,
    Neetu

  • How to create VAT tax condition in Purchase order

    Hi Experts,
    My client has a requirement to put VAT (Value added tax) as condition in the PO. There shall be two different condition one for VAT deductable and the other for VAT non deductable.
    The VAT deductable should have its impact at the time of MIRO as recoverable condition type.
    So please kindly explain how to address this senario for VAT deductable. The client do not have CIN implemented.
    Regards,
    MG

    Hi Moharghosh,
    Go to - Spro->Financial Accounting (New)->Financial Accounting Global Settings (New)->Tax on Sales/Purchases->Basic Settings->Check Calculation Procedure->Define Condition Types
    here define two condition types for VAT Deductible and VAT Non deductible.
    Then assign both the above created condition types in you tax procedure as per the calculation.
    Please make sure that you assign the exact transaction event key under Account Key field in Tax Procedure against VAT Dedu. and VAT non Dedu..
    For VAT Non Deductible - You can use NVV.
    For VAT Deductible you can create your own transaction event key in the below path - Spro->Financial Accounting (New)->Financial Accounting Global Settings (New)->Tax on Sales/Purchases->Basic Settings->Check and Change Settings for Tax Processing
    Hope this will help you.
    Thanks and Regards,
    Neeraj

  • What is the purchase register report?

    Hi,
    Can anyone tell  me what is significance of purchase register .
      How this report get in R/3 and BI
    Thanks and Regards
    Anil

    Purchase Register Report
    Purchase Register
    Reward points..

  • Fetching tax conditions in purchase order

    hi all,
      i am doing medruck.i need to display bacis excise duty,edu.cess ,hr.educess,cst and vat.i found the codition types in konv.but some condition types not found in konv.i used condition no (knumv).but i could not  find the conditions(jmop,JMX1,JECP,JSEP,JIPC,JEX1,JHX1).Any one know where these conditions gets stored.

    Hi,
    Try out using the table BSET - Taxes table. But this is thro FI route and probably you will have to key in the valid accntg doc if available to get the details.
    Hope this helps.
    Regards,
    JLN

  • Customized Query for purchase register

    Hi All,
    I need a query for purchase register which gives excise information with biferication.
    OPCH, PCH1, ORPC, RPC1 and IEI4
    In excel reporter we get the purchase register report But excise amount does not come in that report.
    So, I need Customised report for that.
    Regards
    Shashi

    hi shashi,
    SELECT M.DocNum AS 'AP Inv. #', M.DocDate as 'Date', M.CardName as 'Vendor Name',M.NumAtCard as 'Bill No. & Dt.',
    (Select Sum(LineTotal) FROM PCH1 L Where L.DocEntry=M.DocEntry) as 'Base Amt.(Rs.)',
    (SELECT Sum(TaxSum) FROM PCH4 where statype=-90 and DocEntry=M.DocEntry) as 'ED (Rs.)',
    (SELECT Sum(TaxSum) FROM PCH4 where statype=-60 and DocEntry=M.DocEntry) as 'EDCS (Rs.)',
    (SELECT Sum(TaxSum) FROM PCH4 where statype=7 and DocEntry=M.DocEntry) as 'HECS (Rs.)',
    (SELECT Sum(TaxSum) FROM PCH4 where statype=1 and DocEntry=M.DocEntry) as ' VAT (Rs.) ',
    (SELECT Sum(TaxSum) FROM PCH4 where statype=4 and DocEntry=M.DocEntry) as ' CST (Rs.) ',
    (SELECT Sum(TaxSum) FROM PCH4 where statype=10 and DocEntry=M.DocEntry) as ' CVD (Rs.) ',
    (SELECT Sum(TaxSum) FROM PCH4 where statype=5 and DocEntry=M.DocEntry) as ' Ser.Tax (Rs.) ',
    (SELECT Sum(TaxSum) FROM PCH4 where statype=6 and DocEntry=M.DocEntry) as 'CS on Ser.Tax (Rs.)',
    (SELECT Sum(TaxSum) FROM PCH4 where statype=8 and DocEntry=M.DocEntry) as 'HECS_ST (Rs.)',
    (Select Sum(LineTotal) From PCH3 Q Where Q.DocEntry=M.DocEntry) AS 'Freight (Rs.)',
    M.WTSum AS 'TDS (Rs.)',
    M.DocTotal as 'Total (Rs.)'
    FROM OPCH M LEFT OUTER JOIN PCH1 L on L.DocEntry=M.DocEntry
    LEFT OUTER JOIN PCH4 T on T.DocEntry=L.DocEntry and L.LineNum=T.LineNum
    LEFT OUTER JOIN PCH5 J ON M.DocEntry = J.AbsEntry
    LEFT OUTER JOIN PCH3 Q ON M.DocEntry = Q.DocEntry
    WHERE (M.DocDate >= '[%0]' AND M.DocDate <= '[%1]') AND (T.TrgetEntry = ' ')
    GROUP BY
    M.DocNum,M.DocDate,M.CardName,M.NumAtCard,M.DocEntry,M.[DiscSum],M.WTSum,M.DocTotal
    ORDER BY
    M.DocNum,M.DocDate,M.CardName,M.NumAtCard,M.DocEntry,M.[DiscSum],M.WTSum,M.DocTotal
    Jeyakanthan

  • How to prepare  Raw metarials item wise purchase register

    Hi,
    I need your assistance regarding for generate of this purchase register report.
    please check link below where i upload xls file of my report.
    http://www.sendspace.com/file/4bmse5
    For making this report all data will come from Vendor info, GRPO info. or OINM table
    Remember, when i put any date range, it will show Opening Qty and OP Value  which one was the Closing Qty and value for last date.
    like put the date range 01-10-2010 and 31-10-2010 and itemname ABC it will show 30-09-2010 closing QTY and value
    for 01-10-2010 Opening QTY and Value
    Please help me about this report.
    Regards,
    Mizan
    Edited by: mizan700 on Jan 26, 2011 4:56 PM

    Hi Mizan........
    Please have a look on this report and just give your Raw Material Item Group Code as condition.....
    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

  • VAT Value in Purchase Register

    Dear Friends,
    I have a problem in Purchase Register,  I have made customised Purchase Register , most of my entries in it are going correctly ,except for VAT value in case of Dealer PO, where I dont know the Excise Rate while making the PO, so make PO with rate inclusive of excise , and during MIGO , I mark MRP in the header , & in the item level  I change the Excise assesable value , & enter the excise value,Ecess, SE cess value .
    Than I do MIRO of the PO , the excise & the VAT enteries shown during the MIRO by the system , is correct , but when I check the Purchase Register for the VAT value , its calculating the VAT amount on the value exclusive of the excise duty & not inclusive of the excise duty.
    Friends can you tell from which table , should I pick the VAT value so that the correct enteries get picked up in the Purchase Register.
    Regards,
    DGN

    Check this links for VAT tables
    purchase register
    Purchase Register Report
    also check this links for VAT Reports
    Std t -code for input VAT Register
    Purchase and VAT details
    Sales tax register and purchase tax register

  • Purchase Register India Localization

    Hi Experts,
    We are facing a issue in Purchase Register, i have confusion on generating report, there are two dates are available in input parameters, posting date and invoice date, whichever date i am selecting for generating report, the data and figures which i am getting which is not matching with my vat returns for that same period.
    even the purchase returns are not reflecting in purchase register, it should reflect in negative figure in purchase register, now i am confused that this purchase register report is relible or not. can we use it for audit.
    Pls. guide me for the same, i am facing this issue will my all clients.
    Regards
    Kamlesh Vagal
    [email protected]
    Tel : +91 9920691906

    Hi Neetu,
    Do you wish that at all customer site all concern involved in implemtation do the same work ?
    I believe ERP is meant for single entry system, and it should be true for implementation also, why to invest man hours for the same task ?
    I expect it standard reports should be released by SAP, so that speed of implementation improve, we have more nos. of satisfied customers.
    customised reports is all together different and it is understood that it is needed to be developed after study the exact requirement.
    Best Regards,
    Samir Gandhi

  • Purchase register

    Hi,
    Can anybody tell me why purchase register report is needed in business.? What is similar type of report availbale in R/3 and BI ?
    Thanks and Regards
    Anil Patil

    hi,
    purchase register should contain below detail.
    order detail
    grn detail
    invoicde detail
    for order detail use : ekko , ekpo
    grn detail : mkpf , mseg
    invoice detail : rbkp , rseg
    root is purchase order no. in ekko.
    Regards,
    Archit

  • Purchase Register with Item

    Hi Friends,
                    I want purchase register report in which i can see all row on each docentry, I have a query like
    SELECT
    M.DocNum as 'A/P Invoice No.',
    M.DocDate as 'Inv. Date',
    M.CardName as 'Vendor Name',
    M.NumAtCard as 'Vendor Ref. No.',
    (Select Sum (isnull (LineTotal,0)) FROM pch1 L Where L.DocEntry=M.DocEntry) - isnull (((Select Sum (isnull(LineTotal,0)) FROM rpc1 r Where R.baseEntry=L.DocEntry)),0) as 'Base Amt(Rs.)',
    (SELECT AVG (TaxRATE) FROM pch4 where statype=1 and DocEntry=M.DocEntry) - isnull (((SELECT Sum(TaxRATE) FROM Rpc4 R4 where statype=1 and R4.DocEntry=R.DocEntry)),0) as ' VAT_RATE ',
    (SELECT Sum(TaxSum) FROM pch4 where statype=1 and DocEntry=M.DocEntry) - isnull(((SELECT Sum(TaxSum) FROM Rpc4 R4 where statype=1 and R4.DocEntry=R.DocEntry)),0) as ' VAT(Rs.)',
    (SELECT avg(TAXRATE) FROM pch4 where statype=4 and DocEntry=M.DocEntry) - isnull(((SELECT Sum(Taxrate) FROM Rpc4 R4 where statype=4 and R4.DocEntry=R.DocEntry)),0) as ' CST_RATE ',
    (SELECT Sum(TaxSum) FROM pch4 where statype=4 and DocEntry=M.DocEntry) - isnull(((SELECT Sum(TaxSum) FROM Rpc4 R4 where statype=4 and R4.DocEntry=R.DocEntry)),0) as ' CST(Rs.) ',
    (Select Sum(LineTotal) From pch3 Q Where Q.DocEntry=M.DocEntry) - isnull(((SELECT Sum(Linetotal) FROM Rpc3 R3 where R3.DocEntry=R.DocEntry)),0) AS 'Freight(Rs.)' ,
    (M.DocTotal - isnull(M.PaidToDate,0)) as 'Total (Rs.)'
    from opch M
    LEFT OUTER JOIN pch1 L on L.DocEntry=M.DocEntry
    LEFT OUTER JOIN pch4 T on T.DocEntry=L.DocEntry and L.LineNum=T.LineNum
    LEFT OUTER JOIN pch5 J ON M.DocEntry = J.AbsEntry
    LEFT OUTER JOIN pch3 Q ON M.DocEntry = Q.DocEntry
    left outer join RPC1 R On R.Baseentry = L.Docentry
    left outer join RPC4 R4 On R.docentry = R4.Docentry
    left outer join RPC3 R3 On R.docentry = R3.docentry
    left outer join ORPC RP On R.docentry = RP.docentry
    WHERE M.DocDate >= [%0] AND M.DocDate <= [%1] and m.doctype = 'I'
    GROUP BY
    M.DocNum,M.DocDate,M.CardName,M.NumAtCard,
    M.DocEntry,M.DiscSum,M.WTSum,M.DocTotal,L.docentry,R.docentry,RP.Doctotal, M.Paidtodate
    ORDER BY
    M.DocNum,M.DocDate,M.CardName,M.NumAtCard,
    M.DocEntry,M.DiscSum,M.WTSum,M.DocTotal
        My requirement is to show all row items corresponding to docnumber.
    Thanks
    Andy

    Hi Andy,
    Try:
    SELECT
    M.DocNum as 'A/P Invoice No.',
    M.DocDate as 'Inv. Date',
    M.CardName as 'Vendor Name',
    M.NumAtCard as 'Vendor Ref. No.',
    (Select Sum (isnull (LineTotal,0)) FROM pch1 L Where L.DocEntry=M.DocEntry) - isnull (((Select Sum (isnull(LineTotal,0)) FROM rpc1 r Where R.baseEntry=L.DocEntry)),0) as 'Base Amt(Rs.)',
    (SELECT AVG (TaxRATE) FROM pch4 where statype=1 and DocEntry=M.DocEntry) - isnull (((SELECT Sum(TaxRATE) FROM Rpc4 R4 where statype=1 and R4.DocEntry=R.DocEntry)),0) as ' VAT_RATE ',
    (SELECT Sum(TaxSum) FROM pch4 where statype=1 and DocEntry=M.DocEntry) - isnull(((SELECT Sum(TaxSum) FROM Rpc4 R4 where statype=1 and R4.DocEntry=R.DocEntry)),0) as ' VAT(Rs.)',
    (SELECT avg(TAXRATE) FROM pch4 where statype=4 and DocEntry=M.DocEntry) - isnull(((SELECT Sum(Taxrate) FROM Rpc4 R4 where statype=4 and R4.DocEntry=R.DocEntry)),0) as ' CST_RATE ',
    (SELECT Sum(TaxSum) FROM pch4 where statype=4 and DocEntry=M.DocEntry) - isnull(((SELECT Sum(TaxSum) FROM Rpc4 R4 where statype=4 and R4.DocEntry=R.DocEntry)),0) as ' CST(Rs.) ',
    (Select Sum(LineTotal) From pch3 Q Where Q.DocEntry=M.DocEntry) - isnull(((SELECT Sum(Linetotal) FROM Rpc3 R3 where R3.DocEntry=R.DocEntry)),0) AS 'Freight(Rs.)' ,
    (M.DocTotal - isnull(M.PaidToDate,0)) as 'Total (Rs.)',
    L.ItemCode,L.Quantity,L.LineTotal
    from opch M
    LEFT OUTER JOIN pch1 L on L.DocEntry=M.DocEntry
    LEFT OUTER JOIN pch4 T on T.DocEntry=L.DocEntry and L.LineNum=T.LineNum
    LEFT OUTER JOIN pch5 J ON M.DocEntry = J.AbsEntry
    LEFT OUTER JOIN pch3 Q ON M.DocEntry = Q.DocEntry
    left outer join RPC1 R On R.Baseentry = L.Docentry
    left outer join RPC4 R4 On R.docentry = R4.Docentry
    left outer join RPC3 R3 On R.docentry = R3.docentry
    left outer join ORPC RP On R.docentry = RP.docentry
    WHERE M.DocDate >= [%0\] AND M.DocDate <= [%1\] and m.doctype = 'I'
    GROUP BY
    M.DocNum,M.DocDate,M.CardName,M.NumAtCard,
    M.DocEntry,M.DiscSum,M.WTSum,M.DocTotal,L.docentry,R.docentry,RP.Doctotal, M.Paidtodate,
    L.ItemCode,L.Quantity,L.LineTotal
    ORDER BY
    M.DocNum,M.DocDate,M.CardName,M.NumAtCard,
    M.DocEntry,M.DiscSum,M.WTSum,M.DocTotal
    Thanks,
    Gordon

Maybe you are looking for

  • Pages 08 on macbook compatible with 09 on iPad?

    I have pages 08 on my macbook and 09 on my iPad. I modified an 08 created file on my ipad now it won't open on the macbook (pages08). why not?

  • Envelopes do not feed correctly on my HP5610 All in One printer and return addresses get chopped off

    I'm running a Windows 8 64 bit laptop and the feeder seems to grab the paper properly but it cuts off part of the return address all the time. I can push it in maybe and inch or so when the feeder starts to grab the paper and this will correct it, bu

  • Query like matrix

    Hi, I need menu_name, form_name. If more than 1 submenus, how to do that? This is query SELECT fr.responsibility_name, fm.menu_name, fme.description menu_description, fff.function_name, ff.form_name, sub_menu.menu_name sub_menu_name, sub_menu.functio

  • Event receiver works perfectly in debug mode, but fails in release mode

    Here is my item added event which works perfectly and gives read permission to CCfield user in debug mode, but doesn't give permissions to CCfield user when item added event is triggered in release mode: base.ItemAdded(properties); try SPListItem ite

  • Second computer not detecting network

    Hi! This week I bought a new WRT54G v8.1. After updating the firmware, I was able to set up the network using LELA. However, I've tried adding the second computer to the network and haven't been able to get it to work. The second computer has a wirel