Customer wise sales register-ALL

hi experts,
i want a report to show 'item' wise, 'service' wise n both item n service combine whn user select 'I' , 'S' or null
and date range thn it shud pic up data from below query
Select t.cardcode, cardname, sum(Quantity) as Quantity, sum(Value) as Value, sum(Tax) as Tax,
sum(Total) as Total, sum(materialvalue) as 'Material Value',sum(CM) as CM, (sum(CM)/SUM(VALUE)*100) as 'CM%' from
(SELECT (T0.CardCode) as cardcode,t0.cardname as cardname, sum(T1.Quantity) as Quantity,
sum(T1.[LineTotal]) as Value, sum(T1.[VatSum]) as Tax, sum( T1.[LineTotal] + T1.[VatSum]) as Total,
isnull(sum(T1.Quantity * t2.u_cmmc),'00')as materialvalue ,
isnull ((sum( T1.[LineTotal] + T1.[VatSum]) - sum(T1.Quantity * t2.u_cmmc)- sum(T1.[VatSum])) ,
sum(T1.[LineTotal])) as CM ,
ISNULL((((sum( T1.[LineTotal] + T1.[VatSum]) - sum(T1.Quantity * t2.u_cmmc)- sum(T1.[VatSum])) )/(sum(T1.[LineTotal]))*100),'100') as cm_perc
FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry  left outer join oitm t2
on t1.itemcode = t2.itemcode
*where T0.[DocType] = [%0] OR* t0.docdate >= [%1] and t0.docdate <= [%2]
group by T0.CardName,T0.CardCode
union
SELECT (T0.[CardCode]) as cardcode, T0.[CardName], -sum(T1.[Quantity]) as Quantity,
-sum(T1.[LineTotal]) as Value, -sum(T1.[VatSum]) as Tax, -sum( T1.[LineTotal] + T1.[VatSum]) as Total, isnull(-sum(T1.Quantity * t2.u_cmmc),'00')  as materialvalue,
isnull((-sum( T1.[LineTotal] + T1.[VatSum]) - sum(T1.Quantity * t2.u_cmmc)- sum(T1.[VatSum])) ,
-sum(T1.[LineTotal])) as CM ,
ISNULL((((sum( T1.[LineTotal] + T1.[VatSum]) - sum(T1.Quantity * t2.u_cmmc)- sum(T1.[VatSum]))) / -(-sum(T1.[LineTotal]))*100),'100') as cm_perc
FROM ORIN T0  INNER JOIN RIN1 T1 ON T0.DocEntry = T1.DocEntry left outer join oitm t2
on t1.itemcode = t2.itemcode
*where T0.[DocType] = [%0] OR* t0.docdate >= [%1] and t0.docdate <= [%2]
group by T0.CardName,T0.CardCode) as t
group by  t.cardname,t.cardcode
it get fails whn i giv where T0.[DocType] = [%0] AND t0.docdate >= [%1] and t0.docdate <= [%2]
for AND it takes 'I' and 'S' but null codition fails
& for OR  null codition wrkng rest are not
ketan.....

