SALES REPORT (Credit memos Subtracted)

Hi all,
I would like to come up with a detailed Sales Reports that shows the Quantity and Value of items sold per day (AR Invoices) excluding the credit memos. I later want to use the same query in crystal reports. I came up with the below query; the select statements are executing individually but using 'UNION ALL' I am getting a 'Conversion' error.
SELECT T0.[CardCode]Code, T4.[SuppCatNum]cat, T4.[FrgnName]frn, T1.[Quantity]InvQ, T0.[DocTotal]InvT,0 MemoQ,0 MemoT FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry full outer JOIN OSLP T2 ON T0.SlpCode = T2.SlpCode full outer JOIN OUSR T3 ON T0.UserSign = T3.USERID full outer JOIN OITM T4 ON T1.ItemCode = T4.ItemCode WHERE (T1.WhsCode='MLO01' or T1.WhsCode='ARG01')  AND T0.DocDate=[%0]
union all 
SELECT  0 Code, 0 cat, 0 frn, 0 InvQ,0 InvT, T1.[Quantity] MemoQ, T0.[DocTotal] MemoT FROM ORIN T0  INNER JOIN RIN1 T1 ON T0.DocEntry = T1.DocEntry full outer JOIN OSLP T2 ON T0.SlpCode = T2.SlpCode full outer JOIN OUSR T3 ON T0.UserSign = T3.USERID full outer JOIN OITM T4 ON T1.ItemCode = T4.ItemCode WHERE (T1.WhsCode='MLO01' or T1.WhsCode='ARG01') AND T0.DocDate=[%0]
kindly assist refine this query or come up with a better one altogether. Thank you.

Hi,
Try:
SELECT T0.CardCode Code, T4.SuppCatNum cat, T4.FrgnName frn, T1.Quantity InvQ, T1.LineTotal InvT,0 MemoQ,0 MemoT
FROM OINV T0
INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry
LEFT JOIN OITM T4 ON T1.ItemCode = T4.ItemCode
WHERE (T1.WhsCode='MLO01' or T1.WhsCode='ARG01') AND T0.DocDate=[%0\]
union all 
SELECT  '', '', '', 0,0, T1.Quantity, T1.lineTotal
FROM ORIN T0
INNER JOIN RIN1 T1 ON T0.DocEntry = T1.DocEntry
LEFT JOIN OITM T4 ON T1.ItemCode = T4.ItemCode
WHERE (T1.WhsCode='MLO01' or T1.WhsCode='ARG01') AND T0.DocDate=[%0\]
Thanks,
Gordon

