Query for Item wise sales report

Hi Guys,
Below is the query i have used to run Sales Register.
But we need Item wise sales register  and those Excise Duty calculations are needed for item wise instead of total document wise. Pls update the query ...
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

Hi experts..
Pls   Update the Query

Similar Messages

  • Query for Item wise Sales.......

    *Hi Guys, Below is the query i have used to run Sales Register. But we need Item wise sales register and those Excise Duty calculations are needed for item wise instead of total document wise.
    Pls update the query ...*
    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

    Closing this ...
    Edited by: Parimis on Jun 25, 2010 5:44 PM

  • Please any one provide crystal report for  Location wise sales report with GP

    Please any one provide crystal report for  Location wise sales report with GP.Please its urgent

    A report writer tool like Crystal reports is not available due to the cost involved in its licenses.Do you think that Oracle Reports is free then? It's $$$$.
    You can download and test it for free, but if you want to use it in production you have to buy a license.

  • Monthly wise Sales report - Help me

    Dear SDN mates
    Is there any standard reports for Monthly wise sales report ...the SAP1 , SAP2 reports were not helpful....Does this can be solved by standard reports or it needs to be customized????
    kindly help me?

    hi,
    check VC05 transaction.

  • Datasource or Cube for GL wise customer wise sales report

    Hi BI Masters,
    I am using Bi. 7.0, there is requirement for Sales report i.e.  'GL wise customer wise Sales Report '. For this i am searching standard  datasource or cube which can help to develop the desire report. i shall appreciate all of you if you can share your experience in this type of requirement.
    With Best Regards & Thanks
    Kamal Purohit
    INDIA

    Hi,
    Check the following datasource in ECC in RSA5.
    0FI_GL_10                         General Ledger: Leading Ledger Balances
    0FI_GL_11                         General Ledger: Balances of Leading Ledger via Line Items
    0FI_GL_12                         General Ledger: Balances of Leading Ledger via Delta Queue
    0FI_GL_2                          General ledger: Transaction figures - Cost of sales ledger
    0FI_GL_4                          General Ledger: Line Items with Delta Extraction
    0FI_GL_6                          General Ledger Sales Figures via Delta Extraction
    0FI_GL_7                          General Ledger Cost of Sales Ledger via Delta Extraction
    0FI_GL_8                          General Ledger: Statistical Key Figures
    0FI_TX_4                          Taxes: Line Items by Means of Delta Extraction
    Thanks
    Reddy

  • Territory Wise Sales Report

    I want to generate territory wise sales report using sql server reporting services from sap b1.  How can I define the hierarchy where my state will be the top group, the territories will be the sub groups and the executive name and sales value will be the details.  How can I transform the parent, child relation into a group, sub group option in a report.  Kindly provide sample sql query for the same.
    Thanks in advance.

    Dear Gordon,
    As advised by you i have created territory hierarchy in the territory setup, where zone is the first level, state is the second level and territory (district) is the third level and in the BP master territory field this third level is picked. I am finding it difficult to develop hierarchy wise report where the report when run should show the zone wise net sales summary (net in the sense, minus all the sales returns and credit notes, etc) and when drilled should show the state wise total and in the last level the territory wise sales and if possible one more drill where the BP under that territory with sales amount will be shown.  Request you to kindly help me with a base query wherein i can modify the same to develop many variation of the same report.  Thanks in advance.

  • Can i get month, quarterly, half yearly, yearly wise sales report basing on

    hi,
    sap gurus,
    good evening to all,
    how can i get month, quarterly, half yearly, yearly wise sales report basing on division and material.
    is there any std transaction code for that.
    customization is requried for that.
    regards,
    balaji.t
    09990019711

    Standard SAP SD Reports:=
    Statistic Group:
    Purpose u2013 To capture data for Standard Reports, we require to activate Statistic Group as under:
    --> Item category (Configuration)
    --> Sales document type (Configuration)
    --> Customer (Maintain in Master data)
    --> Material (Maintain in Master data)
    When you generate statistics in the logistics information system, the system uses the combination of specified statistics groups to determine the appropriate update sequence. The update sequence in turn determines for exactly which fields the statistics are generated.
    Configuration:
    IMG --> Logistics Information System (LIS) --> Logistics Data Warehouse --> Updating --> Updating Control --> Settings: Sales --> Statistics Groups -->
    1. Maintain Statistics Groups for Customers
    2. Maintain Statistics Groups for Material
    3. Maintain Statistics Groups for Sales Documents
    4. Assign Statistics Groups for Each Sales Document Type
    5. Assign Statistics Groups for each Sales Document Item Type .....
    All Standard Reports which are available are as under:
    SAP Easy Access: Information Systems -> Logistics -> Sales and distribution ->
    1. Customer -> Incoming orders / Returns / Sales / Credit memos / Sales activities / Customer master / Conditions / Credit Master Sheet
    2. Material -> Incoming orders / Returns / Sales / Credit memos / Material master / ...
    3. Sales organization -> Sales organization / Sales office / Sales employee
    4. Shipping point -> Deliveries / Returns
    5. SD documents -> Orders / Deliveries / Billing documents ...
    & so on.
    Regards,
    Rajesh banka

  • Region wise Sales Report / Sales Analysis

    Hi,
             I have a requirement of Region wise sales report. I have searched in the forum and found that I could acheive it through SE16-->VBRK-->REGIO field . I have tried executing the same, but the problem is when ever i am trying to pull up the sales for a particular region the system is giving an invoice number. But when I go to that particular invoice and see the PAYER , the PAYER is in the different region.
             Please let me know which region the system considers at the table level. I mean to ask which region the system considers for a particular transaction.
    Thankyou,
    Rakesh Tummala.

    Hello Rakesh,
    I am facing a similar issue that you are facing.  Yes, there is a region populated on the billing document in table VBRK.  However, depending on how your order entry is configured, the region listed in the billing document isn't necessarily the region the materials were shipped to.  To fine tune your requirement, are you looking for a report where the ship-to address is in a specific region or where the payer or sold-to address is in a specific region?
    If it's the ship-to address in a specific region, you'll need to develop a table join query in SQ01.  Join the tables VBRK --> VBPA --> ADRC.  VBRK is the billing document header table.  VBPA is the partner table where SH (ship-to partner) can be determined and it gives you an address code.  ADRC is the Business Address Services table that reads the address code and provides the address.  In the next step, make sure ADRC-REGION is a selection field so that you can specify the region.  Then, run the query, ensure VBRK-NETWR is an available field so that you can calculate the net value of billing documents for the specified region.
    If it's the payer or sold-to address in a specific region, this is easier since it's master data and not transaction-specific data (remember, your customer service group could be manually changing the ship-to location when creating a sales order, which is why you would need to follow the aforementioned steps).  You can do a quick search for accounts within a specified region then obtain the information in VBRK for the specified payers.
    I hope this information helps you, please provide questions if you need further clarification.

  • Sales employee wise sales report

    Hi,
    Can anyone explain me,how to write functional specifications to obtain sales employee wise sales report?
    Thanks in advance..
    Regards..
    Yogi...

    Hi
    This is the standard T Code for sales employee-MCTI
    But as per your requirement we hv to create.
    Examplemy past implimantation..we hv captured sales employee as partner function.sales employee1& 2  with peoper  partner determination proceture.then we hv captured at Billing document Header Partner function.
    This Sales employee name has to captured through HR Master data.According U hv to say only the business process and from where data has to captured to ABAPER.
    I think it ll help
    Regards
    JAGA

  • Customer group wise sales report

    can somebody give me a clue as to how to take customer group wise sales report
    thanks

    HI,
    it will not get the sales report with customer group wise in standard SAP.
    in standard you will get the data for the following selection :
    a. Sales Office wise : MC-E
    b. Sales Organization wise : MC+2
    c. Material(Article) wise : MC+Q
    tell me one thing, whether u need the report customer group wise or customer account group wise.
    Regards,
    somu.

  • Query for item master data

    hi all,
    i want to create a query for items in the item master data that shows the changed field, the old value, the new value, user name and the date it was changed .
    can anyone help please.
    ciao

    thanks for the reply
    my clients internal auditors require that they have Exception Reports in SAP , i.e reports that can show changes made, date and by which user etc...
    1. changes made to item master data
    2. changes made to business partner master data
    3. changes made to invoices, purchase orders etc..
    this reports can be set in query form or xl reporter..
    i tried but couldent find the tables ....
    any sugestion will be appriciated..

  • Query for non turn customer report in service module(Add-on)

    Hi,
    I want create  query for non turn customer report, that mean the customer who are not come for  last 6 months to our service workshop in service module(Add-on). this is a scenario. 
      SELECT T1.U_CardDate, T1.U_JCardNo,T1.U_TypeSrv,T2.U_VehReg,T2.U_PurchDt, T2.U_VehDesc, T2.U_VehModel, T1.U_KmsRead,   T1.U_BPCode, T0.CardName, T0.AddrType , T0.Building,T0.Block, T0.Address,T0.City,T0.ZipCode, T0.State1,T0.MailBuildi,T0.MailBlock, T0.MailAddres, T0.MailZipCod, T0.MailCity, T0.State2 ,T0.MailAddrTy,  T0.Phone1, T0.Phone2, T0.Cellular FROM [dbo].[OCRD]  T0 INNER JOIN [dbo].[@ALD_JOBCARD]  T1 ON T0.CardCode = T1.U_BPCode INNER JOIN  [dbo].[@ALD_VEHMAST]  T2 ON T1.U_BPCode = T2.U_BPCode WHERE T1.U_CardDate BETWEEN [%0] AND [%1] ORDER BY T1.U_CardDate.
    this query is get all  customer data who are not come to service workshop for last 6 month. i want to filter data who are not come last 6 months this year. kindly assist me
    thank you.

    Check this:
    SELECT Max(T1.U_CardDate) 'Lase Serve Date', T1.U_JCardNo,T1.U_TypeSrv,T2.U_VehReg,Max(T2.U_PurchDt) 'Last Purchase', T2.U_VehDesc, T2.U_VehModel, T1.U_KmsRead, T1.U_BPCode, T0.CardName, T0.AddrType, T0.Building,T0.Block, T0.Address,T0.City,T0.ZipCode, T0.State1,T0.MailBuildi,T0.MailBlock, T0.MailAddres, T0.MailZipCod, T0.MailCity, T0.State2 ,T0.MailAddrTy, T0.Phone1, T0.Phone2, T0.Cellular
    FROM [dbo].[OCRD] T0
    INNER JOIN [dbo].[@ALD_JOBCARD] T1 ON T0.CardCode = T1.U_BPCode
    INNER JOIN [dbo].[@ALD_VEHMAST] T2 ON T1.U_BPCode = T2.U_BPCode
    WHERE T1.U_BPCode NOT IN
    (SELECT DISTINCT U_BPCode FROM dbo.[@ALD_JOBCARD] WHERE DateDiff(DD,U_CardDate,GetDate()) < 183)
    Group By T1.U_JCardNo,T1.U_TypeSrv,T2.U_VehReg,T2.U_VehDesc, T2.U_VehModel, T1.U_KmsRead, T1.U_BPCode, T0.CardName, T0.AddrType, T0.Building,T0.Block, T0.Address,T0.City,T0.ZipCode, T0.State1,T0.MailBuildi,T0.MailBlock, T0.MailAddres, T0.MailZipCod, T0.MailCity, T0.State2 ,T0.MailAddrTy, T0.Phone1, T0.Phone2, T0.Cellular
    ORDER BY T1.U_CardDate

  • How to create sql query for item master with operator LIKE with variables?

    hi all,
    How to create sql query for item master with
    operator LIKE(Contains,Start With,End With) with variables using query generator in SAP B1 ?
    Jeyakanthan

    Hi Jeyakanthan,
    here is an example (put the like statement into the where field)
    SELECT T0.CardCode, T0.CardName FROM OITM T0 WHERE T0.CardName Like '%%test%%'
    The %% sign is a wildcard. If you need start with write 'test%%' and otherwise ends with '%%test'. For contains you need '%%test%%'. You also could combinate this statements like 'test%%abc%%'. This means starts with test and contains abc.
    Regards Steffen

  • Query For Series wise Collection

    Hi
    Please anyone provide  query for series-wise collection

    Satish Doke,
    Im using this query as "Series Wise Outstanding" I want to create another  query for "series wise collection".How can  i do this.Im not into SAP accounting.Please help.
    DECLARE @Date AS DATETIME
    DECLARE @Series AS varchar(30)
    DECLARE @Branch AS varchar(30)
    DECLARE @Exec AS varchar(30)
    /* SELECT FROM [dbo].[OINV] S0 WHERE */ SET  @Date = /* S0.DocDate*/ '[%0]'
    /* SELECT FROM [dbo].[NNM1] S2 WHERE */ SET  @Series = /* S2.SeriesName*/ '[%2]'
    /* SELECT FROM [dbo].[OLCT] S3 WHERE */ SET  @Branch = /* S3.Location*/ '[%3]'
    /* SELECT FROM [dbo].[OSLP] S4 WHERE */ SET  @Exec = /* S4.SlpName*/ '[%4]'
    if( @Exec ='') set @Exec ='%'
    if( @Series ='') set @Series ='%'
    if( @Branch ='') set @Branch ='%'
    if( @Date ='') set @Date =GETDATE()
    Select distinct OINV.CardName [Customer Name], ISNULL(NNM1.SeriesName ,'-')+'/'+ CAST(OINV.DocNum as varchar) [Bill No.],
    OINV.DocDate [Bill Date],INV1.Dscription,INV1.Quantity,
    OINV.DocTotal - OINV.PaidToDate [Out Standing Amount],
    DATEDIFF(dd,OINV.DocDate,@Date)[No of Days]  from OINV
    inner join INV1 on OINV.DocEntry = INV1.DocEntry
    inner join OLCT on INV1.LocCode = OLCT.Code
    inner join NNM1 on OINV.Series = NNM1.Series
    inner join OSLP on OINV.SlpCode = OSLP.SlpCode 
    where OINV.DocType ='I' and (OINV.DocTotal - OINV.PaidToDate)>0
    and NNM1.SeriesName like @Series and OINV.DocDate<= @Date
    and OLCT.Location like @Branch and OSLP.SlpName like @Exec

  • How to identify Sale Order costing is required for Items in Sales Order

    Howstandard cos estimate*w to identify Sale Order costing is required for Items in Sales Order?
    On which criteria we can conclude Sale Order Costing is reqd ?
    ? * means what and wat is the purpose and how to chk for the Item in Sales Order, either it is required or not**.

    Hi Dharamveer,
    The best way is to make the order qty is equal to the quantity delivered. This way, when some one looks at this order in future - they think that the order was for X and the delivery was for X qty is completed. They will not know the background of the issue unless they go through change log. Even in change log, they see that the Ord qty was adjusted, but may not understand why?
    The good practice is to make order qty equal to already delivered qty.
    Create a new line for the remaining qty and reject the same with appropriate reason for rejection. This way, any one can understand the background , the reason for rejection easily. Hope it helps !

