How to Calculate Avg Stock

Hi Experts,
User wants to see Avg stock in the report
say stock values are as following
MONTH-StockReceipts- Sales- Closingstock 
1-          365-     12-     353
2 -          0-     89-     264
3-          0-     80-     184
4-          0-     110-     74
5-          0-     12-     62
6-          365-     24-     403
7-          0-     110-     293
8-          0-     12-     281
9-          0-     67-     214
10-          0-     90-     124
11-          0-     100-     24
12-          0-     24-     0
if user enters 01.01.2011 to 31.12.2011
Avg stock  should be 189.6(this is the avg of closing stock)
in this example total Stock Receipts 730, Sales 730 and Clsoing stock on 31.12.2011 is 0.
in the Report along with this Avg stock there are other key figures also.
how can we calculate the avg stock value based on every month closing stock between the time interval.
say if user enter 01.01.2011 to 31.12.2011 then i ahve to consider the 12 periods closing stock
Regards,
Chandra

Dear Chandra,
Are those months 1 2 3... all selections? i.e there is no calmonth out of the structure isn' it? Then yes my reply doesn't work.
Because the formula is wrong.Not the key figure .I think you don't have to create lots of key figures.This unique key figure of closing stock is restricted by the user's input and takes the value of everything between that input.E.g if the user inputs 05.02.2011-17.08.2011 then the key figure must take the sum of the values of closing stock between that date, in my opinion.
Now let me correct the formula, you must divide this key figure to the number of months(forget about the average, it was wrong). And number of months between the user input interval must be calculated by the ABAP code i.e a user exit variable.
Hope it helps,
Sunny

