Ending Inventory / Balnce using @Prior

On 9.3.1 and my time dimension spans two dimensions (Periods and years).
Measures in outline:
Inventory (LabelOnly)
----OpeningInventory (store)
----Additions (store)
----Sales (store)
----EndingInventory (store)
Years (labelOnly)
----2010
----2011
----2012 (is &year1)
----2013 (is &year2)
CalcScript :
Fix(forecast,working,&year1,&year2,@relative(entity,0),@relative(products,0))
SET CREATENONMISSINGBLK ON;
/* LOOP(12) */
OpeningInventory
     IF(@ISMBR(&Year2) and @ISMBR(Jan))
          OpeningInventory= &Year1->Dec->EndingInventory;     /* basically @MDshift */
     IF(NOT @ISMBR(Jan))
          OpeningInventory=@PRIOR(EndingInventory);
     ENDIF;
     EndingInventory=OpeningInventory+Additions-Sales;
/* ENDLOOP */
SET CREATENONMISSINGBLK OFF;
EndFix
Sometimes, (without using LOOP as comented above), the value of the EndingInventory of the previous month is not available when OpeningInventory is calculated
Am I missing some thing?
And also is &Year1 calculated before &Year2 (as per the member oder in outline), so that Year1's December EndingInventory is available while calculating Year2's January OpeningInventory? or do I need LOOP, would like to avoid LOOP as it increases calc time?
Also looked at How to link an opening balance to prior period ending balance?
Appreciate your help.
Thanks

Hi,
We had similar situation and changed the script as below. Added Ending Inventory equation in both if and Else statments also.
Though it is not required, this way, it worked perfect.
IF(@ISMBR(&Year2) and @ISMBR(Jan))
OpeningInventory= &Year1->Dec->EndingInventory; /* basically @MDshift */
EndingInventory=OpeningInventory+Additions-Sales;
IF(NOT @ISMBR(Jan))
OpeningInventory=@PRIOR(EndingInventory);
EndingInventory=OpeningInventory+Additions-Sales;
ENDIF;
Edited by: PadmajaV on Aug 27, 2011 2:29 AM

