Exclude A/P Credit Memo from this Query

Hello All,
i am trying to figure out to exclude A/P Invoice that it was already Credit Memo with my existing Query
SELECT
max(T0.DocDate) as 'Date',
max(T1.CardName) as 'Vendor Name',
max(T0.Address) as 'Vendor Address',
count(T0.DocNum) as 'No. of Invoices',
max(T1.LicTradNum) as 'TIN No.',
sum(T0.BaseAmnt) as 'Base Amount',
sum(T0.VatSum) as 'Input Tax',
max(T1.ECVatGroup ) as 'TaxCode',
max(T2.WTCode) as 'WtaxCode'
FROM OPCH T0  INNER JOIN OCRD T1 ON T0.CardCode = T1.CardCode
left join PCH5 T2 on T0.DocEntry = T2.AbsEntry
WHERE T0.DocDate BETWEEN '[%0]' and '[%1]' and T0.VatSum <> 0
GROUP BY T1.CardCode
Please help mew revise my Query.
this is connected with my previous question How to Identify A/P Invoice that was Credit Memo  but i cannot figure out how to incorporate PCH1.TargetEntry
Please Help.
Thank You.
Fidel

try the below query
SELECT 
max(T0.DocDate) as 'Date', 
max(T1.CardName) as 'Vendor Name', 
max(T0.Address) as 'Vendor Address', 
count(T0.DocNum) as 'No. of Invoices', 
COUNT(T5.DocNum) AS 'No of Credit Memos',
max(T1.LicTradNum) as 'TIN No.', 
sum(T0.BaseAmnt) as 'Base Amount', 
sum(T0.VatSum) as 'Input Tax', 
max(T1.ECVatGroup ) as 'TaxCode', 
max(T2.WTCode) as 'WtaxCode' 
FROM OPCH T0  INNER JOIN OCRD T1 ON T0.CardCode = T1.CardCode  
INNER JOIN pch1 t3 ON t3.DocEntry=t0.DocEntry
LEFT JOIN dbo.RPC1 T4 ON T4.BaseEntry=T3.DocEntry left JOIN dbo.ORPC T5 ON T5.DocEntry=T4.DocEntry
left join PCH5 T2 on T0.DocEntry = T2.AbsEntry 
WHERE T0.DocDate BETWEEN '[%0]' and '[%1]' and T0.VatSum <> 0  
GROUP BY T1.CardCode 
--Manish

