Inventory Value Query

Hello -- we currently use the below Query to view our Total Inventory Cost by Style. However, we recently added a few new items and those items do not show any in the Total Cost column.  Does anyone know why this would be the case?  Thanks!
SELECT Distinct SubString(t0.ItemCode,1,4) 'Style #', Sum(T0.InQty - T0.OutQty) 'Total Items', Sum(T0.InQty - T0.OutQty) *Avg(Case When T1.LastPurPrc = 0 then t2.AvgPrice else T1.LastPurPrc end) 'Total Cost', Avg(Case When T1.LastPurPrc = 0 then T2.avgprice else T1.LastPurPrc end) 'Most Recent Item Cost'
FROM OINM t0
Inner Join OITM T1 on T1.ItemCode =T0.ItemCode
Inner Join OITW T2 on T2.ItemCode = t0.ItemCode
WHERE T0.DocDate <= '[%0]' and T0.InQty != T0.OutQty
Group By SubString(t0.ItemCode,1,4)
Order By SubString(t0.ItemCode,1,4)
Mike

Suda and Gordon -
Answers to your questions below:
SELECT Distinct SubString(t0.ItemCode,1,4) 'Style #', Sum(T0.InQty - T0.OutQty) 'Total Items', Sum(T0.InQty - T0.OutQty) *Avg(Case When T1.LastPurPrc = 0 then t2.AvgPrice else T1.LastPurPrc end) 'Total Cost', Avg(Case When T1.LastPurPrc = 0 then T2.avgprice else T1.LastPurPrc end) 'Most Recent Item Cost'
FROM OINM t0
Inner Join OITM T1 on T1.ItemCode =T0.ItemCode
Inner Join OITW T2 on T2.ItemCode = t0.ItemCode
WHERE T0.DocDate <= '[%0]' and T0.InQty != T0.OutQty
Group By SubString(t0.ItemCode,1,4)
Order By SubString(t0.ItemCode,1,4)
The above query is what I currently use to find the total value of our existing inventory.  In the column labeled 'Total Cost' -- I do not see any values being pulled for 8 of our new styles that we introduced this year.  I am not clear why this is the case. 
Gordon - your query pulled several thousand line items / SKU's -- appears correct. 
Thanks!
Mike