Hi!
Try this
Select t.cardcode, cardname, sum(Quantity) as Quantity, sum(Value) as Value, sum(Tax) as Tax,
sum(Total) as Total, sum(materialvalue) as 'Material Value',sum(CM) as CM, (sum(CM)/SUM(VALUE)*100) as 'CM%' from
(SELECT (T0.CardCode) as cardcode,t0.cardname as cardname, sum(T1.Quantity) as Quantity,
sum(T1.[LineTotal]) as Value, sum(T1.[VatSum]) as Tax, sum( T1.[LineTotal] + T1.[VatSum]) as Total,
isnull(sum(T1.Quantity * t2.u_cmmc),'00')as materialvalue ,
isnull ((sum( T1.[LineTotal] + T1.[VatSum]) - sum(T1.Quantity * t2.u_cmmc)- sum(T1.[VatSum])) ,
sum(T1.[LineTotal])) as CM ,
ISNULL((((sum( T1.[LineTotal] + T1.[VatSum]) - sum(T1.Quantity * t2.u_cmmc)- sum(T1.[VatSum])) )/(sum(T1.[LineTotal]))*100),'100') as cm_perc
FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry  left outer join oitm t2
on t1.itemcode = t2.itemcode
Where (T0.[DocType] = [%0] OR [%0] = '' ) and t0.docdate >= [%1] and t0.docdate <= [%2]
group by T0.CardName,T0.CardCode
union
SELECT (T0.[CardCode]) as cardcode, T0.[CardName], -sum(T1.[Quantity]) as Quantity,
-sum(T1.[LineTotal]) as Value, -sum(T1.[VatSum]) as Tax, -sum( T1.[LineTotal] + T1.[VatSum]) as Total, isnull(-sum(T1.Quantity * t2.u_cmmc),'00')  as materialvalue,
isnull((-sum( T1.[LineTotal] + T1.[VatSum]) - sum(T1.Quantity * t2.u_cmmc)- sum(T1.[VatSum])) ,
-sum(T1.[LineTotal])) as CM ,
ISNULL((((sum( T1.[LineTotal] + T1.[VatSum]) - sum(T1.Quantity * t2.u_cmmc)- sum(T1.[VatSum]))) / -(-sum(T1.[LineTotal]))*100),'100') as cm_perc
FROM ORIN T0  INNER JOIN RIN1 T1 ON T0.DocEntry = T1.DocEntry left outer join oitm t2
on t1.itemcode = t2.itemcode
where (T0.[DocType] = [%0] OR [%0] = '' ) and t0.docdate >= [%1] and t0.docdate <= [%2]
group by T0.CardName,T0.CardCode) as t
group by  t.cardname,t.cardcode