Similar Messages

  • How to hide net value of $0 on Credit Memos from rejected return?

    We are creating a credit memo request with a second line item which contains rejected returns.  Basically line item 1 contains the actual qty which we are refunding and line item 2 is the qty which we will not be refunding.  When we create the the credit memo from this document in VF04, the line item two is showing on the credit memo with a net value of $0.
    Is there a way to hide this net value of $0 or rejected return items from coming over onto the credit memo.  We would like to just show positive values on the CM.
    - Chuck

    The reason for rejection is set in when the credit memo request is craeted and the net value of $0 still appears on the credit memo.. how ever the pricing values are in an unprocessed (yellow) status.
    So after running a few test when the billing block was set on the credit memo request.. I noticed that the credit memo request was still open after VF04, would appear as unprocessed, and always show up when VF04 is ran.
    Is there some other way to get the net value of $0 to NOT appear on the credit memo beyone reason for rejection and billing block.  Maybe something in the configuration copy control??

  • Create a Credit Memo from purchase invoice

    Hi everyone,
    I am trying to create a credit memo from a purchase invoice, but it retuns the following error:
    "RFC is missing"
    I am using the JCO classes to develop this application. this is a sample of my code:
    IDocuments document = SBOCOMUtil.newDocuments(company,new Integer(19));
    document.setCardCode("P00055");
    document.setDocDate(new java.util.Date());
    document.getLines().setBaseEntry(new Integer(2852));
    document.getLines().setBaseLine(new Integer(0));
    document.getLines().setBaseType(new Integer(18));
    int lRetCode = document.add();
    if(lRetCode != 0){
        System.out.println(company.getLastError().getErrorMessage() );
    Do you have any idea about what is the problem?
    Many Thanks.

    Hi everyone,
    the problem was solve. I had to specified the FederalTaxID field on the document.
    just added the following field:
    document.setFederalTaxID("000000000000");
    Thanks.

  • Establish receivables and credit memos from suppliers

    hi,
    How I can Establish receivables and credit memos from suppliers to whom the authority has made duplicate or erroneous payments and indicate them separately so as consider this while processing future payments to the party
    how i can implement this functionality
    thanks

    Hello,
    That will help but we have 400 records. I guess we will write some logic in staging table to update all those records which have that prefix in invoice number.
    Thank you.

  • Create a Credit Memo from invoice

    Hi,
    When I Create a Credit Memo from invoice, I get the next error : -5002 , "-"
    What is that?
    regards

    Hi Joe,
    I have tested your code and it seems to me that it is working fine. Make sure that the numbers of the document that you are using is correct and that you are doing it for the same business partner. Try doing the exact same thing in SBO. Please remember that you can have different document numbers and document entries for every document. The BaseEntry refers to the DocEntry field in the OINV table and not the DocNum field. The DocNum field is the one you see on screen in top right corner of AR Invoice screen.
    Hope it helps,
    Adele
    PS: Sorry for previous text that was in this message. I had it all wrong
    Message was edited by: Adele le Roux

  • Invoice and Credit Memo from ECC to SUS

    Hi Gurus
    Is it possible to replicate Invoice or a credit Memo from ECC to SUS if the PO was delvired to vendor through SUS.
    with Regards
    Manjunath

    HI ,
    part1 :
      ERS Invoice from ECC is transfered to SUS system for display purpose to Vendor in MM-SUS scenario. IDOC "GSVERF01" is used for this purpose.
    part 2 : Invoices can be created in SUS system by vendor against ASN ( Advanced Shipping Notification or purchase Order . The invoice is transfered to ECC system through XI. Message Interface for the same is "InvoiceRequest_Out" .
    For reference please check
    http://help.sap.com/saphelp_srm70/helpdata/en/74/344c430fab4d0bbc30996d56cc293a/frameset.htm
    Regards,
    Kalandi

  • CS: Credit memo from Repair Order (RA)

    Dear Experts,
    I am trying to create a credit memo from my sales orderin lieu of return of a defective product,  I am using the repair procedure which generates item category IRGN for credit memo.
    My question; Since using repair procedure gives me a sub-item I am not sure how to go about billing it and also can I bypass the credit memo request creation and directly create Credit memo, how?
    Kindly advise with your inputs on this scenario.
    Thanks

    Solved. Used Invoice(for Repair) to create credit memo.

  • Credit Memo from Retro Billing

    Hello Gurus!!
    Can anyone please help me
    Scenario:
    I have created a credit memo from retro-billing due to price drop, and released the credit memo to accounting.
    Problem:
    When we look at the accounting document of the credit memo it doesn't have a controlling document and profitability analysis.
    I have simulated the document at KE4ST, and here is the error message I got
    Document is not profit-related and thus could not be transferred
    Message no. KF755
    Diagnosis
    Sales document was not transferred to Profitability Analysis (CO-PA) because it is not relevant for the analyses in CO-PA. This can be due to one of the following reasons (among others):
    The document type is not profit-related, such as an inquiry
    The sales document shows zero for the quantity
    The sales document has been denied
    The sales document is locked due to credit reasons
    Please anyone give me an idea on how can I resolve this..
    Thank You!!!!

    Hi Carla,
    I saw your the issue you posted on SDN.
    We are facing exactly the same problem. We could not see the solution how you resolved this problem.
    Can you tell us how have you resolved this ??
    Would be great help to us.
    Thanks,
    Apte C.M.

  • Free goods are not copying in credit memo from invoice

    Dear Gurus,
    I have made a invoice having two line items 1.normal goods with sale price and 2.free sample goods(part of promotional scheme) without any sale price.
    but while making credit memo for receiving goods back in cancellation of invoice , i am facing problem for free goods. system is not copying the free goods in credit memo and copying only normal goods.
    what can be problem for not copying? whether i am following some wrong procedure or some configuration is missing.
    please advise me with your valuable suggestions.
    Thanks in advance
    Parag

    hello, friend.
    first of all, the free goods are not relevant for credit memo since the customers never paid for these in the first place.
    however, i observed that after cancelling the invoice, you still issued a credit memo?  this may not be the proper process.  when you cancel the invoice, entries into the customers Accounts Receivables are reversed as well (we are assuming no payments are posted yet).  so there is no need to issue credit memos. 
    if you are referring to another process, please clarify the same.
    regards.

  • HT3702 How do I remove My credit card from this account?

    How do I remove My credit card from this account?

    Go onto iTunes on your computer, on the right side of the home page of the iTunes store, click Account Information. Click the Edit button next to Payment Type. On the top of the screen, where it shows different types of credit cards (Mastercard, Visa, etc.) click None. Then scroll down and click Done. TA DA! Hope this helps!

  • SD Credit memo from Dispute management

    Hi Experts
    I need help in creating credit memo from Dispute management. I have contacted SAP for it and they suggested that it would be customization. Requirement is to create Credit memo directly from Dispute management module (Having a tab in UDM_Dispute ). Once i select that option it should create VA01 credit memo belongs to dispute details (assuming dispute was created belongs to SD billing document).
    Can anyone direct me on which BAPI to be activated and which workflow event to get triggered etc?
    Appreciate any help and points will be rewarded.
    Thanks
    Aleem

    Hi Aleem
    Were you able to accomplish that? If yes, can you please share the details? We have a similar requirement and want to initiate a credit memo request from dispute case.
    Thanks
    Swati

  • Create a Credit Memo from invoice  (Sales)

    Hi
    How Can I Create a Credit Memo from invoice (Sales)?
    Thanks

    Hi Joe,
    Check our SDK sample C:\Program Files\SAP\SAP Business One SDK\Samples\COM DI\VB.NET\05.OrderAndInvoice to understand the procedure. You will have to create your own sample by using Invoice and Creditmemo you just have to instantiate your document object as oCreditNotes.
    Check the documentation as well of the Document Object.
    Regards,
    Felipe

  • Single row from this query without create a group by

    Can I have a single row from this query without create a group by on tipo (TIPO can have only 2 value (A,D)
    SELECT
    CASE TIPO
    WHEN 'D' THEN SUM(IMPORTO) ELSE 0 END DIMPORTO,
    CASE TIPO
    WHEN 'A' THEN SUM(IMPORTO) ELSE 0 END AIMPORTO
    FROM MGIORNALE
    WHERE K_CONTO = '100001' --CONTO
    AND DECODE(T_MOVIM,'MRAP',TO_DATE('31/12/'||to_char(a_competenza),'DD/MM/YYYY'),DATA_RG)
    -- BETWEEN DATAA AND DATAB
    BETWEEN '01/01/2006' AND '31/12/2006'
    --GROUP BY TIPO
    --AND TIPO = COL_conto
    Thanks in advance

    Is like this?
    sum (CASE TIPO
    WHEN 'D' THEN IMPORTO ELSE 0 END) DIMPORTO,

  • F110 - Exclude Credit Memos from original Invoice

    Good afternoon,
    Our go live was 1 month ago.
    We have prepared automatic payment process and everything works perfectly. Mainly, we base our process in the Payment Method Supplement field. Some payment methods group documents following different rules (restricted to 7 rows or as many as request).
    Our problem is that our customer does not want credit memos to be included never there (payment terms are taken from original invoice and when they pay the invoice, this credit is included). They want to identify ALWAYS what they are paying fulfilling the Payment Method Supplement field.
    Is there any chance not include the credit memo in these payments? For example, not copying Payment Method Supplement from the original invoice? any other idea? Please let me know. Regards,
    Javier

    Hi Renfe Proyecto Auge ,
    You can exclude Credit memos in Additional Fields there you have to select Excluded and from hidden field select document radio button and from the list select Document Type (BKPF-BLART),
    after this you have to choose Document type credit memo what ever you maintained for Credit memo, accordingly system will exclude the values from Automatic Payment Run.
    Regards
    Sridhar

  • Subtracting a Credit Memo from Invoice

    I have looked all over the forum for the right answer and cant locate what I need.
    I am witting a Royalty Report and need to find the best way to subtract credit memo's from invoices.
    I know that the OINV.DocEntry = RIN1.BaseEntry but the numbers are not correct.
    If anyone can help on a query or more info on the best way to do this I award points..
    Thanks,
    Craig

    hi,
    Check this links
    LINKING CREDIT MEMO TO INVOICE
    Credit Memo and A/R Invoice linking
    Jeyakanthan

Maybe you are looking for

  • Problems with explain plan and statement

    Hi community, I have migrated a j2ee application from DB2 to Oracle. First some facts of our application and database instance: We are using oracle version 10.2.0.3 and driver version 10.2.0.3. It runs with charset Unicode 3.0 UTF-8. Our application

  • An exception occurred during account Search

    Hi Experts, On Account Search , I am getting the below exception. Cannot display view BP_HEAD_SEARCH/MainSearchResult of UI Component BP_HEAD_SEARCH An exception has occurred Exception Class  CX_BOL_EXCEPTION - Access Previously Deleted Entity Method

  • Attempting to create a AQ$_JMS_MAP_MESSAGE via PL/SQL

    I'm attempting to create a AQ$_JMS_MAP_MESSAGE via PL/SQL but can't get it to work. I'm able to create a AQ$_JMS_MESSAGE and add it to an AQ (of the correct type) however the AQ$_JMS_MAP_MESSAGE can not be constructed in the same way as it does not h

  • How to reference Business Objects Assembly in C#

    For one of our project, we are creating BO Reports (as .REP, .PDF files) and it is automated one using macros. In macros, we are passing parameters to the report. Now we need to reimplement the same in .NET. We have installed Business Objects XI Rele

  • Can't download a program

    I recently got a new MacBook Pro.  I had a data transfer done, but when I launch the computer, a geneaology indexing program that allows me to work off-line on transcribing records is not on the computer.  I tried to download it again from FamilySear