Similar Messages

  • Define key figures -incoming order, invoiced sales and credit memo in BW

    Hi everyone,
    I combined two ODS into one ODS from 2LIS_11_VAITM & 2LIS_13_VDITM. I want to generate reports that contain net value, cost of incoming order, invoiced sales, and credit memo'(SD module).
    I tried to create some calculated key figures in BW that contain the net value and cost of incoming order, invoiced sales and credit memo. However, i couldn't find relative fields to define them.
    Can anyone provide help regarding how to create those key figures in BW? Thank you.

    Hello John,
    I think the best way to check it out is by looking at the business content. There might be mapping already defined for the fields you are looking for. The one standing out is perhaps the net value 'ONET_VALUE'.
    Please try to use as much of content KF as possible. A good approach to finding the right info-objects is by searching the business content by info-sources and marking the grouping as 'Collect before and afterwords', it should list down all the dependent info-objects.
    Hope that helps.
    Cheers, Ashu

  • Cost center in Sales Order/Credit memo request

    Hi SAP Gurus,
    There is a requirement from our client. They are processing Credit Memo from SD VF01 via Credit memo request. The want to assign Cost center in the line items which is greyed out at the time of processing in VF01.
    I also verified in the Credit memo request in VA02 even there is no field available for to maintain  Cost center in line item so that at the time of billing it can  derive.
    Please advice whether can we assign the Cost centers in Sales order/Credit memo request line items?.
    Regards
    NTH

    Hi NTH,
    In the standard system, the field cost center is only ready for input
    if the sales document category is VBAK-VBTYP= I (that is, order without
    charge). For all other order types, you can make it visible by entering
    an order reason provided that the combination of the sales area and the
    order reason has a cost center assigned in OVF3. To change this standard
    behaviour, USEREXIT_COBL_SEND_HEADER can be used. There you can find a
    short example on how to make a field visible and modificable in the
    account assignment screen.
    Moreover, please take into account that the account assignment to a cost
    center is possible only at header level. So it is not possible to
    insert the cost center at item level, you can only insert it at header
    level.
    The cost center determination takes place in
    FV45KF0V_VBAK-KOSTL_ERMITTELN and is reading from table TVAUK.
    This table can be maintained in transaction OVF3.
    If you wants to be able to enter the cost center manually in the
    account assignment screen (header level), you can use  the user exit
    FV45PF0C_COBL_SEND_PBO_VBAK (SAPMV45A) - there you can find a short ex
    ample on how to make a field visible and modifiable in the account
    assignment
    I hope that this information is of assistance to you. Thanks!
    Regards,
    Alex

  • Creation of sales order(Credit memo request) w.r.t invoice

    Hi want to create a Credit memo request (sales order) with respect to a invoice.
    Can any body suggest me a bapi or Fm which will directly create a sales order with input as invoice number?
    Also all mandatory import export parameters to be filled?
    Thanks in Advance,
    Rohan.

    You should be able to use one of these BAPIs (depending on your release - the ...2 one is the lates and greatest, it seems):
    BAPI_SALESORDER_CREATEFROMDAT1
    BAPI_SALESORDER_CREATEFROMDAT2
    BAPI_SALESORDER_CREATEFROMDATA
    You'll find a lot of information on them anywhere, please use search. There is also a decent documentation available for each one of them.
    The invoice reference will have to be entered as follows (note that it's always at line level):
        order_items_in-ref_doc = <invoice number = VBRK-VBELN>.
        order_items_in-ref_doc_it = <<invoice line number = VBRP-POSNR.>.
        order_items_in-ref_doc_ca = 'M'.   " or whatever category is applicable
    Keep in mind though that BAPIs do NOT always work the same way as VA01. If, for example, you have the requirements and copy routines (VOFM), they might get bypassed when creating an order with BAPI.
    Any follow-up questions I'd suggest to post in ABAP forum. Good luck!

  • Sales Return: credit memo Should generate automatically with goods reversal

    DEAR SD GURUS N EXPERTS,
    Currently we are using following system of Sales return.
    VA01: (Order Type: RE) --> VL01N (Return Delivery) --> VL09 (Goods Reversal) --> VA01 (Request 4 Credit Memo or remove billing bloc) --> VF01 (Credit Memo)
    But, now my client want a such configuration that entry of Credit memo should happen along with Goods Reversal (VL09) - Automatically. They don't want to carry out VF01 separately.
    Reason behind it: Customers has credit Limit, Suppose a customer has a Credit limit of 5,00,000 and we have delivered the Material of same amount. It means all the credit limit has been used. But now He has returned the material of 2,00,000. But it will not affect the credit limit until we pass Credit memo.
    Please suggest the required configuration and what we can do in such scenario. Thanks in Advance.
    DSC

    Again I can tell you that the process what you were following (reversing the goods receipt) is totally wrong and it will have a serious negative impact on inventory.  Either you should not create a return delivery or take the stocks into parent plant.  If you dont want to show in inventory, then scrap it which is a standard process.
    Coming to the requirement, there is no standard way to achieve this.  Check these threads where the same topic was discussed
    [Re: How to set up in SAP to have automatic billing after PGI |Re: How to set up in SAP to have automatic billing after PGI]
    [automatic billing|automatic billing]
    You have to apply the same logic for credit note also.
    thanks
    G. Lakshmipathi

  • Problem in Sales Order Credit Memo

    Hello All,
    The problem is related to item category ZTAN where we have changed the Completion Rule to B and in VTAF ( Bill to Order Copy Control) under Item details for Credit Memo Request for example from Domestic Invoice to Credit Memo we changed the positive/negative quantity updation to positive. Now after changing the completion rule we were facing a problem where after completion of Sales Process till generation of Invoice the document flow was showing the status as :Being Processed". Then after changing the Completion Rule again to 'blank' the problem of document flow status was solved as it showed the status as "Completed".
    Now after doing this change in Item Category for normal sales order we are facing a problem in Credit Memo where again after completion of Credit Memo the document flow status here is showing as 'Being Processed' instead of 'Completed'. Please suggest what configurations need to be done to get the desired result which is in Credit Memo after completion the status will show as "Completed".
    Thanks & Regards
    Priyanka Mitra

    Hello Mr. Shiva Ram,
    First of all thanks a lot for your help.The problem of credit memo is now solved but to resolve the status of the existing sales order documents as per your suggestion we have run the  program SDVBUK00 in SA38.Still we didn't get the desired result as the status of the completed normal sales orders are still showing "Being Processed" even after running the program.
    Please suggest what else need to be done to change the status of the completed sales documents till invoice.
    Regards
    Priyanka Mitra

  • Depo sales returns --Credit memo issue

    1.Sales Order (Return Order)
    2. Delivery (Return Delive PGR)
    3.Incoming Excise Invoice using Transaction J1IG with referenc to return Material Document then RG23D  will update.
    4. Credit memo -- here only excise values are not copying from return sales order.
    can any one give the inputs where i am doing mistake i have check the VTFA copy control also

    Hi
    Customer receives the goods in his factory premises and returns back to us due to quality problem. Now in this case user has to create the return order to credit memo.
    Maintain a vendor
    Maintain vendor as u201CCustomer Returnu201D in XK01 for the company code, purchase organization and account group combination
    Maintain finished material as input material
    Transaction: J1ID
    Select radio button namely CENVAT Determination
    Maintain plant, input material and output material combination. The input as well as output material will be same ,
    Now go to transaction J1IEX for capturing the excise invoice sent by customer with returned material
    Select Capture excise invoice without Purchase order reference
    Enter Customeru2019s excise invoice number, excise group, document date, Vendor (Customer Return) and posting date as shown below
    Now at item details, maintain material code, material type u2013 Raw Material, plant, quantity, unit of measure, duty rates and duty values, excise base etc.

  • Copy a sales order to creade a sales order credit memo request

    Hi,
    I copied a sales order from i.e. 100.000 (type ZMA) to another one i.e. 200.000 (type ZCMR), the last one is a Credit Memo Request.
    Now when I try to create the credit memo by VF01 for the sales order 200.000, I'm getting the error message: ZCMR ZPOS cannot be invoiced with billing type ZCM.
    I would create the credit memo from the sales order type ZCMR
    Is this possible ?
    Best Regards

    Hi,
    In general the Credit memo request would be created referncing the Invoice. 
    In your case, you have mentioned that credit memo request is created a Sale order. Not sure of the specific scenario if you have any,
    on point 2, yes,  you may create Credit memo referencing the Credit memo request.
    In all places, check for the copy controls from the preceding document to the successing one.
    If this helps,  Text Removed
    Regards,
    VBASHA.
    Edited by: Lakshmipathi on Feb 3, 2012 5:13 PM
    Dont add such comments and deviate the forum rules

  • Return Order Credit Memo updation in WBS element

    Hi,
    I have an issue on the automatic updation of return order for WBS element, once the sales order is been assigned to the wbs and billing is done payment also made by the customer and wen the customer sends the return order stating that in those goods he wont require some goods than in sales cycle credit memo is done for the payment return to customer but is there any place where the wbs gets updated for the revenues deduction of the payment given back to customer where its has to be deducted................how to do this
    Kindly help me doing this.
    Thanks and Regards
    Praveen B M

    Hello,
    Thanks for you reply and i just want to know that.
    If we assign the return order to the WBS element, the credit memo automatically has the WBS element assigned to it or do we have to manually assign the credit memo to a WBS element? if yes how?
    Thanks and Regards
    Praveen B M

  • Credit memo print problem

    Hi Friends,
    The present process is return sales , in which return sales order created with reference to sales order, Credit memo request created and Credit memo also created.But the problem is not getting print preview and print.Error message is Excise invoice corresponding to the document type is not found.
    We are generating Excise invoice Automatically, Is there any effect of this on the present issue.Please give some hint.
    Thanks
    Chetan

    Hi Ashish,
    Excise invoice not created automatically, when I tried to create it is giving a message billing doc does not exist.
    Thanks
    Chetan

  • Credit memo print preview problem

    Hi Friends,
    The present process is return sales , in which return sales order created with reference to sales order, Credit memo request created and Credit memo also created.But the problem is not getting print preview.Error message is Excise invoice corresponding to the document type is not found.
    We are generating Excise invoice Automatically, Is there any effect of this on the present issue.Please give some hint.
    Thanks
    Chetan

    Hi,
    See normally we have excise invoice creation automatic when invoice is saved. In such cases we have a check in the print program of invoice, which prevents its printing if excise invoice is not created.
    In case of credit memo, you might not be creating any excise invoice, but the print program attached might be preventing its printing also.
    Check that such a check is given in print program for credit memo output, if yes you may have to remove it.
    Hope this helps you.
    Regards,
    Dhananjay

  • What is the TCODE  for credit memo generarion

    Please tell me the steps to create a credit memo !

    Hi,
    You can create credit memo in different ways
    Credit memo with ref. to invoice - VF01
    Credit memo Req. -VA01 w.r.t to invoice or sales order
    Credit memo w.r.t credit memo req. - VF01.
    Regards,
    Satish

  • Rebate processing and creating credit memo equest automatically

    Hi all,
    I execute the extented rebate process and when it's executed, B3E bill type is created automatically.
    But, here i want the system create B3E sales order(credit memo request) create and manually create the bill when i intend to.
    If you ask why, i want to use "order reason" in the sales order-the standart SAP usage.
    Is it possible? I there any customizing for this to happen?
    regards,
    Mary

    For creating credit memo request use business object BUS2094
    You can also try the function module  BS01_SALESDOCUMENT_CREATE

  • New pricing procedure for Credit memo request

    Hi All,
    I used pricing procedure ABC01 for sales and billing.
    I want to use new pricing procedure ( ABCO2) at the time of creating credit memo request, this credit memo req is with reference to Billing document.
    If I dont use with ref to billing document I can able to create credit mem req with pricing procedure ABC02,
    but if I am trying to create credit mem req with ref to billing document the pricing procedure in the billing document is being picked which is ABCO1.
    Can any one suggest where I am doing wrong.
    I maintained all the relevant copy controls.
    Thanks & Regads
    BVDV

    Hi
    Assign Document pricing procedure Z in VOV8 for CR document type , Now do the pricing procedure determination in OVKK with sales area + Cupp+Dupp=new pricing procedure
    Example :
    In OVKK, determine with 1000 + 10+ 10 + A+ 1 = standard pricing procedure for normal sales
    For credit memo in OVKK determine with 1000 + 10+ 10 + Z+ 1 = New pricing procedure for Credit memo
    Then when you create a sales order (with document type CR ) with reference to billing document then the new pricing procedure will get copied.
    Regards
    Srinath

  • 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

Maybe you are looking for

  • Elements 8 - How to view images by scrolling thru folder of file names?

    After taking a large batch of pictures, I want to place them in a folder and rapidly view the full images one at a time to select which to keep and which to discard.  IN PE-8 how can I display two panes - one pane containing the image file names cont

  • How to add Signatre to Standard Purchase Order Template XSL-FO

    I need to add digital signature to the standard Purchase Order Template which is sent to supplier. could you let me know the process. thanks Edited by: 855902 on May 24, 2011 8:00 PM

  • Oracle 10g EM is not working properly

    Hi all! I just installed a new database of Oracle 10g (10.1.0.2) and applied patchset (10.1.0.4). After all I started the OEM using emctl start dbconsole, it starts alright and I'm able to login on the database using the SYS as SYSDBA user. When it g

  • Alv report download

    hai to all, I am trying to download the alv report to excel file by using the push button which is availabe in APPLICATION TOOL BAR. But i not able to perform the same , i am getting empty excel file. What will be the problem, please tell me where ia

  • Exit for ME52N

    Hi All, While changing a Service PR we found that the GL account field is INPUT-DISABLED. SAP standard determines the GL account through Material group only once . Can anybody kindly suggest any altrnative to UPDATE the GL account if the material gro