Maybe you are looking for

  • ITunes wont work because of DEP

    My itunes wont work because of DEP closing it. I have tried unistalling my quicktime and unistalling my itunes and reinstalling them but it still wont work. i have followed a couple of discussions but  it still wont work. Can someone help me please.

  • No commitment item entered in item 00001 1000 5100004

    Hi Gurus, I'm using IDES company code: 1000 company code for posting some invoices. I created my own G/L accounts and trying to post telephone expenses & it is giving the above error. It says to deactivate the Funds Management & Commitment management

  • How to run labview program in debugging mode in windows 95 version

    Respected all, I am facing probelm while running probe.vi. I received this command "connection to acquisition board was not found" when i run labview program. I  am using labview 5.1, fieldpoint FP 1000, NI-DAQ 6.5, Field point explorer version 1.6, 

  • How to view Slideshows/Movies created in my Mac-Mini´s iPhoto, on iPad 3

    Slideshows I have in iPhoto on my mac-mini, do not show up in the iPhoto on my iPad 3 (Just Photos, Events & Albums). How do I get the slideshows (Saved with music in Mac-iPhoto), to show in my iPad´s iPhoto? Do I need another app for this? By the wa

  • Ever since snow leopard my external drive keeps disconnecting

    i love airport base station extreme- it worked well for years. i get snow leopard (which is also great), but- now my external keeps disconnecting. i have it partitioned for time machine as well. but now it keeps disconnecting after five or six minute