Similar Messages

  • Inventory Management: Month beginning and ending inventory levels

    Hello,
    I need to have beginning and end of month inventory levels. I havent been given any functional specs . The only favor I would like from you is to know what standard chars and key figs you are using in your rows and column. And how are you using the objects in the forumla Naveen A suggested in the thread [SAP Business Explorer (SAP BEx);.
    Specially where he mentions formula, I would like to know what key figures does it consist of and are they restricted to the current or prior month.
    Let the end inventory be the same way and the begin inventory be as end inventory - ( total receipts current month - total issues current month).
    Thanks

    Anyone...Naveen A ....Arun????
    This is a simple one...
    Thanks
    Edited by: Navi Singh on May 1, 2009 9:51 PM

  • Inventory Management 0IC_C03: Beginning and ending inventory

    Hi Gurus
    My report is based on Inventory Management cube and I have a requirement where in I need to show Begining Inventory and Ending Inventory for Plant per Period.
    There is no KF for Beginning Invin SAP standard model in inventory management cube (0IC_C03 cube), so I thought to restricting total quantity by Fiscal period and Offset by minus one to get begining inventory.
    Here is my report layout:
    I have got : Period , Plant in rows and Beginning and ending inventory in Columns.
    Desired Output:
    Fiscal Period | Plant |  |  Begining Inventory | Ending Inventory.
    03/2009        |  1001 |    100                       |  50
    Actual Report output
    Fiscal Period | Plant |  |  Begining Inventory | Ending Inventory.
    02/2009        |  1001 |                 100          | 
    03/2009        |  1001 |                                |  50
    So basically report is being split on two lines for current and previous (due to restriction in begining period : Offset =-1 on period).
    Question is how to achieve both begining and ending inventory for a period in same line.
    Thanks in avdance for help and time
    SA

    HI Naveen
    Thanks for the reply. Non *** KF are already being used and Standard SAP model is being followed. Problem is not with back end but with frontend. Data coming on the report is fine but problem is how to show them on same line. Remember Beginning inventory for current open is ending inventory for previous month and  in SAP content there is no KF called as begining inventory. Basically data from two consecutive periods (current and previous one) needs to be on same row of report, but they are coming on different rows if we have period in drilldown by period. this makes sense but how to overcome this.
    This, We have all the correct data but facing issue while displaying that on frontend.
    Thanks
    Sorabh
    Edited by: Sorabh on Mar 23, 2009 5:01 PM

  • Inventory load using 561 movt type and auto confirm TO in MB1C using 561 movt type

    Hello All,
    I am doing the inventory load using 561 movt type in MB1C. Then the material is in 998 storage type and bin "AUFNAHME". my requirement is that i want to confirm the TO, when i do the MB1C itself for the 561 movt type. Is there a way in the SAP, where i can trigger the TO confirmation in the background automatically, when i use 561 movt type in MB1C.
    Right now my thought processing is that as below,
    i create the inventory load using 561 movt type in MB1C and use the LT10 and move the stock to a different bin and confirm the TO.
    In the above step, i am using LT10 as a extra step for confirming the TO, which i am trying to decreasing my configuring in such as way for the movt type 561, so that it will automatically confirm the TO in the background, while doing the MB1C.
    My 2nd question is, when i have 5000 different materials, which are inventory loaded using 561 movt type and MB1C. I am trying to auto confirm the TO in the background, when doing the MB1C for 561 movt type itself.Secondly, if it doesn't work, then i can goto LL01 and pick the unconfirmed TOs and mass confirm the TO's.
    On the whole, my questions are is there any std config in SAP to auto confirm the TO for movt type 561 in MB1C. If it is not possible, then i need the best way to mass confirm the TO's in  SAP.
    Thnks,
    Kapil

    Hello Kapil,
    Let me explain the process step by step
    Assumption/mandatory criteria-  The process is applicable only in case you do not have storage unit management active  This process is warehouse transfer w/o WM transaction. This method is based on principle of MB1A- 711/712 movement type.
    (1) Use OMJJ and create new movement type by coping 561 for ex- "Z61". In field selection (flield selection from 201) double click on WM and make the entry "WM storage bin and storage type as required entry from suppress.
    (2) Now use MB1C with above customised movement type. At the end of this transaction,system will take you to the screen to  make an entry in storage type and storage bin. Post the entry.
    That's it. Your stock would be in warehouse as well as IM stock would be in sync. There is no TR/TO. You can create LSMW to upload the data by this method. If you have SUT defined then you can follow the same process as above. But after that do not forget to update LQUA-LETYP field with respective SUT. However, you can not use this method in case you have SU management active.
    My view with this upload process-  Please use other data uploading method which are not at all time consuming. In more than 90% of most of the business scenarios, storage unit type is used. Hence you will have to perform additional activity of updating LQUA-LETYP-storage unit type field. If this is the case, then why cant you use other uploading method?.
    Thanks,
    Milind

  • Physical Inventory Status Flag Not Reset after Year End Inventory Procedure

    Hi,
    We are just done with the Year End Inventory Procedures, and to my surprise, a lot of Storage Bins are having their Physical Inventory status flag as ACTIVE, which they should not have.
    An example bin has incorrect status-u201Ccountedu201D in the associated inventory record number . LINV status is L-cleared. LINK status is Z-counted, LINP status is Z-counted and physical inventory flag is ON in table LAGP, but status must be L-cleared and physical inventory flag should be OFF (or blank) in table LAGP.
    Our users did not use LI20 to clear the empty bins or bins had no difference to post (meaning book qty & count qty are the same).
    I already tried the Program RLREOLPQ and OSS Note 824904, but no its of no use in our Case.
    Any guess/hint for the problem?

    I solved this with thehelp of a Zprogram writeen wrt the OSS note mentioned above in the question.

  • Ending Inventory Per Item

    I am preparing the Inventory Turnover Report.  I need data on the beginning and ending inventory values per item per month.  I looked at the Inventory Audit Report and it does show the data I need which are cumulative Qty and cumulative Value columns.   These data however appears to be transient computed data and not table fields. 
    Does anyone know the table and fields(s) I should use to access the beginning and ending inventory values per item per month?  I already looked at these tables: OITM, INV1,OINV,OINM,MRV1,MRV2,OMRV.  I could find the what I am looking for.
    The fields I am referring to is the same one being used by the system to calculate the COGS and/or Gross Profit per line item in the invoice. 
    Tips or suggestion is greatly appreciated
    Thanks.
    Edited by: raymon on Feb 17, 2012 8:27 PM

    Hi Raymon,
    Check this link...
    http://forums.sdn.sap.com/thread.jspa?threadID=1997923&messageID=10459565#10459565
    Thanks,
    Srujal Patel

  • Is it mandatory to use PRIOR in CONNECT BY NOCYCLE in Oracle 10.2.0.4

    Hi,
    Is it mandatory to use PRIOR in CONNECT BY NOCYCLE in Oracle 10.2.0.4.
    While I am executing a query in 10.2.0.2 which is having CONNECT BY NOCYCLE and PRIOR is not included, it was executing fine.
    But in 10.2.0.4 If i run the same query without using PRIOR in CONNECT BY NOCYCLE, it is running indefinitely.
    If I add PRIOR in CONNECT BY NOCYCLE then it is executing successfully.
    So I want to know is it mandatory to add PRIOR in CONNECT BY NOCYCLE from 10.2.0.4 onwards.
    If Yes, can you please provide any support documents for that.
    Thanks,
    Mahipal

    Hi,
    I was not using PRIOR with CONNECT BY NOCYCLE in 10.2.0.2, but the query ran perfectly in fraction of seconds without any issues.
    But in 10.2.0.4 while I was running the same query, it has been running for longertimes.
    Below is the Query:
    SELECT 1 type_num, r.NAME root_name, r.DATA_GROUP root_data_group,
    NULL child_name, NULL child_data_group, NULL child_type,
    NULL facility_type
    FROM DATA_GROUP r
    WHERE r.DATA_GROUP = (SELECT MIN (DATA_GROUP)
    FROM DATA_GROUP
    WHERE node_type = 'R' AND tree_type = 'C'
    GROUP BY tree_type)
    UNION ALL
    SELECT DISTINCT 2 type_num, NULL root_name, NULL root_data_group,
    dg_child.NAME AS child_name,
    dgl.DATA_GROUP AS child_data_group,
    dg_child.node_type AS child_type, f.TYPE AS facility_type
    FROM DATA_GROUP_LINK dgl, DATA_GROUP dg_child, FACILITY f
    WHERE dgl.DATA_GROUP = dg_child.DATA_GROUP
    AND dg_child.node_type = 'F'
    AND f.facility_num = dg_child.DATA_GROUP
         START WITH dgl.parent_data_group IN (
    (SELECT DATA_GROUP
    FROM DATA_GROUP_SYSTEM_USER
    WHERE system_user_num = 1000088400 AND is_active = 'Y'
    UNION
    SELECT 1016189 AS DATA_GROUP
    FROM DUAL))                              
    CONNECT BY NOCYCLE dgl.parent_data_group = dgl.DATA_GROUP
    We don't want to do any code changes in the query.
    Please let me know is there in solution in 10.2.0.4 to run this query with out any code changes.
    Thanks,
    Mahi

  • How to create new cost groups in inventory org using API or open interface?

    Hi,
    I would be very kind of you if you can provide me with a solution to my question below.
    I have a requirement of copying all the cost groups from one inventory org and creating the same cost groups in another inventory org using programmatically. Is there any API or Open interface that can be used to create the cost groups in the new inventory organization? If not can you suggest any other way of fulfilling this requirement?
    I would highly appreciate your help.
    Thanks,
    Ranajit

    hi,
    think, it's not possible.
    look here:
    http://help.sap.com/saphelp_47x200/helpdata/en/4f/71e05a448011d189f00000e81ddfac/frameset.htm
    "The field groups and their respective fields are defined in system tables"
    kind regards
    Andreas

  • End date the use of a certain subtemplate and call another in its place

    Hi All,
    How can we refer to multiple subtemplates so as to end date the use of certain subtemplate say on Dec 31 2007 and start referring to another subtemplate in its place from Jan 1 2008??
    Any pointers to the same will be extremely helpful.
    Thanks in advance.

    This work, but its hardcoded and not really flexible. You can also change the date format to compare whatever you want I guess. Hope it can help!
    <?import:file:///C:/sub_2007.rtf?>
    <?import:file:///C:/sub_2008.rtf?>
    <xsl:if test="xdoxslt:sysdate('YYYY')='2007'"><?call-template:sub_2007?></xsl:if>
    <xsl:if test="xdoxslt:sysdate('YYYY')='2008'"><?call-template:sub_2008?></xsl:if>

  • Inventory Management- Printing Physical Inventory Document using Smart Form

    Scenario: Inventory Management- Printing Physical Inventory Document using Smart Forms
    I could found out that there is no standard smart form linked to Transaction MI21(Program-RM07IDRU). There is a sapscript ((INVNET) assigned to this transaction, but my requirement is to assign customized smartform to this transaction.If it is not possible to assign smart form to pgm then is it possible to through enhancement.If yes then let me know the enhancement as there are lot of enhancement in the pgm RM07IDRU.
    If you have any solution then kindly mentioned it.
    Looking forward for kind help.
    Regards
    Amit

    Check out with your SD guy if the items in billing doc have correct pricing conditions triggered.
    From the description it looks like some customizing issue.
    Otherwise revert back with the logic how are you trying to get the net value of item.

  • Calculating Total Ending Inventory

    Hello BW Gurus,
    I have a reporting question for you. Please reply back as soon as possible as I am nearing the deadline.
    The scenario is as below:
    I need to calculate the Total Ending Inventory and the formula is as below:
    Total Ending Inventory = ‘A’ – ‘B’ – ‘C’ + ‘D’ + Last Period ‘Total Ending Inventory’
    How would I calculate the Last Period ‘Total Ending Inventory’? Total Ending Inventory is just a Calculation and is stored no where in BW.  Since I am running the report for the first time this month, Last period 'Total Ending Inventory' would be Zero for the current month. But current month's Total Ending Inventory would become next month's Last Period Total Ending Inventory. To acheive this, I need to store the Calculated Total Ending Inventory somewhere in BW so that I can pull this information when I am calculating next month's Total Ending Inventory.
    Please let me know the solution and the steps involved as soon as possible.
    Thank you very much in advance.
    Best Regards,
    Rajiv.

    Hi Anil,
    Thanks for your reply. The problem here is Total Ending Inventory is not a KF that is stored in a Cube. It is a calculated Key Figure. When I am calculating Total Ending Inventory I need to add last period's Total Ending Inventory to the calculation. Any idea on how to achieve this?
    Thanks in advance.
    Best REgards,
    Rajiv.

  • Inventory movement using logic script - BPC NW 10

    Hello BPC experts,
    I'm working on inventory movement using logic script. The idea is that the initial stock of the first period equals the final stock of the previous period.
    Here is an example of my inventory report : (Dimension INVT in function of dimension TIME)
                                                  2014.01       2014.02      2014.03        2014.04
    F01 Stock first period                  12            
    F02 Initial Stock                          12                 11              10                 9
    F03 Inventory Inputs                    2                   4                6                   8
    F04 Inventory Outputs                 3                   5                7                   9
    F05 Final Stock                          11                 10               9                   8
    The Stock of the first period is entered
    The initial Stock = Stock first period (12 in our case)
    Inventory inputs and Outputs are entered
    Final Stock = Initial Stock + Inventory Inputs - Inventory Outputs
    I tried the following script but it does not work :
    *XDIM_MEMBERSET TIME = 2014.01 //we should then retrieve the first period of each year which is not necessary the first month of the year
    *WHEN TIME
    *IS 2014.01
    *REC(EXPRESSION = [INVT].[F01], INVT = F02)
    *ENDWHEN
    *SELECT(%TIME_LIST%,"[ID]","TIME","[PREVMEMBER]"<>"") // PREVMEMBER is a property of TIME
    *XDIM_MEMBERSET TIME = %TIME_LIST%
    *XDIM_MEMBERSET INV = F05
    *WHEN TIME
    *IS %TIME_LIST%
    //Something is missing here.. How to retrieve F05 values related to all periods and copy them in F02
    *REC(EXPRESSION =[INVT].[F05],INVT = F02)
    *ENDWHEN
    Please how can I achieve this ?
    Thanks
    Maha

    Hi Vadim,
    Thank you for your reply
    I'm working with BPC NW 10 SP 05 (CPMBPC 801 SP 05), Engine ABAP
    My model contains the following dimensions ACCOUNT (A), TIME (T), CATEGORY (C), ENTITY (E), CURRENCY (R), INVT (User Def)
    In the INVT dimension we have members like (Stock first period, Initial Stock, Inventory Inputs, Inventory Outputs, Final Stock)
    - [INVT].[Stock first period] is entered
    - [INVT].[Initial Stock] = [INV].[Stock first period]
    - [INVT].[Inventory input] and [INVT].[Outputs] are entered
    - [INVT].[Final Stock] = [INVT].[Initial Stock] + [INVT].[Inventory Inputs] - [INVT].[Inventory Outputs]
    We want to calculate Initial Stock in DEFAULT.lgf :
    [INVT].[Initial Stock] when (TIME=2014.01) = [INVT].[Stock First Period] when (TIME= 2014.01)
    [INVT].[Initial Stock] when (TIME=2014.02) = [INVT].[Final Stock] when (TIME= 2014.01)
    [INVT].[Initial Stock] when (TIME=2014.03) = [INVT].[Final Stock]  when (TIME=2014.02)
    [INVT].[Initial Stock] when (TIME=2014.04) = [INVT].[Final Stock]  when (TIME=2014.03)
    When a user enters the values of "Stock first period", "Inventory Inputs" and "Inventory Outputs", Initial Stock and Final stock should be calculated via logic script
    Regards
    Maha

  • Was using prior to dinner and noticed 60% battery life.  do you have any idea what has happened or what needs to be done on my part?

    My ipad will not turn on, or rechage.  Was using prior to dinner and noticed a 60% battery use.  When plugged to charger it will not turn on.  Any ideas?  Was purchased in April 2013 as a new IPad.

    Frozen or unresponsive iPad
    Resolve these most common issues:
        •    Display remains black or blank
        •    Touch screen not responding
        •    Application unexpectedly closes or freezes
    http://www.apple.com/support/ipad/assistant/ipad/
    iPad Frozen, not responding, how to fix
    http://appletoolbox.com/2012/07/ipad-frozen-not-responding-how-to-fix/
    iPad Frozen? How to Force Quit an App, Reset or Restart Your iPad
    http://ipadacademy.com/2010/11/ipad-frozen-how-to-force-quit-an-app-reset-or-res tart-your-ipad
    Black or Blank Screen on iPad or iPhone
    http://appletoolbox.com/2012/10/black-or-blank-screen-on-ipad-or-iphone/
    What to Do When Your iPad Won't Turn On
    http://ipad.about.com/od/iPad_Troubleshooting/ss/What-To-Do-When-Your-Ipad-Wo-No t-Turn-On.htm
    iOS: Not responding or does not turn on
    http://support.apple.com/kb/TS3281
    iPad: Basic troubleshooting
    http://support.apple.com/kb/TS3274
    Not normal. Take it to an Apple Store for evaluation. You are still covered by Apple's 1-year warranty.
    Make a Genius Bar Reservation
    http://www.apple.com/retail/geniusbar/
     Cheers, Tom

  • End inventory and beginning inventory

    Hi all,
    how can i get the end and beginning inventories of a material, mlcd ckmlpr ckmlpp tables have some data regarding this issues but i want to know the how much of a ending inventory is of production and how much is of material etc.
    From which tables i can get this data?
    Thanks in advance.
    deniz.

    hi,
    thanks for reply,
    CKM3 is the trans code.
    i see the values i wanted there but i want to retrieve the same values for a report and dont know how to assign for example material costs, production costs or miscelanous costs.
    deniz.

  • Creating Physical Inventory Documents using batch job in WM

    We use transaction LX26 to create the physical inventory documents for the storage bins and the materials therein. and the new PI dates are proposed based on the cycle count indicators configured.
    We want to automate the creation of physical inventory documents using a batch job. How can we achieve this?
    I understand that the program RM07ICN1 generates PI documents only when materials are managed at IM levels and this does not work for WM. Is there any other standard program which can be set up in batch to create the PI documents for the materials at WM level? If there is something then please let me know details....
    Thanks,

    I entered following details,
    WH no.
    Storage Type
    Inventory in Period (One year date range)
    Inventory Count date (Today's date)
    The output in spool shows me the following,
    No of Records Passed ;Quant Information; InventoryProposal; Later / block; Bin Information; Empty bins; Inventory active
    The list of storage bin, material, description & inventory date is also displayed.
    Description has Scheudled and Overdue and the inventory date is some dates in next months.
    It doesnt show anywhere that inventory document is generated.Please note that I had not selected the Activate Inventory List check box because I just want the system to auto create the inventory documents based on the logic of cycle count indicators.

Maybe you are looking for