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;

Similar Messages

  • Can not change the control level of item attribute "Inventory Asset Value"

    I can not change the control level of the item attribute "Inventory Asset Value" from Master Level to Org Level. It's show me the message "FRM-40200: Field is protected against update".
    Version is below:
    Oracle Application: 10.7SC
    Form: INVIDCTL 6.0.26

    I did a trace when I chage the control level. the SQL is below:
    SELECT COUNT(*)
    FROM CST_ITEM_COSTS CHILD
    , CST_ITEM_COSTS MASTER
    WHERE MASTER.INVENTORY_ITEM_ID = CHILD.INVENTORY_ITEM_ID (+)
    AND MASTER.COST_TYPE_ID = 1
    AND CHILD.COST_TYPE_ID (+) = 1
    AND NVL(MASTER.ITEM_COST,0) != NVL(CHILD.ITEM_COST (+) ,DECODE(MASTER.ITEM_COST, NULL ,0,-99999))
    AND MASTER.ORGANIZATION_ID IN (SELECT MASTER_ORGANIZATION_ID
    FROM MTL_PARAMETERS
    WHERE ORGANIZATION_ID != MASTER_ORGANIZATION_ID )
    AND CHILD.ORGANIZATION_ID IN (SELECT ORGANIZATION_ID
    FROM MTL_PARAMETERS
    WHERE MASTER_ORGANIZATION_ID = MASTER.ORGANIZATION_ID )

  • To customize Inventory Summary Value Report

    Hi
    I want to update the Inventory Summary Value Report to add another value in the parameter region.
    Pls help!

    I assume you want a new parameter.
    For that, you will have to customize the report.
    1) In the custom report, add the new parameter and the logic to use the new parameter.
    2) Copy the report to the server
    3) Create new conc. executable and program.
    4) Assign the new program to a request group.
    Now you can run the new report with the additional parameter.
    See http://oracle.anilpassi.com/customization-of-reports-in-oracle-apps.html for detailed steps.
    Sandeep Gandhi

  • Inventory Report Based On Posting Date

    Hai All
    Can any one help me with the subject "Inventory Report Based On Posting Date"
    Please
    with regards
    Shankar

    hi,
    Visit this link,already answered.
    Difference between posting & system date in Inventory Audit Report
    Jeyakanthan

  • All master data values not shown in query selections

    Hi
    I have created a query on a BasisCube containing the InfoObject 0FUNC_AREA. I loaded data to 0FUNC_AREA and the cube.
    I then created a query on the cube, in which I want to filter on 0FUNC_AREA. However, when I get the list of available values for 0FUNC_AREA not all the values in the master data is shown. It only shows 25 values out of 105.
    As a default, the data shown is only the cube data, so I removed the tick in the checkbox: Show only InfoCube data. Still the same.
    Then I went to the InfoObject and set the 'Query Def. Filter Value Selection' and 'Query Execution Filter Val. Selectn' equal to 'Values in Master Data'. Still the same.
    Then I deleted the contents of the InfoCube. It still shows the original 25 values.
    The really strange thing is, that when I go into the selection screen for 0FUNC_AREA in the BEx and limit the shown values to one of the values available in the master data but not shown in the list, it shows the text of the functional area in the limit summary window. But still when executing the limitation, it cannot find the value!!!
    The problem is the same in LISTCUBE
    I hope some of you can help we with this.
    Thanks
    /Karsten

    Hi Hari
    1) Reactivated the master data, said it was already active.
    2) Could see a difference between the data contained in cube and the remaining data. Otherwise not.
    I deleted cube and master data and reloaded, the problem still persists. I am beginning to suspect a bug in BW.
    I have to determine whether I am going to live with it (as it isn't critical, just a nuisance) or create an OSS on it.
    Thanks for all the input guys.
    /Karsten

  • Creating Requisition for items, with no  "Inventory Asset Value"

    Is it possible to create the Internal Requisition for items for which inventory asset value flag is disabled.
    the requirement is that the item should be stockable, inventory, transactable but no asset value has to be calculated.
    If I disable the flag the cost manager is unable to update the cost price after receiving in store,
    and if there is no cost value then how can i create internal requisition.
    Thanks in advance.

    Dear Arif and PS,
    Thanks for the response.
    You are correct that the costing manager will not calculate the cost price if the flag is disabled, now the requirement is we want to take in the items through PO at central org and distribute to other org's where they can consume this item, and we want to track the quantity and also it should effect the accounts, and item should not present in inventory value report.
    Do we have any option for this scenario.
    Regards,
    Ahmed.

  • Comps.xml in Oracle 8i inventory on Windows systems

    "comps.xml" file listing the Oracle installed components along with their details is usually found in the Oracle inventory directory (%ORACLE_HOME%\Inventory\ContentsXML\comps.xml). But I noticed on a few Oracle 8i database installations that the file is missing.
    Is this file not part of the Oracle 8i inventory or has a different name?
    Note: This file is present on Oracle 9i and 10g database installations.
    Thanks,
    Vijay

    I don't recall having seen a comps.xml in 8i installations (may be some other configuration can have it). In 8i, it was the .SER files under inventory/contents folder (I guess :-)).

  • When u install oracle where the oracle installation inventory information s

    when u install oracle where the oracle installation inventory information store in unix and windows . can we change location of this

    Again 'u' doesn't appear in any English dictionary.
    Assuming you are not a royal, can you please stop using the so-called 'majestic plural'.
    Why do you need to change the location?
    If you want to change to location: people here aren't get paid to abstract the installation manual on your behalf.
    If you can't be bothered to read it, please don't use Oracle.
    Sybrand Bakker
    Senior Oracle DBA

  • How to Get Default Value of a Data Type in SQL Query.

    Hi all,
    I am creating a procedure which will take input the table name and Column Name.
    In the Output i would like to have the data type and default value of that data type which will be used by a another procedure to blank the selected column in the database.
    I tried with SET NULL on the column but as the database is of navision the table have property set to NOT NULL.
    Here is what i have done till now.
    Create Procedure Get_Column_type
    @parm_table_name nvarchar(200),
    @parm_column_name nvarchar(20),
    @parm_result nvarchar(20)OUTPUT
    AS
    BEGIN 
    select @parm_result =
    DATA_TYPE from INFORMATION_SCHEMA.COLUMNS IC
    where TABLE_NAME = '[' + @parm_table_name +']' and COLUMN_NAME = '[' + @parm_column_name + ']'
    END
    GO
    Now instead on write a case statement for so many data types in SQL, i was thinking is it possible someway that above procedure also returns the default value which i can set in another procedure.
    Let me know if its possible or not? Thanks in advance.

    Do you looking for something like this?
    create table t10 ( c int default 1)
    SELECT so.name AS table_name, 
              sc.name AS column_name, 
              sm.text AS default_value
         FROM sys.sysobjects so
         JOIN sys.syscolumns sc ON sc.id = so.id
    LEFT JOIN sys.syscomments SM ON sm.id = sc.cdefault
        WHERE so.xtype = 'U' 
          AND SO.name = 't10'
     ORDER BY so.[name], sc.colid
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • How to access filled in values of an af:query component

    Hi,
    I have a viewobject with a viewcriteria defined on it. The results are showed in a result table. When a user selects a row from the result table a new page is showed with detail data. In that page i would like to show the user the filled in attributes with their values to remember the user to which search criteria the results correspond. How can i access the attributes with their values of a af:query component?
    Kind Regards,
    Andre

    Hi Andre,
    maybe you can try Frank's approach: http://www.oracle.com/technology/products/jdev/tips/fnimphius/AdfCodingQuickies.html
    I just tested for RichInputText:
        public String cb1_click() {
            parseQuery(query1);
            return null;
        private void parseQuery(UIComponent component){
          List<UIComponent> list = component.getChildren();       
            for (UIComponent com : list){          
             if (!(com instanceof RichInputText)){
               parseQuery(com);
             else{
                if (((RichInputText)com).getValue() != null) System.out.println( ((RichInputText)com).getId() + " : " + ((RichInputText)com).getValue() );
        }but the problem is with getLabel() - it will return null
    regards,
    Branislav

  • Value Set whose Data come from customize table with distinct record

    Dear All,
    I am new in Oracle EBS, currently i am creating value set whose data come from customize table which have 40 duplicate record in which distinct column return 27 record .
    Table XX_ROUND_SET
    Columns (Transactions_id,set_record)
    Total Record (40)
    Distinct Record (Set_Record --> 27)
    I just want to show only 27 record in it.
    Thanks
    Rehan

    Hi Rehan,
    PL.IGNORE MY EARLIER UPDATE AND TREAT THIS UPDATE AS YOUR SOLUTION.
    Method 1
    Create the VIEW based on DISTINCT values; use the VIEW for creates the VALUESET.
    Method 2
    Paste the QUERY in TABLE field with alias name, and give the column name (with alias name).
    (in your case )
    TABLE NAME : ( select distinct transactions_id, set_record from XX_ROUND_SET ) Y
    VALUE : Y.transactions_id
    HTH
    Sanjay

  • Date Query for SimpleDateFormat

    HI,
    I’m trying to create a Toplink query for Date. Toplink always generates the date query in the following format for my Oracle DB:
    1.     If I pass the value new Date() in then it generates
    to_date('2005-01-05 30368','yyyy-mm-dd sssss')
    2.     If I use SimpleDateFormat with the format “yyyy/mm/dd" it creates
    to_date('2007-07-05 0','yyyy-mm-dd sssss')
    What is the value that comes after the day (30368 and 0) in each query?
    How can I make the Toplink to generate date without the time component? Preferably if there is a way for toplink to generate the date based on the Java SimpleDateFormat that would be good.
    Thanks
    -Mani

    The DATE type in Oracle stores both a date and time. The 0/30368 is the time in seconds sssss, 0 means no time. You should not have any issue with this format, what are you trying to do?

  • How to display first row value returened from a query as checked as default in a report

    How to display first row value returned from a query as checked as default in a report
    Example
    Parameter 1
    Paramerter2
    ABD
    x(checked)
    Test
    DEF
    JMG
    Mudassar

    Hi Mudassar,
    The issue is caused by the order in which the parameters appear in the report data tab can be difference between our report execution and it failing. In other words, “Parameter2” is execution before parameter “A” due to this issue. We can adjust the parameter’s
    order to solve the issue.
    If “Parameter2” is parameter “A”, we cannot use that expression. Because fields cannot be used in report parameter expression, if we want to display the first value returned from a query as default value, we have to fill the “Specify values” text box with
    the specific value in Default Values dialog box.
    Regards,
    Alisa Tang
    Alisa Tang
    TechNet Community Support

  • Stock Value on Posting Date

    Hi SAPians,
    I can get Stock Quantity on Posting Date from report MB5B.
    Is there any Report which can give me Stock Value on Posting Date?
    I have searched a lot but yet not found it.
    Please help in this regard.
    regards,
    Jignesh

    Thanks a lot friends for your answers.
    i have execute report and analyzed it but i have one query.
    If i am executing report for 31.03.2008.
    The shown material Stock Value on 31.03.2008 is on the basis of MAP at 31.03.2008 or on the basis of MAP at Current Date.?
    Thanks in advance.
    Regards,
    Jignesh

  • Passing multiple values to a BI query

    Hi experts,
    This question has probably been asked a few times, but I have an issue with passing multiple values to a BI query.  Here's the scenario....
    1)  I have created a BI query.  When I test the query in VC I can enter values 1000:1100 in the Infoobject Business Area and I see that the values are passed through OK
    2)  Then I created a form where Business Area is an Input Field
    3)  I linked the form to the BI query and assigned value @Business_area
    3)  A table is linked to the BI query to view my result ( I have set a distinct before my table to view the data by fiscal year period)
    4) When running the VC model, the table show values for 1000 and 1100, but when I enter 1000:1100 and Submit it does not show both the business areas
    There must be something I am missing and I thought it was that in my submit string (between the input form and the BI query) that I should fill in some values (instad of @Business_area). I tried to fill in 1000:1100, but then I get an error saying Invalid time 1000:1100.
    I would really appreciate any help on this issue :-).
    Regards,
    Thomas

    Hi Thomas,
    I wish to enter default values for dates onto the VC form. Ie I have a VC report to display a customer's shipped data. Ship date is a selection field/ input field on the form for the report/ output table.
    At present if a user clicks submit they get all their shipped records from the beginning of time till today. How can I restrict the dates at VC level to past  3months? So if the users don't specify a ship date, they get the past 3 months data, and afterwards they can change it an retrieve all the data or past 2 years as they wish.
    Thanks,
    Jasmine

Maybe you are looking for