Purchase Register minus Credit Memo Report

Hi Experts,
I am not getting the desired result from this query. I am trying to substract the partial and full Purchase credit memo amount but the result showing only memo placed document while i want all the document in the report' result.
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(LineTotal) FROM pch1 L Where L.DocEntry=M.DocEntry) - (Select Sum(LineTotal) FROM rpc1 r Where R.baseEntry=L.DocEntry) as 'Base Amt(Rs.)',
(SELECT AVG(TaxRATE) FROM pch4 where statype=1 and DocEntry=M.DocEntry) - (SELECT Sum(TaxRATE) FROM Rpc4 R4 where statype=1 and R4.DocEntry=R.DocEntry)as ' VAT_RATE ',
(SELECT Sum(TaxSum) FROM pch4 where statype=1 and DocEntry=M.DocEntry)  - (SELECT Sum(TaxSum) FROM Rpc4 R4 where statype=1 and R4.DocEntry=R.DocEntry)  as ' VAT(Rs.)',
(SELECT avg(TAXRATE) FROM pch4 where statype=4 and DocEntry=M.DocEntry) - (SELECT Sum(Taxrate) FROM Rpc4 R4 where statype=4 and R4.DocEntry=R.DocEntry) as ' CST_RATE ',
(SELECT Sum(TaxSum) FROM pch4 where statype=4 and DocEntry=M.DocEntry) - (SELECT Sum(TaxSum) FROM Rpc4 R4 where statype=4 and R4.DocEntry=R.DocEntry) as ' CST(Rs.) ',
(Select Sum(LineTotal) From pch3 Q Where Q.DocEntry=M.DocEntry) - (SELECT Sum(Linetotal) FROM Rpc3 R3 where R3.DocEntry=R.DocEntry) AS 'Freight(Rs.)' ,
(M.DocTotal - RP.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
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
ORDER BY
M.DocNum,M.DocDate,M.CardName,M.NumAtCard,
M.DocEntry,M.[DiscSum],M.WTSum,M.DocTotal

If no payment has made to the particular invoices, then you can use this
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
Regards,
Bala

Similar Messages

  • Standard Credit memos report

    Hi All,
    Is there any standard report which shows all the credit memo's in the system.
    Thanks
    Rajanikanth

    Hi
    No special standard report available...but in
    TCODE: FBL1N
    TCODE: FBL5N
    goto additional selections "Dr/Cr Indicator"
    select the the relevant indicator to get the report
    VVR

  • Invoice copy to Credit Memo Report

    Dear All ,
    I need some query which provide the detail of A/P Invoices which are copied to A/P Credit Memo.
    Thanks
    Gangadhar

    Hi GangaDhar
    Try This
    SELECT     OPCH.DocNum, OPCH.DocDate, OPCH.CardCode, OPCH.CardName, OPCH.VatSum, OPCH.DocTotal
    FROM         OPCH INNER JOIN
                          PCH1 ON OPCH.DocEntry = PCH1.DocEntry
                          where PCH1.TrgetEntry is not NULL
    thanks
    Ashish

  • AP Credit Memo and Purchase Order

    Hi,
    can anyone tell me if it's possible to link a AP Credit Memo to a purchase order like an invoice can joined to ?
    thanks

    Dear GEORGES COURONNE,
    No, it is not possible to link Purchase order to Credit memo. Because, Credit memo is used to cancle the Accounting transaction done (like invoice), but in purchase order there is no such transaction.
    You can close the purchase order to copy it to Invoice or GRPO, and or by manual close choosing Data close.
    Regards,
    Raghu N
    SAP Business Forums Team

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

  • No matching record found G/L Account (OACT) A/P Credit Memo

    Hello Experts,
                                   When i post A/P Credit Memo i get message as No matching record found G/L Account (OACT).
                                    Version SAP B1 8.8 PL11
    I tried following
       check  the rounding account In G\L determination.
       check  the offset account in G\L determination.
    everything is properly set.
    We did upgrade from 2007B to SAP B1 8.8
    Please Suggest
    Quick reply will be helpful

    Hello Gordon & Sachin,
                                                                                    I have even tried in test system , same error it gives,
                                                   I have check the Purchase return , Purchase credit and Expense Account , everything is
                                                   properly set.
                                                   When i do copy to from A/P Invoice , it is getting added                                                                               
    One more error it gives mewhen  i load or open   the from of Purchase A/p credit Memo, it
                                                  Gives error in red color as "Divide By zero error encountered (NFN1)
    Please Suggest

  • Fixed Assets Add-On: Depreciation Calculation After Credit Memo

    In the beginning of the year, I have a fixed asset as follow:
    Cost $16,128,667.00
    NBV $14,515,800.35
    Planned Useful Life for this asset is 120 months.
    In July this year, created a Fixed Asset Credit Memo for this asset at $1,110,942.92.
    Originally, before the credit memo, the planned depreciation is $134,405.53 per month which is correct.
    After the credit memo, it recalculates the planned depreciation to $124,119.04 per month. How did the system arrive at this figure?
    Depreciation method:
    Straight line
    Full Year

    Hi,
    Based on NBV $14,515,800.35, minus Credit Memo $1,110,942.92, you got $13,404,856.43. The useful life is 108 based on NBV. So you get new planned depreciation to $124,119.04 per month.
    Thanks,
    Gordon

  • AP Credit Memo and Good return, creates differences between TB and Stock Audit Report

    Hello Experts,
    Did any one has ever faced an issue, whereby AP Credit Memo and Good Return creates discrepancy between journal entry and the stock audit report?
    Here is the scenario:
    AP Credit Memo
    Description
    Quantity
    Unit Price
    Total
    Item A
                    30
                3,400
       102,000
    Journal Entry :
    Debit
    Business Partner
         105,000
            Credit
                          Stock
         105,000
    Inventory Audit Report
    Description
    Quantity
    Cost
    Transaction Amount
    Item A
                            30
                         3,500
                                                    105,000
    Journal Entry :        
    Debit
    Business Partner
         105,000
            Credit
                          Stock
            105,000
    The difference is actually due to the moving average, but the strange part is why the difference is not posted in the journal entry, in the Price different account?
    This makes the stock account amount to be different from the Trial Balance and the Stock Audit Report.
    And this is applied also on the Good Return transaction.
    Any help is highly appreciated.
    Best Regards
    Cedric Kayitare

    Hi Cedric,
    Price & Item cost are different.
    while making goods return , Direct AP Credit Note, Sales Delivery, Direct AR Invoice, stock is going outside.
    In these transactions Journal entry will happen for Item cost and not Item sales or Purchase price.
    Please enable item cost field in line level and check whether above formulae is matching with Item, cost field.
    Then what is the importance of price in these documents??
    Price is the agreed selling or purchase price for trading with Customer and supplier.
    In your example
    You are returning back material worth 105000(as per moving average price), but supplier is supposed to give only you 102,000.
    Hope you understand
    Thanks
    Unnikrishnan

  • Tables for credit Memo and Purchase order

    Hi all,
    I need to develop a report to dispaly all the credit memos for the open qty,
    My issue that is  there any table where we can have information for credit memos and purchase order,
    like the input fields is company code,customer number,fiscal year,
    hope you understnad,
    Please let me know if you need any more information,
    Thanks&Regards,
    Cghand

    Hi
    Invoice Verific. table:
    RBKP - Document Header: Invoice Receipt
    RSEG - Document Item: Incoming Invoice
    Regards
    Prasanna

  • Report to view SO-Invoice-Credit Memo-Debit Memo-with/ without reference

    Hello Gurus,
    Can any one help me for viewing the report where i can see Sales Order Invoice ,Credit Memo & Debit Memo with/without reference .
    We are creating Credit Memo & Debit Memo without reference but uses the same Purchase Order Nos .
    Please guide me on this...
    Thanks.
    Sameer S Barde

    hi
    u can use the standard t-code vf05n to see the list with reference to the document type...
    do revert if question is not answered..
    regards
    Chander

  • A/P credit memo journal incase of Purchase posting system

    Hi,
    I am using purchase posting system for one of my client
    Some times while creating standalone A/P creditmemo the system is posting some amount to Price difference account
    Why does the system do so? I have many credit memos which are posting correctly but a few are having Price difference account postings
    Thanks
    Md.nazeer Shaikh

    Hi,
    I have taken all the steps to block negative inventory at the warehouse level
    My concern is when does the system posts the journal entry to Price difference account in case of creating standalone Credit memo
    Is there anything new changes related to block the negative stock in 2007 then please do let me know.
    I understand there is one setting in administration what if i set this as item setting,Company instead of warehouse
    Thanks
    Md.nazeer Shaikh

  • Sales Report Generation less the Credit memo

    Anybody can help me regarding Query for Sales Report. Im trying to create a sales report per Per Product and Customer with corresponding Quantity and Amount, I have already get the query the problem is I cant get the Credit Memo deduct from its A./P Invoice so that deduct the quantity and price. With this i can get the exact sales!
    Anybody have an idea? Im having headache already for a week now trying to solve this problem, Thank you very much.
    Clint

    Hi Jeyakanthan,
    Im not referring to Sales Analysis Report. All i want is to get all the sales and Less the the corresponding Credit Memo. Im trying to create a query that will show the sales, Ex.. row
    From A/R invoice Table
    DocNo CardCode   Qty   Price  DocTotal  
    0111     CA-001     10     25      250
    less from A/R Credit Memo
    DocNo CarCode    Qty   Price  DocTotal  
    0111     CA-001     5      25      125
    I want the result to deduct the row Invoice from CM.
    If the corrsponding Invoice doesnt find a CM record then the result will be 0. Ex from above data Invoice less the Credit Memo.
    if the Invoice found a Credit Memo,
    Qty1       Qty2    Qty3, DocTotal1 DocTotal2 = Result
    10   less  5      =  5 ;    250   less 125         =   125
    if the Invoice doesnt have Credit Memo,
    Qty1       Qty2    Qty3, DocTotal1 DocTotal2 = Result
    10   less  0      =  10 ;    250   less 0            =   250
    hope the will clarify everything, thank yuo very much in advance.
    Regards,
    Clint

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

Maybe you are looking for

  • IPod connects to new PC, but not iTunes

    I bought a new laptop (WIndows XP) a few days ago, but when I tried to connect my iPod it doesn't appear in the iTunes 'Sources' list. It appears in the 'My Computer' folder, and when I connect it to the computer iTunes opens! I've had my iPod for ov

  • What's the deal with 10.8.2?  Safe or Suicide?

    I want to upgrade the video card in my mac pro 3.1.  I got the ATI 5770 which needs at least Lion.  I am currently running Snow Leopard.  I decided to upgrade to Mountain Lion and skip over Lion but the feedback on 10.8.2 is mixed between extatic and

  • Release date for ECC 6.0.

    Hi, Can anybody please tell me the release date for ECC 6.0. Full points will be assigned. Thanks, JB

  • Rules security in Calc Manager vs EAS

    Maybe I am missing something, but what happened to the ability to put security on Rules now that we are using Calc Manager for our EPMA apps? In EAS Business Rules, we could assign all of our privileges to the rule but now it appears that there is no

  • Photos disk space usage

    I don't quite understand what Photos does: it uses 3 times as much disk space as Aperture for the same library. My Aperture library with some 53k photos (~200GB on external SSD) and a few hundred videos (~100GB on external SSD) uses around 40GB disk