Fastest way to calculate total sales per material?

I'm creating a report where I need the total sum of sales per material. 
Is the fastest & most efficient / only way to do this by querying VBAP?  We're talking about millions of lines.
I guess I'm hoping that there is a FM already in place or that some sort of summary table exists.
Any ideas?

There is no FM. In the program you should be able to use table VAPMA, which has the same data as VBAP but the primary key is MATNR.
Depending on the requirements, it might be beneficial to create an info structure (LIS) to track summarized sales. Your SD consultant should be able to do that, there is no programming required.
Hope this helps.

Similar Messages

  • Sales per material code

    Hi all
    Does anybody knows how to take sales report from SAP per material code.
    Please advice me with Tcode if it's possible.
    Thanks a lot in advance!

    Hi
    Try trans. MCTC it should solve your problem . You can provide the material number and get the required information .
    You can also get the information Sales Area wise and within desired time frame.
    Thanks
    A
    Edited by: A on Mar 6, 2009 11:57 PM

  • Fastest way to grant cube permissions per AMO (250 roles, 30 cubes)?

    Hi there,
    can anybody tell me the fastest way to grant cube permissions in a scenario, where for example 250 roles have to be granted for 30 cubes?
    Now, I do it with AMO, iterating throgh the roles, setting cube permissions.
    My method for granting access looks like this:
    public void GrantCubePermission(Role pRole, Database pDatabase, string pCubeName, ReadAccess pReadAccess, WriteAccess pWriteAccess, ReadSourceDataAccess pReadSourceDataAccess, bool pProcess, ReadDefinitionAccess pReadDefinitionAccess)
    try
    if (pRole == null) return;
    Cube cube = pDatabase.Cubes.FindByName(pCubeName);
    if (cube == null) return;
    CubePermission cubePermission = cube.CubePermissions.FindByRole(pRole.ID);
    if (cubePermission == null)
    cubePermission = cube.CubePermissions.Add(pRole.ID);
    cubePermission.Read = pReadAccess;
    cubePermission.Write = pWriteAccess;
    cubePermission.ReadSourceData = pReadSourceDataAccess;
    cubePermission.Process = pProcess;
    cubePermission.ReadDefinition = pReadDefinitionAccess;
    cubePermission.Update(UpdateOptions.AlterDependents, UpdateMode.UpdateOrCreate);
    catch (Exception ex)
    Msg(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
    Doing it this way, the operation tooks about 4 seconds per role (the given method is executed 30 times per role, the number of the cubes to be granted for).
    Finally, for 250 roles, the operation tooks about 16 minutes.
    Is there a way to do it faster?

    Did you consider XMLA ?
    <
    Createxmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
        <
    ParentObject>
            <
    DatabaseID>DAtabasename</DatabaseID>
        </
    ParentObject>
        <
    ObjectDefinition>
            <
    Rolexmlns:xsd="http://www.w3.org/2001/XMLSchema"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:ddl2="http://schemas.microsoft.com/analysisservices/2003/engine/2"xmlns:ddl2_2="http://schemas.microsoft.com/analysisservices/2003/engine/2/2"xmlns:ddl100_100="http://schemas.microsoft.com/analysisservices/2008/engine/100/100"xmlns:ddl200="http://schemas.microsoft.com/analysisservices/2010/engine/200"xmlns:ddl200_200="http://schemas.microsoft.com/analysisservices/2010/engine/200/200"xmlns:ddl300="http://schemas.microsoft.com/analysisservices/2011/engine/300"xmlns:ddl300_300="http://schemas.microsoft.com/analysisservices/2011/engine/300/300"xmlns:ddl400="http://schemas.microsoft.com/analysisservices/2012/engine/400"xmlns:ddl400_400="http://schemas.microsoft.com/analysisservices/2012/engine/400/400">
                <
    ID>Role</ID>
                <
    Name>ReadRole</Name>
                <
    Members>
                    <
    Member>
                        <
    Name>domain\user</Name>
                    </
    Member>
                    <
    Member>
                </
    Members>
            </
    Role>
        </
    ObjectDefinition>
    </
    Create>

  • Fastest way to check total number of rows from View ?

    Hello Everyone,
    Good Morning !!!!
    I am trying to know the exact number of rows from a view.
    I have total 262 columns in a view name vw_sample. First column name is col_1 and I do not have permission to view that. but I do have permission to view all other 261 columns. I want to know fastest way to know exact number of rows in this view vw_sample.
    How can i know that ?
    I tried below things.
    1) Tried using COUNT(*) & COUNT(1) but I don't have permission to first column col_1 so that didn't worked.
    2) I do not have permission to view DMV "sys.dm_db_partition_stats"
    3) I tried to execute below code.
    select col_2, col_3,...col_262
    into #TempTable
    from vw_sample
    and it gave me below error
    Msg 1105, Level 17, State 2, Line 1
    Could not allocate space for object '<temporary system object: 9830433781072176840>'
    in database 'tempdb' because the 'PRIMARY' filegroup is full. Create disk space by deleting unneeded files, dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.
    4) Accidentaly I run below code
    select col_2, col_3,...col_262
    from vw_sample
    It gave me 11 million rows in 40 minutes. As we know this method is not good to test just number of rows from a view.
    So what would be my option here ?
    Thanks in advance.
    Thanks
    Fredyy

    Fredy, did you try with other column names instead of col1?
    SELECT COUNT(col2) FROM View
    What difference does that make, than using your column 1.
    Please mark as answer, if this has helped you solve the issue.
    Good Luck :) .. visit www.sqlsaga.com for more t-sql code snippets and BI related how to articles.
    IMO, sqlsaga's answer is the way to go, but you may need to make a minor change.  When you do COUNT(<some expression>), SQL counts the number of rows where <some expression> is not NULL.  So if col2 can be NULL you need to make a change
    so you know what you are counting can't be NULL.  If there is some other column in the view that can't be NULL, just count it.  Otherwise just use the ISNULL function to convert NULL's to a value.  For example, do
    Select COUNT(IsNull(col2, 0)) From vw_sample
    Note the above assumes that col2 is a type that contains a number (int, numeric, float, etc).  If col2 is of a different type, then just replace the 0 in the above with any valid value of the same type as col2 (so '' for varchar, '19000101' for datetime,
    etc).
    Tom

  • How to total sales per merchandise category wise

    Dear all,
    We are into Retail sector, and using SAP IS-Retail for our business process, we want to see sales reports based Merchandise Category level.
    is there any standard report which shows list of sales order per merchandise category wise.
    if not can we develop a Zreport using Query or ALV report.
    then which Tables need to be used.
    Please help me to solve this issue, Your help will be highly appreciated.
    Thank you,
    Raghu ram.

    Hi,
    if you want more flexible, you could try this modified Istvan's query:
    SELECT top 10 T1.ItemCode, T2.ItemName, T3.ItmsGrpNam,   SUM(T1.Quantity) as "Total Qty Sold",
      SUM(T1.TotalSumSy) as "Total Amount" ,
      (select sum (r.Quantity) from ODLN h
         inner join DLN1 r on h.DocEntry=r.DocEntry  
         where h.DocDate>='[%4]' and h.DocDate<='[%5]'
             and r.ItemCode=T1.ItemCode) '2007 Sold',
      (select sum (r.TotalSumSy) from ODLN h
         inner join DLN1 r on h.DocEntry=r.DocEntry  
         where h.DocDate>='[%6]' and h.DocDate<='[%7]'
             and r.ItemCode=T1.ItemCode) '2007 Amount'
    FROM ODLN T0 INNER JOIN DLN1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode INNER JOIN OITB T3 ON T2.ItmsGrpCod = T3.ItmsGrpCod
    WHERE T0.DocDate >='[%0]' AND T0.DocDate <='[%1]' AND T3.ItmsGrpNam between '[%2]'  and '[%3]'
    GROUP BY T1.ItemCode, T2.ItemName, T3.ItmsGrpNam
    ORDER by SUM(T1.Quantity) DESC
    Rgds,

  • Sales per material

    Hi Gurus,
    In using t-code MCHP, does the column Sales Qty indicate an actual sales posting?
    We have some material numbers without sales to a particular sitecode but if you display the material in MCHP, it shows that there is a sales for that site even in reality we have zero sales.
    Thanks,
    Ellicec

    Hi Bijay,
    Thanks for your reply.  I will check the t-codes that you have suggested.
    However, may I know for what transactions do we use MCHP?
    Thank you.

  • What is the fastest way to calculate the rms voltage from a large voltage measurement file?

    I have collected voltage measurements for a 60Hz waveform and would like to calculate the RMS voltage in order to determine voltage drift. The data was collected at 100KHz and the TDMS file is 4 hours long (a huge amount of data!). I have run the RMS tool in the basic mathematics block with small sets of data successfully, but the large set seems to take forever to run (48 hours so far and it hasn't finished yet).
    1. Is there a faster way to analyze this much data?
    2. How does the "one sided interval width" affect my results and analysis time?
    3. Can I calculate the RMS voltage with FFT?
    4. Is there a way to redce the size of my data file to a manageable size file so the RMS function will run quickly, yet maintain accuracy?

    Hi Dave,
    Just a thought, If you have a 60 Hz signal, then the 100 Khz is way overkill for the sampling rate,   If you would resample the waveform at  say 20 X 60 hz= 1200 Hz you should have the same details  that would be in the 100 Khz sample signal.  That should take substantially less time to do a RMS calculation on the resampled channel. The two commands are listed below. 
    ChnResampleChnBased
    ChnResampleFreqBased
    Paul

  • Best Way to calculate totals from query

    Could someone point me in the right direction to add up my
    data and distinctly show it in my query?
    I have a table with the following fields:
    id, team_id, compname, teamname, totallost
    I want to add up the "totallost" row where the "team_id" and
    "compname" fields are the same...then show the compname with the
    sum of the totallost once in my table and determine who is
    winning.

    Thank you for the great help. This code works well, but is
    there a way to display the highest totallost and differentiate
    between competition names? My example is for one compname, but the
    table will have multiple compname's and I want to build a table
    showing only the highest totallost for each compname.
    You guys have been a great help. I learned something new
    today already.

  • Storing and calculating sales per item

    The case: We have a item, on that item we have a fee. If the item has sold more than 1000 copies, the fee will drop. Therefor i need to have a place that calculates/stores total sales per item. This can then be used to set the fee when i run my stored procedure
    for sales etc. 
    Database explained shortly: 
    The sales database looks like this: 
    ItemID, SalesDate, Quantity, Name.
    Example: 
    1399, 2014-01-01, 2, Fompa.
    1081, 2014-01-01, 13, Asddd. 
    1399, 2014-01-03, 1, Fompa. 
    Etc. 
    The item database looks like this: 
    ItemID, Name, Author, etc
    Now my boss asked me if i maybe should add total sales to the item database, but how is that possible? 
    I have also tried to gather all items and show the total sales, but something goes wrong, the itemID are not grouping together..
    here is the query: select ItemID, QUANTITY from BOOK_SALES group by ItemID, QUANTITY order by MAX(quantity) DESC
    If i get this query right, is it possible to store the query within a database table? 

    Hey, thanks for a fast answer. 
    I modified your query a little, 
    select
    itemid, sum(quantity) from book_sales group by
    itemid order by MAX(quantity) DESC
    but still, all of the itemIDs are not being grouped together. 
    Results show something like this: 
    1399, 981
    1081, 344
    1399, 199
    etc..

  • How to Apply YTM and MTD filter to the Query Calculating "Total Sales" Amt

    Hi,
    I got the requirement to calculate "Total Sales" amount in following format,
    1. Calculate Total Sales YTM per Country
    2. Calculate Total Sales MTD per Country
    I am done with Queries to get Country wise Total Sales amount but stuck at the point, how to apply YTM (Year to Month) and MTD (Month to Date) filter. Can anyone have idea about how to apply YTM and MTD filter to query??
    Regards,
    Priyanka

    Hi,
    I got the requirement to calculate "Total Sales" amount in following format,
    1. Calculate Total Sales YTM per Country
    2. Calculate Total Sales MTD per Country
    I am done with Queries to get Country wise Total Sales amount but stuck at the point, how to apply YTM (Year to Month) and MTD (Month to Date) filter. Can anyone have idea about how to apply YTM and MTD filter to query??
    Regards,
    Priyanka

  • Sale Qty Material grp wise

    DearAll ,
    whr we can find total  sale Qty material grp Wise Per Month ?
    Pl guide with report
    regards

    Hi,
    Using std analysis you may find LIS reports material wise.
    For material grp wise create a std/flexible report as per your requirement.
    [LIS|http://help.sap.com/printdocu/core/Print46c/en/data/pdf/LOLIS/LOLIS.pdf]
    [LIS Components|http://help.sap.com/printdocu/core/print46c/en/data/pdf/LOLIS/LOLIS_KOMPONENTEN%20DES%20LIS.pdf]
    Regards,
    Amit
    Edited by: Amit Iyer on Aug 28, 2009 12:14 AM

  • Regarding Customer Total Sales table

    Hi All SAP Experts
    I like to know which table will provide me total of each customers for year. an Actual sales for per customer. I know table VBAK with filed Net value. My question is that figure is right figure for each customer. I am looking for total sales. Report requirement is total sales it will not show line itemwise. Just total sales per customer.
    Thank you

    Welcome to the forum.  As a new member, I would like to inform you that there are certain rules and regulations applicable to this forum which you can find to your right screen where it has also been indicated that posting basic / repeated query is not allowed. Please search in this forum or Google it with the same text, so that you will find many threads discussed on the same topic.  Take the inputs from there and update still if you are not able to resolve.  Meanwhile, this thread would be locked.
    G. Lakshmipathi

  • How to get Total Sale and Total Revenue?

    Hi,
    I have received requirement to calculate Total Sale and Total Revenue.
    what is actual difference between total sales and Total revenue?
    Is there any report or query in EBS R12 from which we can find total sale and total revenue?
    Thanks,
    Kapil
    Edited by: Kapil Mistry on Aug 2, 2012 12:10 AM
    Edited by: Kapil Mistry on Aug 2, 2012 12:11 AM

    Hi,
    Can I use Receipt details to get total revenue i.e actual income from customer ?
    Please check the following query.
    SELECT code_combination_id,
    ra.applied_customer_trx_id,
    trx_number,
    SUM( NVL( line_applied, 0 )) line_receipt,
    SUM( NVL( tax_applied, 0 )) tax_receipt,
    SUM( NVL( freight_applied, 0 )) freight_receipt,
    SUM( NVL( amount_applied, 0 )) total_receipt
    FROM ar_receivable_applications_all ra,
    ra_customer_trx_all trx,
    ar_cash_receipts_all rcpt
    WHERE
    applied_customer_trx_id = trx.customer_trx_id
    AND ra.cash_receipt_id = rcpt.cash_receipt_id
    AND application_type = 'CASH'
    AND NVL(ra.confirmed_flag, 'Y' ) = 'Y'
    AND trx.complete_flag = 'Y'
    AND trx.org_id = 204
    AND trx.customer_trx_id = 51385
    GROUP BY code_combination_id,ra.applied_customer_trx_id,trx_number
    ORDER BY 3

  • How to get Total Sales and Total Revenue?

    Hi,
    I have received requirement to calculate Total Sales and Total Revenue.
    what is actual difference between total sales and Total revenue?
    Is there any report or query in EBS R12 from which we can find total sales and total revenu?
    Thanks,
    Kapil

    Hi,
    Can I use Receipt details to get total revenue i.e actual income from customer ?
    Please check the following query.
    SELECT code_combination_id,
    ra.applied_customer_trx_id,
    trx_number,
    SUM( NVL( line_applied, 0 )) line_receipt,
    SUM( NVL( tax_applied, 0 )) tax_receipt,
    SUM( NVL( freight_applied, 0 )) freight_receipt,
    SUM( NVL( amount_applied, 0 )) total_receipt
    FROM ar_receivable_applications_all ra,
    ra_customer_trx_all trx,
    ar_cash_receipts_all rcpt
    WHERE
    applied_customer_trx_id = trx.customer_trx_id
    AND ra.cash_receipt_id = rcpt.cash_receipt_id
    AND application_type = 'CASH'
    AND NVL(ra.confirmed_flag, 'Y' ) = 'Y'
    AND trx.complete_flag = 'Y'
    AND trx.org_id = 204
    AND trx.customer_trx_id = 51385
    GROUP BY code_combination_id,ra.applied_customer_trx_id,trx_number
    ORDER BY 3

  • Report for spending per material group

    Hi Gurus,
    Is there a report that will show us the total spend per material group
    Thanks
    Anusha

    Try LIS reports starting with MC*. For material group purchasing values you can try MC$<.
    Thanks...

Maybe you are looking for

  • How to verify an itunes account

    New Iphone.  ASking us to verify account.  But account it is directing us to with directions is an email account that does not exist anymore  How do we verify this account?

  • My MacBook Pro suddenly started running slow

    Hi, My MacBook Pro started running extremely slow a couple of days ago. I tried to search for help and found this forum where people had the same problem. I see that people are advised to check with etrecheck software and post it here to have further

  • Firewire External Harddrive not Mounting

    I recently bought a 1TB Seagate internal drive and put it into a casing, and have been using it for Time Machine backups on my white Macbook. I was using FireWire, but all of a sudden the harddrive either doesn't mount at all, or if it does, the back

  • IPhoto isnt recognising my IPhone 4S anymore

    iPhoto isnt recognising my IPhone 4S anymore. Cant download photos or video into my iPhoto after a recent update

  • Apple doesn't want my poor money

    Apple made buying Lion as hard as possible for me. What about the poor people in Canada without a credit card? nice to see another company refuse paypal this "new" form of buying software is too complicated.