Similar Messages

  • How to calculate Opening Stock for a particular date.

    Hi Experts,
    I have a sitution to calculate Opening stock for a particular date.
    please help me with the necessary Fields & Tables required.
    Appriciate If any Sample coding available.
    Thanks & regards,
    Venkat.

    Hi Venkat,
    To Calculate Opening Stock & Closing stock there are different procedures.
    It just depends of\n the client requirements & usage of the material.
    For example, we have different types of stocks, like, Through Pipeline, Special, Unristricted, quality, safety,
    and many types of stocks.... so all these types are indicated in MSEG tabe in SOBTZ field,...
    Now Comimg to your Query, You need to calculate OPENING & CLOSING STOCK.
    We have a similiar standard report in MB5B Tcode..
    to get the same results in your report do like this...
    For valuated stock go to the MARDH, MBEWH, MCHBH tables But I Prefer MBEWH.
    here in MBEWH give the month & year and you get the result in LBKUM field...
    For Special stock, You need to go to another table like MKOLH,,(I forgot still 2 more) and
    give the month & year inputs and you will get the result in SLABS field.
    and remaining MB5B refers to its deetails lists with different Movement types,
    whcih you can get clearly from MSEG Table...
    Hope you can write the select Queries accordingly.
    Thanks & Regards,
    Dileep .C

  • How to calculate avg value in bex

    Hi all
    I have a requirement
    I want to run a query for a particular period say 0032005.
    in the query output value will display for all prior period in different column. for perod 003
    it will display value for 001 , 002 ,003. and
    at the last column  i want calculate the avarage for this 3 period. these should be dinamic.
    if i run this query for period 0052005. query will display value for period 001 ,002 ,003,004,005 and last column will display avarage for the 5 period.
    i am able to diaplay each prior period in different column that is fine. but i am not abel to calculate the avarage column.
    example
    selection screen :
    fiscal period : 0042005
    Query output
    Char 0012005 0022005 0032005 0042005   Avg
         88        99     77       66     (889977+66)/004
    Please any one know about please help with steps.
    Thanks

    I have a requirement
    I want to run a query for a particular period say 0032005.
    in the query output value will display for all prior period in different column. for perod 003
    it will display value for 001 , 002 ,003. and
    at the last column i want calculate the avarage for this 3 period. these should be dinamic.
    if i run this query for period 0052005. query will display value for period 001 ,002 ,003,004,005 and last column will display avarage for the 5 period.
    i am able to diaplay each prior period in different column that is fine. but i am not abel to calculate the avarage column.
    example
    selection screen :
    fiscal period : 0042005
    Query output
    Char 0012005 0022005 0032005 0042005 Avg
    88 99 77 66 (889977+66)/004
    I got the resolution as bellow.
    In the Characteristic Property Set it as Suppress Result Rows-> Never. For the key figure Set Calculate Result Rows-> Average of All Values.
    yes it is working fine . but there is a small problem in the column heading for this colume is displying as overall result. but values are displying as a avg value. how can i change it.
    why i ahve to create a text variable. please explain

  • How to Calculate the Stock aging report in BW

    Dear All,
    Please let me know the process to calculating the Stock Aging report in BW.
    And what are date field need to be consider and what are customer exits used to populated different agings in Stock like 0-30 days etc.
    Thanks
    Regards,
    Sai

    Hello,
    I would be very happy if you send me some sample code to implement this in User exits.
    I mean which ABAP statements are useful in this case. I think we need to implement the following logic for User Exit variable.
    1. At run time, retieve the SSN data from BW dabase
    2. Convert the first 5 digets into *****
    3. Make it available to report in BEX.
    Thanks
    VNM

  • How to calculate total stock quantity in cube

    Dear Master
        I want to verify the data between BI report and cube whether correct or not.My report name is stock summary. It's giving report for Total quantity stock (0TOTALSTCK) for paricular date. This KF(0TOTALSTCK) inflow is 0RECTOTSTCK and outflow is 0ISSTOTSTCK. Somebody telling to get the Total quantity stock (0TOTALSTCK) value, I have to use following formula 0RECVS_VAL (Value Received into Valuated Stock) - 0ISSVS_VAL (Value issued from valuated stock). Please advice me which formula should I use to get the total stock quantity?.
    Thanks a lot in advance
    Raja

    Please let met understand better, you have the following keyfigures:
    - Receipts (Cumulative)
    - Issues (Cumulative)
    - Difference (Cumulative) populated during URules = Receipts - Issues (any routine with elaborated calculation behind?
    - Stock (non-cumulative InFlow = Receipts, OutFlow = Issues)...
    Is this correct?
    Olivier.

  • How to get block stock of QI and UR

    Dear All,
                 I have a requirement to create a customized report for Finished products stocks.
    Selection screen:
       - Plant
       - S/Loc
       - material
       - month
       - year
    Output has opening and closing balance, of stocks . I am fetching blocked stock from MARDH, (SPEME + RETME )
    my problem now is is want to excluded block stock to QI (with movement type 349 and 350). Please suggest me as how to exclude material from movement type (349 & 350) from the total of MARDH (SPEME + RETME )
    Edited by: soyunee on Apr 24, 2009 2:50 PM

    Hi Soyunee,
    To make all types of calculations on stock I have a some methods posted previously,,
    Please check the link once for calculating the stocks accordingly.
    [How to calculate Opening Stock for a particular date|How to calculate Opening Stock for a particular date.;
    To Calculate Opening Stock & Closing stock there are different procedures.
    It just depends of\n the client requirements & usage of the material.
    For example, we have different types of stocks, like, Through Pipeline, Special, Unristricted, quality, safety,
    and many types of stocks.... so all these types are indicated in MSEG tabe in SOBTZ field,...
    Now Comimg to your Query, You need to calculate OPENING & CLOSING STOCK.
    We have a similiar standard report in MB5B Tcode..
    to get the same results in your report do like this...
    For valuated stock go to the MARDH, MBEWH, MCHBH tables But I Prefer MBEWH.
    here in MBEWH give the month & year and you get the result in LBKUM field...
    For Special stock, You need to go to another table like MKOLH,,(I forgot still 2 more) and
    give the month & year inputs and you will get the result in SLABS field.
    and remaining MB5B refers to its deetails lists with different Movement types,
    whcih you can get clearly from MSEG Table...
    Hope you can write the select Queries accordingly.
    If you want to find the Stock for a particluar date, It is not available in any table as I know,
    Rather you need to do calculations like this.
    1. Select the stock (Menge) till date from MSEG and add all with different movement types,
    Its a logic need to ask to your functional consultant,
    like 101 added to stock, 601 sales, 102 rejeted, 602 added back to stock,... transfers, 261,,, like this.
    But take a little time, get all these by using MKPF & MSEG tables... thats it.
    Or----
    2.Tables are MSEG , MKPF ... use Debit / Credit indicator ( Do not go woth any static Movement types ) and u have to consider all stock related table
    MBEW , EBEW etc..., to get the stcok on particular date .
    Please refer to Std. Tcode FBL5N for reference.
    Thanks & regards,
    Dileep .C

  • Calculate Avg  for the given months based on the no. of days in months

    Dear Experts
    I  have a report in which there is a characterictic claenderyr/month.The Input paramter is claenderyr/month which is restricted by a variable of type interval. i mean user will enter calenderyr/month as interval say 012010 to 06.2010. Now I have to calculate Avg sale Qty for the given months based on the no. of days for the given range of months. How I can achieve this in BW Query. Pl. advice
    Dinesh Sharma

    Hi,
    Create formula for the sales qty.
    maintain the exception aggregation as average based on calday
    Best Regards,
    M.H.REDDY

  • How system calculate the required qty. after MRP RUN

    Hi,
    I want to know if we are using MRP Type as PD and also we are calculating automatic saftey stock and re order point qty. after MRP RUN according to which rule formula system calculate the safty stock, reorder point qty. and the required qty. as a PR.
    and if we are not using calculate safety stock automatically and if we set safety stock qty. manually in this case how system will calculate the required qty.
    regards,
    zafar

    please check the below links.
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/6f/b441a9a1b011d3a82d0000e82a3c24/content.htm\
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/f4/7d256344af11d182b40000e829fbfe/content.htm
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/ff/515c4749d811d182b80000e829fbfe/content.htm
    please check the above links may get some idea.
    Regards,

  • How to calculate moving average price(MAP) when price variance in IV

    Hi All,
    My current stock for a material is 39 and MAP is 0.8 GBP.
    A purchase order is created for the material for a quantity of 1 at price of 0.8 GBP per unit.
    Invoice is posted for the above PO at price of 1.74 GBP.
    What will be the new MAP for the material now??How to calculate MAP when there is a price variance in Invoice?
    Please suggest ASAP.

    Hi,
    The Procedure for calculating MAP is :-
    Case 1 :- PO at different price
    If in Material Master your MAP is 0.8GBP & closing stock of 30Nos, value is 24GBP
    In PO if the price is 0.9GBP & qty is 10nos, then after Goods Receipt Total Value of the GR i.e. Qty * Price + any other delivery cost will be added to the material stock value.  Qty is also updated.  New Total Value / New Stock Qty will be MAP.
    In this case Qty received 10 & price is 0.9 that means value would be 9GBP.
    Total Value becomes 24GBP (Present Stock) + 9GBP (Goods Receipt) = 33GBP
    Total Qty becomes 30Nos + 10Nos (Goods Receipt) = 40Nos
    MAP becomes = 33GBP / 44Nos = 0.75
    Case 2 : Invoice Posting (MIRO) at different price than PO
    While doing MIRO is we post at different price system will check whether sufficient stock posted in GR is available.  In the above case it is 10Nos,
    If it is there, then the above logic as in case 1 will take place
    If not available, to the extent of stock availability system will post the different value & adjust MAP & remaining is posted to Price Difference Account.
    In your case it would be like this :
    1. MAP 0.8 for 30Nos (Value would be 24GBP)
    2. Invoice Posting 1.74GBP for 1No.  That means value would be 24GBP + 1.74GBP = 25.74GBP
         Qty would be 30+1 = 40
         MAP = 25.74 / 40   = 0.64GBP
    Hope this clarifies your doubt
    regards,
    JP

  • How to calculate MAP

    Hi all,
    Please let me know How to calculate MAP ( moving average price ) on daily basis - Please explain what formula we should use and from which table, which field values we should take?
    Also let me know how to calculate MAP at the time of vendor invoicing.
    Regards.
    Ronnie

    Calculation of MAP
    IN MMR (Stock)
    price - 50
    qty - 2
    in PO
    Price - 51
    qty - 4
    After GR for 4 qty price updation in MMR will happen
    (MMR (priceqty) value + MIGO (priceqty) total value)/total qty
    in our example
    (502+514)/6 = 50.65
    price will be updated to 50.65.
    MMR price - 50.65 qty - 6
    MIRO price - 52 qty - 4
    do the same calcualtion to get updated MAP.
    rgds
    srini

  • How to check whether stock cover MRP requirements

    Hi Everybody,
    Could you please tell me how to check whether stock cover MRP requirements?
    My user hope to block GR for PO. Because before GR, customer decrease their order qty. However, it is difficult if buyer decrease the PO qty manually. So, they hope SAP can calculate and block GR.
    I know we can add the control in user exit of MIGO. However, I dont know how to check the stock whether cover MRP requirements. anybody can tell me what is the standard function? of course, it is okay if you have other solution such as via standard configurations.
    Thank you in advanced.
    Regards
    Henry

    Hello Ravi,
    Thank you for your reminder.
    We have double confirmed with our client. It is very difficult to using Scheduling Agreements instead of PO. because lots of job have to be changed such as
    1. Share our Scheduling Agreements with suppliers on a new system such as Internet.
    2. PO release strategy will be put into Scheduling Agreements. I dont know how to to reach this.
    Customer may random decrease their order Qty even if they have sent formal order to us. So, we have to block GR for our supplier even if sent PO already. In OEM industry, it is truth already.
    Hello BK,
    I know in MD04, we can manually list. But, please tell me which function (SE37) can identify. We hope can call the function in user exit of MIGO.
    Regards
    Henry

  • How to calculate totals in Blocked ALV Report

    Hi All,
    Can any body tell how to calculate totals & sub totals in
    Blocked ALV Report[Blocked List].
    Thanks in advance
    Thanks & Regards,
    Rayeezuddin.

    read this it might help
    Sums                                                       
    15. No_sumchoice(1) TYPE c : This parameter allows the choice for summing up
    Only by fieldcatalog.
    Value set: SPACE, 'X'
    'X' = fields which are to be summed, passed by the calling program (FIELDCAT-DO_SUM = 'X'). The user should not be able to change this value interactively.
    16. No_totalline(1) TYPE c : Removes the option of having totals after sub-totals.
    Value set: SPACE, 'X'
    'X' = no total record is to be output. Subtotals can still be calculated and output. The fields in the subtotals are flagged DO_SUM = 'X' in the field list.
    17. No_subchoice(1) TYPE c : Does not allow the user to interactively change the field chosen for subtotals.
    Value set: SPACE, 'X'
    'X' = value whose change triggers subtotals, provided by the calling program. The user should not be able to change this value interactively.
    18. No_subtotals(1) TYPE c : No subtotals possible          
    Value set: SPACE, 'X'
    'X' = no subtotals.
    19. Numc_sum(1)  TYPE c : Totals only possible for NUMC-Fields.
    20. No_unit_splitting TYPE c: No separate total lines by inh.units   
    21.totals_before_items TYPE c: Display totals before the items   
    22. Totals_only(1) TYPE c :  Show only totals      
    Value set: SPACE, 'X'
    'X' = only total records are output.
    23. Totals_text(60) TYPE c : Text for 1st col. in totals   
    Value set: SPACE, string (max.60)
    ' ' = The first column in the total record contains an appropriate number of '*'s to indicate the total by default. If the first column is wide enough, the string 'Total' is output after the asterisks.
    'String’ = The string passed is output after the total indicated by '*', if the column is wide enough.
    24. Subtotals_text(60) TYPE c : Texts for subtotals
    Value set: SPACE, string (max.60)
    ' ' = In the first column of subtotal records, the subtotal is indicated by an appropriate number of '*' by default. If the first column is not a subtotal criterion, the string 'Total' is output after the asterisks, if the column is wide enough.
    'String’ = the string passed is output after the subtotal indicated by '*', if the column is wide enough and the first column is not a subtotal criterion. If it is a subtotal criterion, its value is repeated after the total, if the column is wide enough.
    ELSE TELL ME I WILL PASTE COMPLETE HELP
    regards

  • How to Calculate Opening balance

    Hi BW Gurus,
    How to calculate Opening balance for previous period using variables in Reports using debit and credit.
    Example:
    Opening balance is the balance for an account for the previous period. In other words, if the user is running a report for Period 1, 2006, the opening balance is actually the ending balance from Period 12, 2005 (December 31st, 2005).
    Thanks in advance
    DJ

    Hi Friend,
    If Your Prob is solve then tell me how to find perticular month balance amount.
    i m create cash book report for perticuler GL Account , i use BKPF + BSEG for this
    i found all entries,
    But at last i want to Opening Balance for perticuler date.
    like     01/05/2007 opening balance = 10000 as per tcode FS10N
    and in 26/05/2007 ??????
    how to find exact date opening balance is there any function for same
    or any procedure..
    Thanks
    From
    Gaurav

  • HOW TO CALCULATE OPENNING BALANCE

    HI Experts..
    How to calculate Opening balance for previous period using variables in Reports using debit and credit.
    Example:
    Opening balance is the balance for an account for the previous period. In other words, if the user is running a report for Period 1, 2006, the opening balance is actually the ending balance from Period 12, 2005 (December 31st, 2005).
    I am Using 0FIAR_O03 ODS ..
    Very Urgent Issue..
    If Possible Stp by Step..
    Cheers
    Purushottam
    09891683828
    [email protected]

    Hi Saloni,
    to get the debit and credit you would be using a variable 0I_FPER(Fiscal year / period), which is a user entry interval variable.
    now to get the opening balance you will have to create a customer exit valiable and the low value of 0I_FPER will have to popuplated by writied the code for the customer exit valiable. you will have to restrict the key figure DEB_CRE_LC for this customer exit variable with the operand as less than(< Fiscal Year /Period from 0I_FPER)).
    If the above was useful please assign reward points.
    Regards
    Venkata Devaraj

  • How to calculate Opening balance for a customer?

    Hi Experts,
    How to calculate Opening balance for a customer? I am trying to develop a report where in i have to get opening AR balance,current sales,adjustments etc of a customer. Please let me know how can i do this. I have some tables with me KNC1, BSAD, BSID.
    Thanks in Advance.
    Sharat Chandra.

    Say for example ..
    Get the opening bal for Customer 'K' in CCode 'C1' in 2008 ..
    First get all items from BSEG ..
    Select * from BSEG where KUNNR eq 'K'
                                     and BUKRS eq 'C1'
                                     and GJAHR eq '2008' .
    Sum all the DMBTR values (This is the total value).
    Second get the cleared items form BSAD for the above entries;
    Select * from BSAD for all entries in BSEG where KUNNR and BUKRS and XBLNR eq BSEG-XBLNR.
    Sum all DMBTR values ( this is cleared value).
    Third substract the cleared value from total to get Open value.
    This is a overview .. you should go to the tables and look for fields and etc.. and then define the logic meeeting your requirements .... this is a genric undersatnding ....
    Thanks,
    Aditya. V

Maybe you are looking for

  • [solved] mouse and keyboard not working (and previous fix wont work)

    i made a clean default setup with arch latest kernel - 2.6.29 i think xorg 1.6.1 video-intel-legacy on a 865G intel box + tried usb and ps2 keyboards + usb mouse when i start X the mouse and keyboard dont work (and i have to hard reset the box) in al

  • Photoshop Elements 10 serial number help

    My computer crashed and I am trying to install Photoshop Elements 10 on my new laptop. I lost the serial number and it does not appear on my adobe account. The software also came with Premiere Elements and is a student and teacher edition. The Premie

  • Silent Uninstall lync 2013 client

    Hi, i try to uninstall Lync 2013 Client silently but no matter what i try Lync won't uninstall. maybe someone can explain me what i'm doing wrong I tried the recommended command copy "%~DP0uninstall_lync.xml" "%COMMONPROGRAMFILES(x86)%\microsoft shar

  • How do I expand a ActiveDirectorySubnetCollection so I can view all elements and export to a CSV file?

    Hello, In the following, I list SiteName, Location, Subnets, and Severs, however I don't see all the servers or the subnets, presumably because Subnets are an ActiveDirectorySubnetColletion and Servers are a ReadOnlyDirectoryServerCollection.  So I w

  • Remote debugging Flex

    Hi, I use a windows XP sp3 I have a Flex application which is embedded in JSP page and deployed in a weblogic server in a different unix machine. The JSP maintains session The Flex app uses remote objects to communciate with the Weblogic server which