Average value of a material

Hi All,
I am writing a query where I have to calculate the average price of each material.
Example, Material M1 can have many vendors, say,V1 and V2
I have to calculate for M1 =
(Price * Qnty)for V1 + (Price* Qnty)for V2...../Total Quantity for (V1V2+....)
Likewise I have to do for all the materials
I have taken in rows, material and then vendor.
In columns I have the price and qnty of all the materials for respective vendors.
How can I do the above calculation of average?
Thanks and regards,
SB
Message was edited by:
        Sharmishtha Biswas

Hi,
Try this:
1) Take Material and then Vendor in to the orws
2) Create a Global Calculated KF with Price * Qnty as "Before aggregation" as aggregation property.
3) Take the Global Kf in to columns area and also Price and Qty kfs.
4) Create a Local Calculated KF like SUMCT <Qty> .Lets say this as LKF1
5) Create another Local Calculated KF like SUMCT <Global Calulated Kf created by step  2>.Lets say this as LKF2.
6) Create a formula column like LKF1/LKF2.
It is just a try .Wait for experts answers.
with rgds,
Anil Kumar Sharma .P

Similar Messages

  • Moving average price of the material is negative

    Hi GUrus,
    Can anybody please expklain me why we get the moving average price of the material to be negative. PLz xplain with an example clearly. Thanks in advance
    Thanks
    Anusha

    Dear,
    Please rfer the OSS Note 753286 you will get the reason for it.
    The invoice price is constantly less than the goods receipt price.
    The invoice verification tries (in stock coverage) to subseqently debit resp. to credit the difference between value of goods received and invoice item value to the stock.
    Hope clear to you.
    Regards,
    R.Brahmankar

  • Custom SAP report used to display an average standard cost per material.

    Hi All,
    I need to implement a report with the following functionality,
    This is a custom SAP report used to display an average standard cost per material.  Standard cost data is stored in SAP at the Material/Plant level.  This report will gather the individual Standard Costs at each applicable plant (restricted by selection screen input and additional logic specified in more detail in the u201CReport Fieldsu201D section) for applicable Materials (restricted by selection screen input; if not specified all materials should be returned) and calculate an average standard cost for each material.  The corresponding Currency and Base Unit of Measure will also be displayed.
    Additionally the relevant u201CCommodity Code/Import Codeu201D information should be displayed for each material returned.  This attribute is also stored at the Material/Plant level.  To determine the value of this field for each relevant material, the report logic must retrieve the values stored for each plant.  If all values are the same, the value can be output to the report.  If not all values are equal, a message u201CNot Consistentu201D should be output.  It should be noted that if all values are u201Cnull,u201D a null value should be returned in the report.
    Can any one provide me with sample code for the same??
    Thanks Debrup.

    Hello,
    Also refer this [ THREAD|Re: error in Fleet management customising] and [link|Error when recording measurements in IFCU]
    Regards
    Nav
    Edited by: Desire_Naveen on Nov 4, 2009 12:35 PM

  • Report requirements with Average value , forecasting value & Prod Quant.

    Dear Friends,
    I need a help in Reporting.
    The reqirement is like this:
    1. I need to display the daily production quantity.
    2. Also the Average value of the Production quantity for a month.
    3. And the Forecasting value for the first day of next three months.
    4. Restricted Cal month on filters with variables and calday in columns and  
        keyfigure in Rows.
    I have tried to calculate the Average but as the  report is based on cal day it gives me the average value for all cal days. But i need it for the entire month.
    Plz help me in solving this report with your golden ideas!!!
    Thanks in Advance and Points will be assigned!!!
    Thanks
    Sri

    Hi,
    Thanks for your early response.
    Actually i am unable to use tcode: KKBC_ORD rather able to use KKBC only.
    Using KKBC (Target/actual/production variance) and activating collective order from setting option only able to see the details for a particular leading production order only relating toa  particular period .
    My requirement is to display all the production orders settled in a particular period along with (Material code /order number/ Qty/Actual value and variance value).
    Note: If any leading order exists then that should be collective order i.e.(value and Qty should come against the leading order number).
    If there is any standard tcode exists please let me know else provide the tables and logic to bui;d up such a report.
    Regards,
    Ramakanta

  • How To Find Opening Stock And Value For a Material

    Hi Experts,
    How To Find Opening Stock And Value For a Material  in Given Dates
    Moderator Message: Search.
    Edited by: kishan P on Sep 15, 2010 4:05 PM

    Thanks For Answering.....
    But I Need Any Function Module To Get Opening Stock And Value For Given Material With in Dates.

  • To display average value in a graph

    Hi There,
    In one graph I need to display the duration for each week as per the week range selected and a separate average duration value of the weeks selected.
    Is it possible to develop a query for above average value and use this query in WAD?
    Can anybody help in providing a solution
    Thank you
    Anima

    BI Query data can be fed directly to WAD Charts.
    See below.
    http://help.sap.com/saphelp_nw04/helpdata/en/0c/95c83956852b51e10000000a114084/content.htm

  • Too many decimals in Average value

    Hi
    I am using Report Builder and the wizard do design a table which i deploy as a .jsp page.
    For some columns in the table I select to display the average values. Some of the values looks fine with one decimal as i want, but some values is displayed with a lot of decimals (about 10) as 164,346666666666666666. I have tried to change the length but without effect. Are there any possibility to decide the number of digits to be shown in the report . Or is i it a bug in Report Builder.

    Go to Property Inspector of the field and choose the right "Format Mask".

  • Reducing the Freight cost on material value for undelivered material

    Hi Experts,
    Summary :  The material supplier vendor needs to be paid for full quantity of material. The freight transport is allowed an under tolearance of 0.5% on the material to be supplied. If the delivered material quantity breaches the 0.5% under tolerance then amount at 1.5 times the cost of material for the shortage is to be deducted from the transporter. A dummy GR will have to be prepared for the undelivered quantity for which we do not want the freight cost to be loaded. The details scenario is mentioned below :-
    We have to make a Purchase Order with material code say ABC for procured of some material. Suppose we make a Purchase Order for 100 nos. at a Unit Price of Say Rs. 10/- for Material Code ABC on say Vendor M/s XYZ. A freight condition is maintained in the Conditions Tab and suppose the Freight is Rs. 10 per unit of the material.
    While preparing the Goods Receipt through MIGO, in the Freight Tab we select say freight vendor say M/s PQR against the freight condition and post the goods receipt.
    While doing Invoice Processing in MIRO, when we enter the combination of Purchase Order and Planned Delivery Cost the system will populate the vendor codes of both the supplier of material and the transporter. On selecting the transporter the freight amount will populate against which the invoice of the tranporter can be processed.
    In the Vendor Master of M/s XYZ GR-Based Invoice Verification is activated.
    The vendor is allowed an under tolerance of 0.5% (i.e. the vendor should deliver at least 99.50 nos. of the Purchase Order). If the vendor delivers 99.50 or more then there will be no deduction in the freight charges.
    But suppose the vendor delivers only 99.4 nos. of the quantity. Then we will prepare the GRIR for 99.4 nos.only. But while processing the MIRO we need to deduct 1.5 times the value of the material from the freight amount for the shortshipped quantity, i.e.
    0.1     no (99.5 u2013 99.4) X Rs. 10/- * 1.5 = Rs. 1.5 are to be deducted from the final payment from the freight amount of the transporter.
    The material supplier will have to be paid in full 100 nos. of quantity and will raise an invoice for 100 nos. A dummy GRIR for the 0.6 nos. of undelivered material will have to be prepared for processing the invoice for the 100 nos. of the material supplier and a dummy issue for 0.6 nos. of undelivered material will be prepared to remove them from the system.
    Hence the freight cost for this 0.6 nos. of undelivered material will also go into the cost of the material and increase the MAP by that amount. Also the goods issue Cost will also have the effect of the freight cost.
    We do not want to load the freight cost for the undelivered material in the value of the material.
    Can any one please suggest a solution for the same.
    Thanks in advance.
    AJ.

    Hi
    A PO Will be raised for full quantity of material say 100 nos.
    The material supplier vendor needs to be paid for full quantity of material.
    A freight vendor is maintained at the time of GR for material against the freight condition maintained in the Po.
    The freight vendor facilitates the delivery of the material from the vendor to the purchaser for which he is given an under tolerance limit of 0.5%. Any delivery below this tolerance limit, freight amount to the effect of 1.5 times the per unit rate of material x short fall below 0.5% tolerance will be deducted from the freight amount.
    A dummy grir will have to be prepared for the short delivered quantity for processing the invoice for the full quantity of the purchase order, as the vendor is going to raise the invoice for full purchase order quantity. The client does not want to load the freight cost of the undelivered quantity on the material value as it will wrongly show the MAP of the material. This shortshipped material will be issued to remove it from the system and the stock will remain for the delivered quantity only. The vendor is subject to gr based invoice verification.
    Please suggest a solution.
    Thanks in advance.
    AJ
    The freight transport is allowed an under tolearance of 0.5% on the material to be supplied. If the delivered material quantity breaches the 0.5% under tolerance then amount at 1.5 times the cost of material for the shortage is to be deducted from the transporter. A dummy GR will have to be prepared for the undelivered quantity for which we do not want the freight cost to be loaded.

  • Creating function to calculate average value

    Hi,
    The below query was successfully return an average value. It returned 1 row.
    SELECT AVG(Volume)
    FROM security
    WHERE
    Type = 'Future' AND
    Rating = 'AAA' AND
    Code = 1 AND
    (Day = ''14-mar-09' OR
    Day = '16-mar-09' OR
    Day = '');
    I tried to use that function on my created function below.
    CREATE OR REPLACE FUNCTION fn_Vol_Average
    ( v_DayLast_1_Week IN DATE,
    v_DayLast_2_Week IN DATE,
    v_DayLast_3_Week IN DATE )
    RETURN NUMBER IS
    v_Vol_Average NUMBER;
    BEGIN
    SELECT AVG(Volume) INTO v_Vol_Average
    FROM security
    WHERE
    Type = 'Future' AND
    Rating = 'AAA' AND
    Code = 1 AND
    (Day = v_DayLast_1_Week OR
    Day = v_DayLast_2_Week OR
    Day = v_DayLast_3_Week);
    RETURN NVL(v_Vol_Average, NULL);
    END;
    I called that function by the following query. it was work, however it return the whole rows. It looks like the function perform the average calculation of each rows on the table.
    Can anyone help me what is going on with the logic?
    select fn_Vol_average('14-mar-09','16-mar-09','')
    from security
    --

    But since your function calculates the average over the whole security table, you wouldn't call this from a select statement which also reads the security table.
    You just want to execute it once.
    declare
       l_vol_average number;
    begin
       l_vol_average := fn_Vol_average('14-mar-09','16-mar-09','');
       dbms_output.put_line(l_vol_average);
    end;By the way, be careful with your date parameters. You should use TO_DATE with a proper format mask to prevent conversion errors.

  • How to get ATINN value based on material number and Class Type ?

    I have below SELECT stmt code which gives the correct value of atwrt based on materil no and ATINN.
    However in quality system, it is failing because in quality system "atinn" value is not 0000000381. It is different.
    So how can I get ATINN(Internal characteristic) value based on material number and Class Type?
    -Obtain the batch characterstic value for the Material******************
      SELECT atwrt
        UP TO 1 ROWS
        INTO v_charvalue
        FROM ausp
       WHERE objek = mcha-matnr
         AND atinn = '0000000381'   " 'US80_FRENCH_ON_LABEL'
         AND klart = '001'.
    THANKS N ADVANCE.

    Hi SAm,
    use the Below function module to get the Atinn for Atwrt for thr Class and MAterial combination..
    CALL FUNCTION 'CLAF_CLASSIFICATION_OF_OBJECTS'
          EXPORTING
            classtype          = '023'       "Class type
            object             = w_object  "Material number with Leading zeros
            no_value_descript  = 'X'      "Default X
            objecttable        = 'MCH1'    "Table name Mara or MCH1 or MARC
          TABLES
            t_class            = t_class   "It return the Batch class available for the above combination
            t_objectdata       = t_char  "Return Batch characteristics(ATWRT) and their value ATINN in this table
          EXCEPTIONS
            no_classification  = 1
            no_classtypes      = 2
            invalid_class_type = 3
            OTHERS             = 4.
    Regards,
    Prabhudas

  • Which table has Moving Average price for a material

    Can you let me know from which table I can get the Moving Average Price for a material
    Thanks

    Found MBEW table which has the necessary information

  • T.Code for checking the total value of a material

    Hi Experts,
      Can anybody tel me the T.code for checking the total value of a material which is procured in a specified period?
    Thanks in advance
    Channa

    Refer Tcode ME80FN click on Change Veiw & select Purchase Order History with this you can get PO-GRN-INVOICE Qty & Value details
    Last button on Application tool Bar it is in line of filter, total etc icons
    Also check below reports :
    MC$G - PURCHIS: Material PurchVal Selection
    MC$0 - PURCHIS: PurchGrp PurchVal Selection
    MC$< - PURCHIS: MatGrp PurchVal Selection
    MC$4 - PURCHIS: Vendor PurchVal Selection

  • How to find Blocked Stock Value for a Material Division

    Hi Every Body,
    I have gone through the notes 589024,637927 to find out Blocked Stock value for a Particular Material at different plants . But I have to get Blocked Stock value at each Material Division . Kindly give some light on it to get it.
    The steps are same for finding the Consignment stock value and Transit Stock value. So kindly help me if any body has already worked on it.
    With rgds,
    Anil Kumar Sharma .P

    Hi Anil,
    well these notes work but they're prerequisites that have bothered me and unabled me to fulfill our requirement, for instance, having the material number in the drilldown and so on in order to perform the calculation during query execution.
    I believe there is not much more alternative if you still want to calculate valuations accurately at SLOC or any other stock indicator during query execution...
    I started from the basic fact that valuation of material underneath the plant/valuation area  (in my case 1 PLANT = 1 VALAREA).; precisely because all movements doens't carry all information as per the note explanation.
    So what we have done is to pull a cube with all Article/Sites MAP values; this can be done in several ways; MBEW/MBEWH are holding MAP values per fiscal periods; it has sufficient for us until now: our operations are asking to track MAP values more frequently.... So I am investigating how to work this out and have several alternatives:
    - MSEG has additional fields (available in the extract structures) like Total Stock Qty/Value PRIOR the posting. There is as well an indicator telling if the posting is relevant for the valuation (if it is going to affect the Qty/MAP or not). So it is possible to get the MAP after the posting for each material movement.
    - Create a change pointer on MBEW/MBEWH.
    - MKPF has two convenient fields (CPUDATE and CPUTIM) from which we could build our own delta extractor tracking MAP changes
    In BW the Idea  is to have a cube registering the Article/Plant valuation in time (non-cumulative) and then fulfill our queries via a multicube...
    hoping this will help you in solving your issue; I am of course following any topic in this matter so would appreciate your input....
    Olivier.

  • Display of "Average Values Text in ALV grid"

    Hi
        I use ALV grid to display  the fields from a table. I have 15 columns.  I need to do average for four columns.
    In the field catalog i did a do_sum for those fields.
       When the ALV grid is displayed I get average values for these columns.
    Eg. Let suppose the grid looks like
    Field1           Field2           Field3             Field4     Field5         Field 6.
    vendor1       18                 22                   6            17                28
    vendor1       54                 11                  16           62                28
    vendor1       33                 21                   26          79                18
                        35             18                 16        52             24
      My requirement is I need to display the text "AVERAGE VALUES" . ( I need something like this.)
    Field1                      Field2           Field3             Field4     Field5         Field 6.
    vendor1                   18                 22                   6            17                28
    vendor1                    54                 11                  16           62                28
    vendor1                    33                 21                  26          79                18
    Average values        35             18                16        52             24
    Could someone help me in this?
    Thanks & Regards
    Kavitha

    Hello,
    you can use event subtotal_text of ALV_GRID.
    Regards,
    Pedro Santos

  • Calculate Average value based on Day ??

    Hello,
    I am trying to calculate the Average value based on a day. The data is presented as follows...
    Day          SOCount
    Mon                34
    Mon                 56
    Mon                 67
    Tues               24
    Tues               25
    Tues               23
    Weds              45
    Weds              69
    The issue im having is that the Day column needs to be grouped first and the SOCount sumed together. Then the Average SO Count needs to be calculate based on this.
    Thanks

    Thanks for the reply,
    The solution you have provided only gives me the average of the count of the SO Count, not the actual average of all the values added together then  divided by the count..
    The report i am creating only has charts in it. So i am trying to create a chart showing the
    Average Sale Order Value by day.
    I should have metioned this from the start, sorry.
    Is it possible to do ?
    Edited by: davitali on Nov 4, 2011 6:32 AM

Maybe you are looking for

  • How do i connect an ipod lcd screen to a zen visio

    My zen vision m lcd screen recently cracked and after getting the full run around and reading up on the net, I bought a 2.5" lcd ipod replacement screen for $0 off of ebay. I really don't watch much movies so the quality doesn't really matter as long

  • Trying to insert a single row in a table based on NOT EXIST

    Hi, I have a procedure where i am doing an insert into the table say create table ABC(PK number, valu varchar2(10)); insert into ABC values(1,'hi'); Now my problem is that this procedure may be run several times so if a PK already exists, it should n

  • Need help with Zen Micro and Win

    Hi, I bought a Zen Micro 2 days ago and I can't get it to work with my Win XP machine. I did what was told in the manual: install the software first then plug the player. When I plug the player in I get the following message: Found New Hardware: Zen

  • How to do a video gallery page

    Hi everyone when you create a new page iWeb lets you choose from some preset pages like the homepage, the blog, the video and the photo gallery. But the video page lets you put one or more videos in just one page. If you have many videos and you want

  • Goals for 1.0?

    Is better bootup process one of the goals for 1.0? I feel that the bootup process isnt so bullet proof as other distros...