Similar Messages

  • Inventory Valuation: Material Prices and Inventory Values Query

    I have been asked to install the cube 0COPC_C04 in BI.  The datasource that is recommened for this cube is 0CO_PC_ACT_04, but in R3 that datasource is not populated. 
    What is wanted is to have the price and value of inventory material in one report.  I can get the price from one datasource and the value from another, but the datasource that has the value information (from what I can find) 0CO_PC_ACT_02 only allows full loads and there are millions of records.
    I am fairly new at setting up extractors for use in BI and need to know if there is another datasource to use or a trick to getting the needed information into BI.

    No, my question has not been answered. 
    What I have done is use two different datasources and from the infopackage try to limit the data coming in to only the current fiscal year/period.
    My problem now is that the first data packages stay "yellow" because the data is not actually updated to the cube.  The last data package that come in turns "green".  In my code I need each data package that comes in to update the cube but I do not know what the code (from the infopackage) would be.
    I can not do this from the update rules because I actually need to limit the data as it comes into BI as there are millions of records.

  • Oracle Inventory: Inventory Value as on date Query

    Hi guys,
    We need to write a query to get inventory value based on a particular date, say '31-dec-2011' for certain auditing purposes. We can use historical transaction summary report for this purpose, however this report produces more than 800 pages for a single requirement.
    We were able to retrive the current inventory value using the following query
    SELECT SUM(moq.transaction_quantity*moq.item_cost) inv_cost
    FROM mtl_onhand_qty_cost_v moq
    WHERE organization_id = :p_org_id;
    Unfortunately none of our exercises from last couple of days fetch values anywhere near to the historical transaction summary report as on date inventory value for the above said cut off date.
    We tried the following query against mtl_material_transactions table
    Select sum(transaction_quanity*new_cost) inv_cost from mtl_material_transactions
    where organization_id = :p_org_id and
    trunc(transaction_date) > to_date(:p_date)+1 -- transaction value after '31-dec-2010' for example
    and then deducting value from second query from first query value...
    Please help
    Regards,
    raj

    Hi Sandeep
    I was able to run the API mentioned with before report trigger successfully, however cannot retrive any lines from cst_inv_qty_temp, cst_inv_cost_temp tables. I had gone through the API body and "assumes" this particular API repopulates the data each time when the report is submitted, identified by the unique session id.
    Would you comment?
    SET SERVEROUTPUT ON;
    Declare
    L_FCN_CURRENCY VARCHAR2(15);
    L_REPORT_NAME VARCHAR2(80);
    sql_stmt_num varchar2(5);
    l_exp_sub NUMBER;
    l_msg_count NUMBER;
    l_msg_data VARCHAR2(8000);
    l_return_status VARCHAR2(1);
    l_as_of_date VARCHAR2(30);
    l_cost number;
    wms_org_count NUMBER;
    pjm_org_count NUMBER;
    l_calculate_intransit NUMBER;
    l_cst_inv_val EXCEPTION;
    Begin
    BEGIN
    MO_GLOBAL.SET_POLICY_CONTEXT ('S', 111);
    END;
    CST_Inventory_PUB.Calculate_InventoryValue(
    p_api_version => 1.0,
    p_init_msg_list => CST_Utility_PUB.get_true,
    p_organization_id => 111,---:P_ORG_ID,
    p_onhand_value => 1,
    p_intransit_value => 1,
    p_receiving_value => 0,
    p_valuation_date =>to_date('2011/01/01 00:00:00','YYYY/MM/DD HH24:MI:SS'), -- to_date(:P_AS_OF_DATE,'YYYY/MM/DD HH24:MI:SS'),
    p_cost_type_id => NULL, --2, --:P_COST_TYPE_ID,
    p_item_from => NULL, --:P_ITEM_FROM,
    p_item_to => NULL, --:P_ITEM_TO,
    p_category_set_id => NULL, --:P_CATEGORY_SET,
    p_category_from => NULL, --:P_CAT_FROM,
    p_category_to => NULL, --:P_CAT_TO,
    p_cost_group_from => NULL,
    p_cost_group_to => NULL,
    p_subinventory_from => 'BBM-01', --:P_SUBINV_FROM,
    p_subinventory_to => 'BBM-01', NULL, :P_SUBINV_TO,
    p_qty_by_revision => 2, 'no'--:P_ITEM_REVISION,
    p_zero_cost_only => 2, 'no'--:P_ZERO_COST,
    p_zero_qty => 2, 'no' --:P_ZERO_QTY,
    p_expense_item => 2, 'no' -- :P_EXP_ITEM,
    p_expense_sub => 2, --'No', -- l_exp_sub,
    p_unvalued_txns => 2, --:P_UNCOSTED_TXN,
    p_receipt => 1,
    p_shipment => 1,
    x_return_status => l_return_status,
    x_msg_count => l_msg_count,
    x_msg_data => l_msg_data
    IF l_return_status <> CST_Utility_PUB.get_ret_sts_success
    THEN
    RAISE l_cst_inv_val;
    END IF;
    FND_MSG_PUB.count_and_get(
    p_encoded => CST_Utility_PUB.get_false,
    p_count => l_msg_count,
    p_data => l_msg_data
    IF(l_msg_count > 0)
    THEN
    FOR i in 1 ..l_msg_count
    LOOP
    l_msg_data := FND_MSG_PUB.get(i, CST_Utility_PUB.get_false);
    DBMS_OUTPUT.PUT_LINE(i ||'-'||l_msg_data);
    END LOOP;
    END IF;
    End;

  • Inventory Ageing query performance

    Hi All,
       I have created inventory ageing query on our custom cube which is replica of 0IC_C03. We have data from 2003 onwards. the performance of the query is very poor the system almost hangs. I tried to create aggregates to improve performance but its failed. What i should do to improve the performance and why the aggregate filling is failed. Cube have compressed data. Pls guide.
    Regards:
    Jitendra

    Inaddition to the above posts
    Check the below points ... and take action accordingly to increase the query performance.
    mainly check --Is the Cube data Compressed. it will increase the performance of the query..
    1)If exclusions exist, make sure they exist in the global filter area. Try to remove exclusions by subtracting out inclusions.
    2)Check code for all exit variables used in a report.
    3)Check the read mode for the query. recommended is H.
    4)If Alternative UOM solution is used, turn off query cache.
    5)Use Constant Selection instead of SUMCT and SUMGT within formulas.
    6)Check aggregation and exception aggregation on calculated key figures. Before aggregation is generally slower and should not be used unless explicitly needed.
    7)Check if large hierarchies are used and the entry hierarchy level is as deep as possible. This limits the levels of the hierarchy that must be processed.
    Use SE16 on the inclusion tables and use the List of Value feature on the column successor and predecessor to see which entry level of the hierarchy is used.
    8)Within the free characteristics, filter on the least granular objects first and make sure those come first in the order.
    9)If hierarchies are used, minimize the number of nodes to include in the query results. Including all nodes in the query results (even the ones that are not needed or blank) slows down the query processing.
    10)Check the user exits usage involved in OLAP run time?
    11)Use Constant Selection instead of SUMCT and SUMGT within formulas.
    12)
    Turn on the BW Statistics: RSA1, choose Tools -> BW statistics for InfoCubes(Choose OLAP and WHM for your relevant Cubes)
    To check the Query Performance problem
    Use ST03N -> BW System load values to recognize the problem. Use the number given in table 'Reporting - InfoCubes:Share of total time (s)' to check if one of the columns %OLAP, %DB, %Frontend shows a high number in all InfoCubes.
    You need to run ST03N in expert mode to get these values
    based on the analysis and the values taken from the above  - Check if an aggregate is suitable or setting OLAP etc.
    Edited by: prashanthk on Nov 26, 2010 9:17 AM

  • Cube for Inventory values, prices and quantity

    Hi,
    Does anybody knows some standard InfoCube that delivers Inventory values, prices and quantity?
    I need something like R/3 transaction CKM3 (Material Prices Analysis CO-ML). This transaction agregates inventory quantity, value ( material price) per material/plant, you could drill-down to material moviments level.
    I found a InfoCube named 0IC_C03 (Material Movements - see help link), but  i can't figure out how this cube works.
    http://help.sap.com/saphelp_nw04/helpdata/en/fb/64073c52619459e10000000a114084/frameset.htm
    Regards,
    Eduardo

    Hi Eduardo,
    Now, I am developing a new query, exactly in CKM3 format, but where you can see more than one material at once.
    I am using the infocube 0COPC_C07 (Actual Costing/Material Ledger), where I can see the same information as in CKM3 transaction.
    I hope this helps,
    Regards,
    Fernando.

  • Third party process as inventory value

    Dear Experts,
    Kindly need help for third party process.
    We have third party process which triggered from Sales Order. This Sales Order will automatically created PR. PR will be convert into PO.
    The issue is we would like to have goods in Sales Order (or Purchase Order in next process) as inventory value when receiving goods.
    Can third party process be treated as inventory value when receiving it?
    Thank you in advance.
    Best Regards,

    In third party process your customer gets the goods directly from your vendor.
    You only make a statistical GR ("phantom" GR) in the system, the goods are physically received by your customer and your customer's inventory will increase after your customer's GR and not yours. Knowing this your question doesn't make any sense I think.
    If your third party process is not a real third party process and you receive the goods physically and after that you sell it your customer you can use individual PO scenario.
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/dd/5601d4545a11d1a7020000e829fd11/frameset.htm
    Regards,
    Csaba

  • Error: ORA-01722: invalid number performing List of Values query.

    when i created a cascading select list, For the first time it worked properly then little later
    it is giving this error.
    Error: ORA-01722: invalid number performing List of Values query: "select distinct cl_name d, cl_no r from Kclient where gr_no = :P1_GRNO order by 1
    could any one please solve the problem?
    2. when i run the application. in all the items edit button is automatically seen
    including in the login screen.
    could any one identify what is the error and give me a solution.

    Is this better?
    select DISTINCT FIRST_NAME||' '||LAST_NAME display_value
          , ROW_ID return_value
      from "PSA_RESOURCE_MANAGER"
    where PSA_RESOURCE_MANAGER.ACTIVE_FLAG='Y'
       AND :P117_REPORTING_MANAGER = PSA_RESOURCE_MANAGER.REPORTING_MANAGER
       AND :P117_REPORTING_MANAGER <> -1 order by 1or
    select DISTINCT FIRST_NAME||' '||LAST_NAME display_value
          , ROW_ID return_value
      from "PSA_RESOURCE_MANAGER"
    where PSA_RESOURCE_MANAGER.ACTIVE_FLAG='Y'
       AND :P117_REPORTING_MANAGER = PSA_RESOURCE_MANAGER.REPORTING_MANAGER
       AND :P117_REPORTING_MANAGER != '-1' order by 1Is ROW_ID a column in your table by the way? If not, you should use ROWID (without the underscore)

  • ORA-01722: invalid number performing List of Values query

    I have a situation here where I want to pass string value(available in search field) to POP up key LOV on another page as default value.
    I passed item value in default field in POPup key LOV item.I am able to see string value but It also gave me following error.
    Error: ORA-01722: invalid number performing List of Values query: "select CUSTOMER_NAME, CUSTOMER_ID from (select customer_name, customer_id from hed_customers) wwvlovinlineviewname where CUSTOMER_ID = :WWV_LOV_RETURN_KEY_UTIL_1111".
    Without Default value, it work like champ.
    Please suggest how to get rid of this error
    Thanks in advance

    I hit the same problem.
    The thing is that, in APEX, a 'null' value in a form is not really null but gets passed on as '%'.
    When that gets compared to a number, 01722 will occur.
    A workaround is to define a 'value if null' that is an implicit number, like '-1'.
    And lets hope no one ever uses that as a real ID...
    Cheers
    Peter

  • Cost of Goods Sold and Inventory Value

    Hi
    I am looking to setup KPI for Inventory Turns in BI. This needs "Cost of Goods Sold" and "Inventory Value" for Orders for a Plant.
    I wanted to know if this information is directly available in any standard extract or do I need to write a Custom Extract for this. I did try searching for this but not able to find this information directly. Do I need to derive the information from some other Key Figures?
    TIA
    Abhishek

    COGS Value we are getting for the COGS GL Account from FIGL. We are using the extract 0FI_GL_4 and then from the DSO 0FIGL_O02
    Inventory value we are taking from the Cube 0IC_C03. Please note that the Transformations to the DataSource 2LIS_03_BX, 2LIS_03_BF and 2LIS_03_UM are available in the latest Patch 11 for BI Content 703 and should be used instead of the old Transfer Rule/Update Rule.
    Regrads
    Abhishek

  • INVENTORY INFO - QUERY

    We have inventory at following locations:
    1) Plant
    2) Subcontractors
    3) Storage
    4) In Transit
    How can I create a report which will show me where inventory is and how much it is worth and be able to go back in time and find out where this inventory was?
    Really stuck in a bad jam here so any feedback is appreciated.....
    Thank you

    Hi,
    To ge the Inventory info, In Material Master, We have view called Plant Stock. In this view you can get the stock of that particular material in that plant/ Storage Location. The corresponding table is MARD.
    Now Another view in accounting, you have Moving avg.Price/ Std. Price. Multiply the amount and the quantity at that plant/ Storage location. Then you will get the inventory value of that particular material.
    In the case of subcontracting, Pick up the material documents with the movement type 541(there should not be 101 movement type document for this 541)  and  Sum up them and multiply with price of the material.
    Find the T.codes  MMBE Or MB5T For more clarifications.
    Regards,

  • Inventory value increase

    Hi,
    (Initially wrongly posted this in BI and hence repeating here)
    Is there any way I can post a transaction to increase the inventory value ?
    We have a requirement.
    After the product is manufactured it (Wine)
    is kept in warehouse for curing purpose . ( Temp on and off at cost including handling charges)
    The curing cost is paid every week.
    The cost has to be increased to the inventory cost instead of keeping under expenses.
    ie These are charges are to be capitalized .
    End of it every Day Ithe system should pasa accounting as
    Dr Inventory
    Cr accrual
    End of the week on paymnet to vendor by ivoice payment
    Dr accrual
    Cr vendor
    How do I push the expenses to Inventory ?
    Thanks in advance
    Chitras

    Thanks Guys. I was on vacation for 3 weeks .
    My doubt is how to handle the requirement of adding the warehouse charges on weekly basis to the price of the FG so the inventoy price has to go up on weekly intervals.
    What should be the best approach.
    is it that Every wek change the price by MR21 or any other  alternate apprioach available
    Thanks, Chitras

  • Increase in Inventory value of raw material after PO stage & MIRO

    Is it possible to increase the inventory value of a raw material after PO is finalized and MIRO doc. has been raised.
    I want to increase the inventory value by additional expenses after PO & MIRO are done.
    Regards,

    Hi,
    It is possible through the concept of 'Subsequent Debits/ Credits'. A subsequent debit/credit exists when an additional invoice or credit memo is received for a transaction that has already been invoiced.
    Before using the same, you should note the following:
    - The system records every subsequent debit/credit in the purchase order history.
    - By posting a subsequent debit/credit, the system updates the ordering transaction on a value basis but not on a quantity basis. The quantity invoiced therefore does not change, but the total value invoiced does.
    - The maximum quantity you can subsequently debit or credit is the quantity that has already been invoiced. It is not possible to post a subsequent debit before an invoice. The system does not check the quantity delivered. A subsequent debit/credit cannot be blocked due to quantity variance.
    Regards,
    Narayana G.

  • Increase in inventory value

    Huge increase in my inventory value, what should be the solution given to the client as an MM consultant.

    you should analyze why the value increased.
    It is totally unclear if you are talking about the overall value, which could be caused by physical effects of having more stock than ever in your warehouse, so you need to optimize this case.
    But if you are talking about one material which got a huge value while the stock level did not really change on exceptional basis, then you should analyze your accpounting documents to a material and its values in MR51.
    There you should find   when it started to increase the value.
    Which may be caused by a wrong price in a PO (could have been corrected after GR, so check change history of order as well)

  • BUG? ORA-01461 in Unit Tester when saving a long Dynamic Value Query

    I get an ORA-01461 "can bind a LONG value only for insert into a LONG column" error when saving a Test Implementation with a Dynamic Value Query whose length of the SQL statement is roughly 2,000 characters - I'm UNIONing ALL about 30 test case values together, but it seems to be choking on such a long SQL string for some reason....
    I am running version Early Adopter Release #2 (2.1.0.63), build MAIN-63.10.
    Thoughts?

    Confirmed.
    Bug 9119144: ORA-01461 IN UNIT TESTER WHEN SAVING A LONG DYNAMIC VALUE QUERY (OR OTHER CLOB)
    Brian Jeffries
    SQL Developer Team

  • GL trial balance and All inventory value reports

    Hi,
    in oracle applications 11i the inventory super user claims that the results of the following two reports:
    GL trial balance
    and
    All inventory value report
    for the period MAY-09 DO NOT match.
    How can i investigate this issue?

    I haven't worked on PPAC but I assume its only a cost method to build the cost. Once costs are build GL entry happens in the same way.
    You said that you first freeze the cost and then run subledger update report.
    Once you freeze the cost, what cost do you see for product x?
    Once you produce 20 TONS output; subledger update should generate entry as follows:
    Cr WIP: cost*20
    Dr INV: cost*20
    Now you mentioned about title ALC (GL Allocation). I haven't seen that title.
    Also at the period end we need to run revaluation of inventory for STND method, I am not sure if the same is required for PPAC. Try performing that in test instance to see accounting entries generated.
    I am sorry if I confused you or didn't understand your question. I have used mostly worked with STND method and just trying to extend my experience with PPAC.

Maybe you are looking for

  • How do I transfer my iTune to another computer?

    Usually for Apple products, it can only sync to one library at a time. If you tried to sync it to another library, it would only allow you if you erase all the contents on your item (iPhone in my case) to replace it with the contents on the other iTu

  • How to add a folder to jar

    Hi, I would like to know how to add a folder so that when extracted the file structure is maintained. Thanx in advance -Dani.

  • If conditions in a query

    Hi All If any one has used if conditions (Boolean operators) in a query designer please assist me. Following is my requirement I have a char-A which is EQ 'AB', based on this i should calculate the formula as in IF CHAR-A = 'AB'.   KEYFIGURE4 = (KEYF

  • AVI clips being vertically rescaled when preview rendered

    I'm using Premiere Pro CS5, to complete a 2400*600 triplhead2go composition. I set it up Desktop, 2400*600, square pixels, 25fps & previews at the same res. All of the source clips are from After Effects (800*600, square pixels, uncompressed avi) and

  • Incopy / Indesign workflow

    To Incopy / Indesign users Would anyone recommend a CS6 / CC workflow which includes Incopy and Indesign. Regards Vividi