Similar Messages

  • Subtotal of quantity in cust wise sales register

    Hi Experts....................
    please ref to the following query which provides customer wise sales register report, now what we require is sum total of quantity of a particular item code for particular customer
    e.g:- if on 01/04/09 customer A purchase 100 items of item code i1
    and on 06/04/09 customer A purchase 275 items of item code i1
    in the required report should display 100 + 275 = 375 for item code i1 & for same customer.......................................................................................................................................
    SELECT distinct
    1 as sr,'Invoice' [Document Type],
    t0.docentry,
    T0.[CardCode] as 'BP Number',
    T0.[CardName] as 'BP name',
    t0.numatcard as 'Vendor reference No.',
    t0.u_loc as 'Location name' ,
    t4.state,
    T0.[DocNum] as 'Document Number',
    --T0.[DocType],
    t0.docdate,
    ISNULL(T1.ItemCode,'Service Item') AS 'Item Code',
    T1.[Dscription],
    T1.[Quantity]  AS 'Quantity',
    t3.name as 'MAG',
    t1.linetotal as 'Net Amount',
    t1.vatsum as 'Tax Amount',
    (t1.linetotal + t1.vatsum) as 'Invoice Value'
    FROM [dbo].[OINV]  T0
    INNER JOIN [dbo].[INV1]  T1 ON T0.DocEntry = T1.DocEntry left outer join owhs t4 on t1.whscode = t4.whscode
    LEFT JOIN [dbo].[OITM] T2 ON T1.ItemCode = T2.ItemCode
    LEFT JOIN [dbo].[@ITMG]  T3 ON T2.U_itmg = T3.Code
    WHERE
    T0.[DocType] = 'I'
    and t0.cardcode between [%3] and [%4] and t0.docdate >= [%1]and t0.docdate <=[%2]
    union
    SELECT distinct 2,'Credit Memo' [Document Type],
    t0.docentry,
    T0.[CardCode] as 'BP Number',
    T0.[CardName] as 'BP Name',
    t0.numatcard as 'Vendor reference No.',
    t0.u_loc as 'Location name' ,
    t4.state,
    T0.[DocNum] as 'Document Number',
    --T0.[DocType],
    t0.docdate,
    ISNULL(T1.ItemCode,'Service Item') AS 'Item Code',
    T1.[Dscription],
    -T1.[Quantity] AS 'Quantity',
    t3.name as 'MAG',
    -t1.linetotal as 'Net Amount',
    -t1.vatsum as 'Tax Amount',
    -(t1.linetotal + t1.vatsum) as 'Invoice Value'
    FROM [dbo].[ORIN]  T0
    INNER JOIN [dbo].[RIN1]  T1 ON T0.DocEntry = T1.DocEntry left outer join owhs t4 on t1.whscode = t4.whscode
    LEFT JOIN [dbo].[OITM] T2 ON T1.ItemCode = T2.ItemCode
    LEFT JOIN [dbo].[@ITMG]  T3 ON T2.U_itmg = T3.Code
    WHERE
    T0.[DocType] = 'I'
    and t0.cardcode between [%3] and [%4] and t0.docdate >= [%1]and t0.docdate <=[%2]
    union
    SELECT distinct
    1 as sr,'Invoice' [Document Type],
    t0.docentry,
    T0.[CardCode] as 'BP Number',
    T0.[CardName] as 'BP name',
    t0.numatcard as 'Vendor reference No.',
    t0.u_loc as 'Location name' ,
    t4.state,
    T0.[DocNum] as 'Document Number',
    --T0.[DocType],
    t0.docdate,
    ISNULL(T1.ItemCode,'Service Item') AS 'Item Code',
    T1.[Dscription],
    T1.[Quantity] AS 'Quantity',
    t3.name as 'MAG',
    t1.linetotal as 'Net Amount',
    t1.vatsum as 'Tax Amount',
    (t1.linetotal + t1.vatsum) as 'Invoice Value'
    FROM [dbo].[OINV]  T0
    INNER JOIN [dbo].[INV1]  T1 ON T0.DocEntry = T1.DocEntry left outer join owhs t4 on t1.whscode = t4.whscode
    LEFT JOIN [dbo].[OITM] T2 ON T1.ItemCode = T2.ItemCode
    LEFT JOIN [dbo].[@ITMG]  T3 ON T2.U_itmg = T3.Code
    WHERE
    T0.[DocType] = 'S'
    and t0.cardcode between [%3] and [%4] and t0.docdate >= [%1]and t0.docdate <=[%2]
    union
    SELECT distinct
    2,'Credit Memo' [Document Type],
    t0.docentry,
    T0.[CardCode] as 'BP Number',
    T0.[CardName] as 'BP Name',
    t0.numatcard as 'Vendor reference No.',
    t0.u_loc as 'Location name' ,
    t4.state,
    T0.[DocNum] as 'Document Number',
    --T0.[DocType],
    t0.docdate,
    ISNULL(T1.ItemCode,'Service Item') AS 'Item Code',
    T1.[Dscription],
    -T1.[Quantity] AS 'Quantity',
    t3.name as 'MAG',
    -t1.linetotal as 'Net Amount',
    -t1.vatsum as 'Tax Amount',
    -(t1.linetotal + t1.vatsum) as 'Invoice Value'
    FROM [dbo].[ORIN]  T0
    INNER JOIN [dbo].[RIN1]  T1 ON T0.DocEntry = T1.DocEntry left outer join owhs t4 on t1.whscode = t4.whscode
    LEFT JOIN [dbo].[OITM] T2 ON T1.ItemCode = T2.ItemCode
    LEFT JOIN [dbo].[@ITMG]  T3 ON T2.U_itmg = T3.Code
    WHERE
    T0.[DocType] = 'S'
    and t0.cardcode
    between [%3] and [%4] and t0.docdate >= [%1]and t0.docdate <=[%2]
    ketan....
    Edited by: ketan.k.pande on Dec 22, 2009 7:53 AM

    Hi Ketan,
    If you want to get those sub totals, you have to create a new query to omit all details.  You could only leave few fields like:
    T0.[CardCode] as 'BP Number',
    T0.[CardName] as 'BP name',
    ISNULL(T1.ItemCode,'Service Item') AS 'Item Code',
    MAX(T1.[Dscription] ),
    SUM(T1.[Quantity])
    Group By T0.[CardCode], T0.[CardName],T1.ItemCode
    Thanks,
    Gordon

  • 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

  • Customer wise sales billing document showing due amount

    Hi Experts,
    I need a report with following columns:
    1. Customer No
    2. Original Sales Billing Document No ( Final bill)
    3. Original Sales Bill posting Date
    4. Current outstanding/due amount
    5. Original Payment Document No (to get the full or partial settlement)
    I need the table relation with FI with corresponding Bill No ( SD & FI ) ref.
    I'm waiting for your valued response.
    Mahbub
    Moderator message - please do not post your requirements and expect the forum to do your work.
    Edited by: Rob Burbank on May 2, 2009 1:19 PM

    << Cut and paste from http://www.sap-img.com/sap-sd/link-between-sap-sd-mm-and-fi.htm removed >>
    Edited by: Rob Burbank on May 2, 2009 1:18 PM

  • Customer wise sales registr

    HI
    Thanx yar i want records from both a/r invoice and a/r credit memo table both item based and service based depending upon usre selection
    but because 2 queries join by union it show 2 rows means for the same customer if a/r invoice and a/r credit memo  is created thn it show two rows  if qty is diff so it get added up
    so how can i get a single row
    can i hav ur gml id so that i can snd u screen shot m id ketan.kpande on gml
    ketan...

    hi
    i tried union and union all but it show two diff rows i want same custcode and custname in only one row
    whn use union all thn cm% give wrong values which i compare with customer standard report
    SELECT MAX (T0.[CardCode]), T0.[CardName],
    sum(T1.[Quantity]) as Quantity,
    sum(T1.[LineTotal]) as Value,
    sum(T1.[VatSum]) as Tax, sum( T1.[LineTotal] + T1.[VatSum]) as Total,
    isnull(sum(T1.Quantity * t2.u_cmmc),'00')as 'Material Value' ,
    isnull (sum( T1.[LineTotal] + T1.[VatSum]) - sum(T1.Quantity * t2.u_cmmc) ,sum(T1.[LineTotal])) as CM ,
    isnull(((sum( T1.[LineTotal] + T1.[VatSum]) - sum(T1.Quantity * t2.u_cmmc) )/(sum(T1.[LineTotal]))*100),'100') as 'CM%'
    FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry left outer join oitm t2 on t1.itemcode = t2.itemcode
    --where T0.[DocType] = [%0] or t0.docdate >= [%1] and t0.docdate <= [%2]
    group by T0.CardCode,T0.CardName
    UNION
    SELECT MAX (T0.[CardCode]), T0.[CardName],
    -sum(T1.[Quantity]) as Quantity,
    -sum(T1.[LineTotal]) as Value,
    -sum(T1.[VatSum]) as Tax,
    -sum( T1.[LineTotal] + T1.[VatSum]) as Total,
    isnull(-sum(T1.Quantity * t2.u_cmmc),'00')  as 'Material Value' ,
    isnull(-sum( T1.[LineTotal] + T1.[VatSum]) - sum(T1.Quantity * t2.u_cmmc) ,-sum(T1.[LineTotal]))as CM ,
    isnull(((sum( T1.[LineTotal] + T1.[VatSum]) - sum(T1.Quantity * t2.u_cmmc)) / (sum(T1.[LineTotal]))*100),'100') as 'CM%'
    FROM ORIN T0  INNER JOIN RIN1 T1 ON T0.DocEntry = T1.DocEntry left outer join oitm t2 on t1.itemcode = t2.itemcode
    --where T0.[DocType] = [%0] or t0.docdate >= [%1] and t0.docdate <= [%2]
    group by T0.CardCode,T0.CardName
    ketan

  • Sales Register Query

    hi All,
    I have this query which is working fine as desired. I want to include selection criteria of "FROM" to "To" date in this query.
    SELECT DISTINCT T0.Docentry, T0.[U_ManualInvoiceNum] as 'Bill No.', CONVERT(VARCHAR(10), T0.[DOCDATE], 3) AS DOCDATE, T0.[CardName] as 'Customer Name' ,  T1.[Dscription] as 'Item Description',  T1.[Quantity], T1.[Price] as 'Price', T1.[TaxCode],
    ( T1.LineTotal ) as 'Basic' ,
    (Select distinct isnull(Sum(INV4.taxsum),0) from INV4 where INV4.statype=-90 and INV4.docentry=T0.Docentry and INV4.linenum = T1.Linenum )BED,
    (Select distinct isnull(Sum(INV4.taxsum),0) from INV4 where INV4.statype=-60 and INV4.docentry=T0.Docentry and INV4.linenum = T1.Linenum)Cess,
    (Select distinct isnull(Sum(INV4.taxsum),0) from INV4 where INV4.statype=9 and INV4.docentry=T0.Docentry and INV4.linenum = T1.linenum)HeCess,
    (Select distinct isnull(Sum(INV4.taxsum),0) from INV4 where INV4.statype=1 and INV4.docentry=T0.Docentry and INV4.linenum = T1.linenum)VAT,
    (Select distinct isnull(Sum(INV4.taxsum),0) from INV4 where INV4.statype=8 and INV4.docentry=T0.Docentry and INV4.linenum = T1.linenum)CST,
    T0.[Comments] FROM OINV T0 INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry --INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode inner join INV4 T3 on T1.Docentry =T3.docentry and T1.LineNum=T3.LineNum inner join CRD7 T4 on T0.cardcode = T4.Cardcode
    For browse
    I tried using the below mentioned query to get the date selection but it still shows all the invoices created in the system and not between specified dates.
    DECLARE @FromDate DateTime
    DECLARE @ToDate DateTime
    /* SELECT T0.DocDate FROM OINV T0 where T0.DocDate >=[%0] */
    SET @FromDate = [%0]
    /* SELECT T0.DocDate FROM OINV T0 where T0.DocDate <=[%0] */
    SET @ToDate = [%1]
    Thanks,
    Joseph

    Hi,
    I have these two reports for Sale register which may be useful to many so pasting it here,
    BILL WISE SALE REGISTER
    DECLARE @startDate DATETIME, @endDate DATETIME, @dummy INTEGER
    SELECT TOP 1 @dummy = DocNum  from OINV T0 where T0.DocDate >=[%1] and T0.DocDate <= [%2]
    Select @startDate='[%1]' ,@endDate = '[%2]'
    SELECT DISTINCT T0.Docentry, T0.[DocNum], T0.[DOCDATE] as 'Bill Date', T0.[CardName] as 'Customer Name' ,
    (Select distinct isnull(Sum(INV4.taxsum),0) from INV4 where INV4.statype=-90 and INV4.docentry=T0.Docentry  )BED,
    (Select distinct isnull(Sum(INV4.taxsum),0) from INV4 where INV4.statype=-60 and INV4.docentry=T0.Docentry )Cess,
    (Select distinct isnull(Sum(INV4.taxsum),0) from INV4 where INV4.statype=9 and INV4.docentry=T0.Docentry )HeCess,
    (Select distinct isnull(Sum(INV4.taxsum),0) from INV4 where INV4.statype=1 and INV4.docentry=T0.Docentry )VAT,
    (Select distinct isnull(Sum(INV4.taxsum),0) from INV4 where INV4.statype=8 and INV4.docentry=T0.Docentry )CST,
    T0.[Comments] FROM OINV T0 INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry and T1.Targettype <> 14
    WHERE T0.DocDate >=@startDate and T0.DocDate <= @endDate
    For Browse
    Item Wise Sale Register
    DECLARE @startDate DATETIME, @endDate DATETIME, @dummy INTEGER
    SELECT TOP 1 @dummy = DocNum  from OINV T0 where T0.DocDate >=[%1] and T0.DocDate <= [%2]
    Select @startDate='[%1]' ,@endDate = '[%2]'
    SELECT DISTINCT T0.Docentry, T0.[DocNum] as 'Bill No.', CONVERT(VARCHAR(10), T0.[DOCDATE], 3) AS 'Bill date', T0.[CardName] as 'Customer Name' ,  T1.[Dscription] as 'Item Description',  T1.[Quantity], T1.[Price] as 'Price', T1.[TaxCode],
    ( T1.LineTotal ) as 'Basic' ,
    (Select distinct isnull(Sum(INV4.taxsum),0) from INV4 where INV4.statype=-90 and INV4.docentry=T0.Docentry and INV4.linenum = T1.Linenum )BED,
    (Select distinct isnull(Sum(INV4.taxsum),0) from INV4 where INV4.statype=-60 and INV4.docentry=T0.Docentry and INV4.linenum = T1.Linenum)Cess,
    (Select distinct isnull(Sum(INV4.taxsum),0) from INV4 where INV4.statype=9 and INV4.docentry=T0.Docentry and INV4.linenum = T1.linenum)HeCess,
    (Select distinct isnull(Sum(INV4.taxsum),0) from INV4 where INV4.statype=1 and INV4.docentry=T0.Docentry and INV4.linenum = T1.linenum)VAT,
    (Select distinct isnull(Sum(INV4.taxsum),0) from INV4 where INV4.statype=8 and INV4.docentry=T0.Docentry and INV4.linenum = T1.linenum)CST,
    T0.[Comments] FROM OINV T0 INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry
    WHERE T0.DocDate >=@startDate and T0.DocDate <= @endDate and T1.TargetType <> 14
    For Browse
    Thanks,
    Joseph

  • 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

  • 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

  • Day wise sales Vs Production report - Urgent

    Dear Guru's
    My client require a new report, Material A is producing in plant 1000 and they want to know day wise production Vs day wise sales, week wise production, week wise sales and month wise prodution and month wise sales.. all these in one format so that they take necessary steps.. please provide me some inputs which i need to give to ABAPers, and is there any standard report for these...
    Thanks
    Ramki

    I am sorry Ram Ki, these are client restricted documents and i am not haing authorization to email you.
    Sorry again...I think this is not big job just sit with abaper and search the fields requires for your report from the said tables. You have to design the format in excel and explain the same to abaper... if your abaper is good then he will do this without any problem.
    Regards
    TAJUDDIN

  • Customer  month wise sales

    Dear All
    Any Standared Report Available Customer  month wise sales available?
    Thanks and Regards
    Suresh

    Hi,
    To determine which info blocks should be displayed in the sales summary and how they should be combined in views, see the IMG under Sales and Distribution - Sales Support (CAS) - Sales Summary.
    If you want the sales summary to appear differently to specific users, you can assign views to users in this Customizing step.
    If you do not do this, the system displays the standard reporting view.
    regards,
    Siddharth.

  • Customer and month wise sales

    Dear All
        Which Table Stored Customer and month wise sales values?
    Thanks and Regards
    Suresh

    Hi
    Table VBRK Will help you.
    Assign points if you find the solution with this
    Regards

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

  • BAPI for customer group wise sales

    Hello Experts,
    I m developing one report,in which i want customer group wise sales , collection & outstanding
    as on date.
    Is there any BAPI which helps.
    Please suggest.
    Ravi

    hi Ravi,
    try SD_CUSTOMER_MAINTAIN_ALL
    hope this helps
    regards
    Aakash Banga

  • Customer Group wise sales

    hi
    is there any standard report to check customer  group wise sales.
    Rajendra

    Hi Rajedra Prasad,
    Please find below the Some of the Standard Reports in SD:
    Sales summary - VC/2
    Display Customer Hierarchy - VDH2
    Display Condition record report - V/I6
    Pricing Report - V/LD
    Create Net Price List - V_NL
    List customer material info - VD59
    List of sales order - VA05
    List of Billing documents - VF05
    Inquiries list - VA15
    Quotation List - VA25
    Incomplete Sales orders - V.02
    Backorders - V.15
    Outbound Delivery Monitor - VL06o
    Incomplete delivery - V_UC
    Customer Returns-Analysis - MC+A
    Customer Analysis- Sales - MC+E
    Customer Analysis- Cr. Memo - MC+I
    Deliveries-Due list - VL04
    Billing due list - VF04
    Incomplete Billing documents - MCV9
    Customer Analysis-Basic List - MCTA
    Material Analysis(SIS) - MCTC
    Sales org analysis - MCTE
    Sales org analysis-Invoiced sales - MC+2
    Material Analysis-Incoming orders - MC(E
    General- List of Outbound deliveries - VL06f
    Material Returns-Analysis - MC+M
    Material Analysis- Invoiced Sales - MC+Q
    Variant configuration Analysis - MC(B
    Sales org analysis-Incoming orders - MC(I
    Sales org analysis-Returns - MC+Y
    Sales office Analysis- Invoiced Sales - MC-E
    Sales office Analysis- Returns - MC-A
    Shipping point Analysis - MC(U
    Shipping point Analysis-Returns - MC-O
    Blocked orders - V.14
    Order Within time period - SD01
    Duplicate Sales orders in period - SDD1
    Display Delivery Changes - VL22
    Shipment List Planning - VT11
    List of Incomplete Shipments -Try VT04/VT11/VT32
    Delivery without Shipments -Use VL06O
    List of Rebate Agreements   - VB(8
    If not, if it is a small report using ABAP Query you can develop New Report as per your requirment or Using SIS you can Develop you own report.
    Please Reward If Really Helpful,
    Thanks and Regards,
    Sateesh.Kandula

  • Authorization define to customized sales register transaction code

    Hi All,
    My ABAPer has been created the customize report ZSD_DUMP(Sales Register Data). This report is for all 20 Depot users. In this report, all the Sales Register data of All Depot has been showing in ZSD_DUMP transaction. My question is how can i restrict particular user depot ,he read only own depot record not of other depot. Which authorization can i give to user depot? Your answer is appreciated.
    Thanks & Regards,
    Satish

    Hi,
    My abaper had been also used the standard object 'M_EINF_WRK'. The code is
    SELECT  single werks
              FROM t001w
              INTO v_werks
              WHERE werks IN s_werks.
    AUTHORITY-CHECK OBJECT 'M_EINF_WRK'
    ID 'ACTVT' DUMMY
    ID 'WERKS' FIELD 'V_WERKS'. (also used S_WERKS)
    IF sy-subrc NE 0.
    MESSAGE E000 WITH 'YOU ARE NOT AUTHORISED USER'.
    ENDIF.
    Satish

Maybe you are looking for

  • EXCHANGE RATE ISSUE WHILE EBS

    Hi, - Company Code Currency and GL currency is INR - for EBS (auto BRS) we created 3 GL account for each bank a/c (Main account, Incoming A/c and Outgoing A/c).  all maintained in INR. - posted an entry in above outfoing GL account  - 1000 USD @ 49.6

  • Converting Nikon NEF files to DNG without adding Chromatic Aberrations?

    Used Adobe converter 7.4.0.137 and got Cyan and Magenta abberations on all high contrast edges. NEF files were from a Nikon D7100 and look great using ViewNX 2 software. Is there a better converter?

  • TOC disappears after allow blocked content

    I have a Robohelp 9 project (single sourced through FrameMaker) I can compile the help and run. When I view it, I see the full help along with the "Allow blocked content" message. When I click Allow Blocked Content, my help appears but now the TOC is

  • Photoshop elements 11 install trouble

    i keep getting a troublle installing shared technologies error messgae when i try to install pse11

  • Why can't iTunes Party Shuffle podcasts?

    This is really annoying because I'd like to mix news up-dates in with my music in Party Shuffle, but iTunes doesn't allow this. Does anyone have a work around? Thanks.