Inventory_item_id in msc_system_items

Can anyone tell me what inventory_item_id in msc_system_items represents?
I know that sr_inventory_item_id is the same value as inventory_item_id in mtl_system_items_b
Thanks in advance

Hello,
Normally an item having the atp_flag enabled is sufficient to have it collected in to msc_system_items.
it should be inthere for plan_id = -1.
if it isn''t then look at the source snapshot MTL_SYS_ITEMS_SN. If that doesn't contain it, there is a problem with the snapshot (could be corrupt). If that's the case, just drop and recreate it using the Drop snapshots request and the Create INV snapshots request.
basically, when the snapshot pull all items which satisfy the conditions below.
FROM inv.mtl_system_items_b msik
WHERE ( ( ( msik.mrp_planning_code IS NOT NULL
AND msik.mrp_planning_code <> 6
OR (msik.pick_components_flag = 'Y' OR msik.bom_item_type = 3)
AND (msik.inventory_item_flag = 'Y' OR msik.eng_item_flag = 'Y')
AND msik.planning_make_buy_code IN (1, 2)
AND msik.primary_uom_code IS NOT NULL
OR msik.atp_flag <> 'N'
OR msik.atp_components_flag <> 'N'
OR msik.drp_planned_flag = 1
OR msik.equipment_type = 1
OR msik.eam_item_type IS NOT NULL
best regards
Geert

Similar Messages

  • IProcurement : Relation between STORE_ID and INVENTORY_ITEM_ID

    Hi Friends,
    I am trying to create a custom search page in iProcurement module which will do the similar search as of Shop->Stores->Search option. Only difference is this search result region will contain one addition item 'PO Description'.
    I have added this addition field in the VO query, but facing issue while Joining STORE_ID with ICX_CAT_ITEMS_CTX_HDRS_TLP table. I am not finding any direct relationship between ICX_CAT_SHOP_STORES_VL.STORE_ID and ICX_CAT_ITEMS_CTX_HDRS_TLP.INVENTORY_ITEM_ID.
    We are using the following query for fetching the items from Main Stores (STORE_ID = 1).
    SELECT distinct nvl(avtlp.description, bq.description) DESCRIPTION,
    bq.ip_category_name SHOPPING_CATEGORY,
    pvs.vendor_site_code SUPPLIER_SITE,
    msikfv.concatenated_segments INTERNAL_ITEM_NUM,
    avtlp.manufacturer MANUFACTURER,
    bq.unit_price PRICE,
    bq.supplier SUPPLIER,
    DECODE(bq.source_type,'TEMPLATE',decode(least(length(bq.req_template_name),20),20,substr(bq.req_template_name,1,17) ||'...',bq.req_template_name),'INTERNAL_TEMPLATE',decode(least(length(bq.req_template_name) , 20),20,substr(bq.req_template_name,1,17) ||'...',bq.req_template_name),'QUOTATION',ICX_CAT_UTIL_PVT.get_message('ICX_CAT_QUOTATION_SOURCE','NUMBER',bq.document_number) ,'BLANKET',ICX_CAT_UTIL_PVT.get_message('ICX_CAT_BLANKET_SOURCE','NUMBER',bq.document_number),'GLOBAL_BLANKET',ICX_CAT_UTIL_PVT.get_message('ICX_CAT_BLANKET_SOURCE','NUMBER',bq.document_number), null) SOURCE,
    bq.inventory_item_id ItemId,
    nvl(bq.suggested_quantity, 1) Quantity,
    pha.COMMENTS, msikfv.organization_id
    , get_store.store_id
    FROM
    icx_cat_items_ctx_hdrs_tlp bq,
    po_system_parameters_all psp,
    mtl_units_of_measure_tl muomtl,
    icx_cat_attribute_values av,
    icx_cat_attribute_values_tlp avtlp,
    po_vendor_sites_all pvs,
    mtl_categories_kfv mck,
    mtl_system_items_kfv msikfv,
    po_headers_all pha
    (SELECT 1 store_id -- for Main Store
    , NULL supplier_id
    , NULL supplier_site_id
    , NULL category_id
    FROM DUAL) get_store
    WHERE (bq.source_type <> 'MASTER_ITEM')
    AND psp.org_id = :ORG_ID_KEY2
    AND bq.unit_meas_lookup_code = muomtl.unit_of_measure(+)
    AND bq.language = muomtl.language(+)
    AND bq.inventory_item_id = av.inventory_item_id(+)
    AND bq.owning_org_id = av.org_id(+)
    AND bq.po_line_id = av.po_line_id(+)
    AND bq.req_template_name = av.req_template_name(+)
    AND bq.req_template_line_num = av.req_template_line_num(+)
    AND bq.inventory_item_id = avtlp.inventory_item_id(+)
    AND bq.owning_org_id = avtlp.org_id(+)
    AND bq.po_line_id = avtlp.po_line_id(+)
    AND bq.req_template_name = avtlp.req_template_name(+)
    AND bq.req_template_line_num = avtlp.req_template_line_num(+)
    AND bq.language = avtlp.language(+)
    AND bq.supplier_site_id = pvs.vendor_site_id(+)
    AND bq.po_category_id = mck.category_id(+)
    AND (bq.supplier_site_id = get_store.supplier_site_id OR get_store.supplier_site_id is NULL )
    AND (bq.po_category_id = get_store.category_id OR get_store.category_id is NULL)
    AND (get_store.supplier_id is null or get_store.supplier_id =bq.supplier_id)
    AND bq.inventory_item_id = msikfv.inventory_item_id(+)
    AND msikfv.organization_id(+) = :INV_ORG_ID_KEY1
    and bq.po_header_id=pha.po_header_id(+)
    and get_store.store_id = :STORE_ID
    AND msikfv.concatenated_segments like '1235%'
    But this query is not returning the correct no of records.
    Any kind of new thought will be truly appreciated.
    Message was edited by:
    Tapas Banerjee

    there schema is bit changed
    check out Note:602896.1:How Has The iProcurement Catalog Data Model Changed In Release 12

  • Why Select inventory_item_id = '9297' but return both 9297 and 9296

    Hello Guy. Please help me. I 'm not a programmer or dba ,but I sure that my query is correct.The result is very strange.
    First I think my toad is error then I try this on sqlplus ,the result is same.
    1 SELECT INVENTORY_ITEM_ID,ORGANIZATION_ID,TRANSACTION_ACTION_ID
    2 FROM MTL_MATERIAL_TRANSACTIONS
    3 WHERE INVENTORY_ITEM_ID = '6297'
    4* AND ORGANIZATION_ID = '207'
    SQL> /
    INVENTORY_ITEM_ID ORGANIZATION_ID TRANSACTION_ACTION_ID
    6296 109 1
    6296 109 1
    6296 109 1
    6296 109 1
    6296 109 27
    6296 109 1
    6297 108 2
    6297 108 2
    6297 108 1

    user8899951 wrote:
    Hello Guy. Please help me. I 'm not a programmer or dba ,but I sure that my query is correct.The result is very strange.
    First I think my toad is error then I try this on sqlplus ,the result is same.
    1 SELECT INVENTORY_ITEM_ID,ORGANIZATION_ID,TRANSACTION_ACTION_ID
    2 FROM MTL_MATERIAL_TRANSACTIONS
    3 WHERE INVENTORY_ITEM_ID = '6297'
    4* AND ORGANIZATION_ID = '207'
    SQL> /
    INVENTORY_ITEM_ID ORGANIZATION_ID TRANSACTION_ACTION_ID
    6296 109 1
    6296 109 1
    6296 109 1
    6296 109 1
    6296 109 27
    6296 109 1
    6297 108 2
    6297 108 2
    6297 108 1But you're not worried that the organization_id is not the one you asked for ?
    It's very rare, but Oracle indexes can get corrupted in a way that leaves them out of synch with their tables.
    Unless you suspect something subtle and devious is going on the simplest explanation is that you've hit a problem like this.
    There is a command to check that a table and its indexes are consistent, but it locks the table while it's running.
    Off the top of my head it's: 'analyze table XXX validate structure cascade;' but you ought to check the analyze command.
    Before you lock the table, though, you might try running the query with sql_trace enabled to see if anything unusual appears in the trace file.
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk
    To post code, statspack/AWR report, execution plans or trace files, start and end the section with the tag {noformat}{noformat} (lowercase, curly brackets, no spaces) so that the text appears in fixed format.
    There is a +"Preview"+ tab at the top of the text entry panel. Use this to check what your message will look like before you post the message. If it looks a complete mess you're unlikely to get a response. (Click on the +"Plain text"+ tab if you want to edit the text to tidy it up.)
    +"I believe in evidence. I believe in observation, measurement, and reasoning, confirmed by independent observers. I'll believe anything, no matter how wild and ridiculous, if there is evidence for it. The wilder and more ridiculous something is, however, the firmer and more solid the evidence will have to be."+
    Isaac Asimov                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Material Transaction Open Interface Error

    Hi,
    I'm getting following Error in Cost Manager after running the Transaction Open Interface,
    Interface work well to update the stocks, but it returns error Layer Cost Worker Concurrent.
    Error1
    Bills of Material: Version : 12.0.0
    Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
    CMCLCW module: Layer Cost Worker
    Current system time is 10-OCT-2012 14:16:32
    debug_level = 0
    CM_EXTENDED_DEBUG = 2
    CSTPLCIN.COST_INV_TXN:CSTPLVCP.interorg (160): ORA-00001: unique constraint (INV.MTL_CST_TXN_COST_DETAILS_U1) violated
    Failing Transaction ID is 28227
    Start of log messages from FND_FILE
    Standard costing org : -1
    Interorg transfer send org: (consume layers) ...
    84:5
    28227:1
    Entering get_layers_consumed for transaction 28227 and a required quantity of 2 with a consumption mode of NORMAL
    Trying custom layers
    There are 0 custom layers
    General consumption
    Using SQL SELECT inv_layer_id,layer_quantity FROM cst_inv_layers WHERE layer_id = :i AND inv_layer_id <> :j AND NVL(transaction_source_id,-2) <> :k AND layer_quantity > 0 ORDER BY creation_date, inv_layer_id with 1,-1,-1
    End of log messages from FND_FILE
    No completion options were requested.
    Output is not being printed because:
    The print option has been disabled for this report.
    Deleting output file.
    Concurrent request completed
    Current system time is 10-OCT-2012 14:16:32
    Error2
    Bills of Material: Version : 12.0.0
    Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
    CMCLCW module: Layer Cost Worker
    Current system time is 10-OCT-2012 14:16:32
    debug_level = 0
    CM_EXTENDED_DEBUG = 2
    CSTPLCIN.COST_INV_TXN:CSTPACDP.insert_account (10) ORA-01400: cannot insert NULL into ("INV"."MTL_TRANSACTION_ACCOUNTS"."BASE_TRANSACTION_VALUE")
    Failing Transaction ID is 28228
    Start of log messages from FND_FILE
    Standard costing org : -1
    ----------l_to_method---------
    =5
    Interorg transfer receiving org: (create layers) ...
    90:5
    28228:2
    i_txn_id 28228
    1 records updated in mclacd for 15005
    1 records copied from mclacd for 15005
    interorg_cost_txn(..)
    transaction_id:28228
    org_id:90
    i_txn_org_id:90
    i_txf_org_id:84
    i_txf_txn_id:28227
    i_exp_item:0
    i_fob_point:0
    l_snd_rcv:2
    l_from_org:84
    l_to_org:90
    Sending org distributions
    Receiving org distributions
    l_intransit:0
    Calling Inventory acct
    In Inventory_accounts
    In insert accounts
    l_ussgl_tc :
    Payable amount(l_value): acct: 414240
    In insert accounts
    l_ussgl_tc :
    DS - others Exception, sqlcode = -1400
    End of log messages from FND_FILE
    No completion options were requested.
    Output is not being printed because:
    The print option has been disabled for this report.
    Deleting output file.
    Concurrent request completed
    Current system time is 10-OCT-2012 14:16:32
    My Coding
    insert into mtl_transactions_interface
    (transaction_type_id, --------------1
    transaction_uom, --------------2
    transaction_date, --------------3
    organization_id, --------------4
    transaction_quantity, --------------5
    last_update_date, --------------6
    last_updated_by, --------------7
    creation_date, --------------8
    created_by, --------------9
    transaction_mode, --------------10
    process_flag, --------------11
    source_header_id, --------------12
    source_line_id, --------------13
    source_code, --------------14
    transaction_header_id, --------------15
    inventory_item_id, --------------16
    transaction_interface_id, --------------17
    subinventory_code, --------------18
    distribution_account_id, --------------19
    transaction_cost, --------------20
    transaction_reference, --------------21
    transfer_organization, --------------22
    transfer_subinventory, --------------23
    -- transfer_cost, --------------24
    primary_quantity, --------------25
    lock_flag,
    transaction_action_id,
    transaction_source_type_id,
    dst_segment1,
    dst_segment2,
    dst_segment3,
    dst_segment4,
    dst_segment5,
    dst_segment6)
    values
    (v_trx_type_id, --------------1 ------transaction type id
    i.uom_code, --------------2 ------transaction_UoM
    sysdate, i.creation_date, ------------3 ------trasnsaction date
    i.from_organization_id, --------------4 ------org id
    nvl(i.quantity_delivered, i.quantity), --------------5 ------quantity
    sysdate, --------------6 ------Last update date
    -1, --------------7 ------last updated by
    sysdate, --------------8 ------creation date
    -1, --------------9 ------creation by
    3, --------------10 ------transactio mode
    1, --------------11 ------process flag
    1, --------------12 ------source_header_id
    1, --------------13 ------source_line_id
    i.mrn_trx_number, --'MRN Interface', --------------14 ------source code
    '999999', --------------15 ------transaction header id
    v_item_id, --------------16 ------inventory item id
    xx_mrn_mtl_trx_int_seq.nextval, --------------17 ------transaction_interface_id
    i.from_subinventory_code, --------------18 ------sub inventory
    v_code_id, --------------19 ------code compbination
    v_item_cost, --------------20 ------cost
    'MRN Interface', --------------21 ------reference
    i.organization_id, --------------22
    i.to_subinventory_code, --------------23
    -- (nvl(i.quantity_delivered, i.quantity) * v_item_cost) --------------24
    nvl(i.quantity_delivered, i.quantity),
    2,
    v_trx_action_id,
    v_trx_source_type_id,
                   '01',
                   '00',
                   '000',
                   '141013',
                   '000000',
                   '00000');
    Thanks

    Can you get the following for the errored transaction?
    SELECT   transaction_id txnid, transfer_transaction_id txfrtxnid
           , organization_id orgid, transfer_organization_id txfrorgid, subinventory_code subinv
           , transfer_subinventory txfrsubinv, cost_group_id cgid
           , transfer_cost_group_id txfrcgid       , prior_costed_quantity
           , transfer_prior_costed_quantity       , rcv_transaction_id rcvtxnid
           , transaction_action_id txnactid       , transaction_source_type_id txnsrctypid
           , transaction_type_id txntypid       , costed_flag cstdflg
           , transaction_group_id       , inventory_item_id invitmid
           , transaction_source_id wip_entity_id       , transaction_cost txncst
           , shipment_number shipnum       , new_cost       , prior_cost
           , actual_cost       , project_id       , transaction_uom txnuom
           , transaction_quantity txnqty       , primary_quantity priqty       , prior_costed_quantity priorqty
           , currency_code altcurr       , currency_conversion_rate currconvrt       , currency_conversion_date currconvdt
           , TO_CHAR (mmt.creation_date, 'dd-mm-yyyy hh24:mi:ss') creation_date
           , TO_CHAR (mmt.last_update_date, 'dd-mm-yyyy hh24:mi:ss')last_upd_date
           , ERROR_CODE errcode
           , error_explanation errexpl
        FROM mtl_material_transactions mmt
       WHERE transaction_id IN (&Trx_Id)   -- Error transaction_id
    ORDER BY transaction_id DESC

  • Discoverer Report  returning ' no data  found '

    Hi  ...
    i  have an issue with one discoverer  report  .
    Discoverer report  name : EDI Price Exception Report.
    when i ran the report  in Discoverer  Desktop edition  It is returning 'No Data Found ' But  i am taken the  Query from admin edition  and tried to  ran in  PL/SQL Developer/TOAD  by setting  Org_id condition
    it's returning Data  . the Desktop Edition of Discoverer for  some specific date  Range  it's giving Data  But  from last month on wards  it's not returning any Data.
    in Discoverer Report  Desktop  it's not retuning the Data from  November to till date
    Oracle  Applications  11i
    Discoverer 4i
    Oracle Data base :9i 
    OS : Windows.
    Attached the Sql  which i used to generate the Report :
    I HAVE USED THE FOLLOWING  :-for initialize the profile options
    EXEC FND_GLOBAL.APPS_INITIALIZE (0,52163,660);
    EXEC APPS.FND_CLIENT_INFO.SET_ORG_CONTEXT(2922);
      SELECT A.CUST_PO_NUMBER,
             A.ORDER_NUMBER,
             A.ORDERED_DATE,
             A.ORDER_TYPE,
             -- C.CUSTOMER_ID,
             C.CUSTOMER_NUMBER,
             C.CUSTOMER_NAME,
             B.LINE_NUMBER,
             B.ORDERED_ITEM,
             MSI.SEGMENT1 ACCO_ITEM,                               -- GRW 20060407
             MSI.DESCRIPTION,
             -- MSI.INVENTORY_ITEM_ID,
             (SELECT MCI.CUSTOMER_ITEM_NUMBER
                FROM MTL_CUSTOMER_ITEMS MCI,
                     MTL_CUSTOMER_ITEM_XREFS MCIX,
                     MTL_SYSTEM_ITEMS_B MSIB
               --  MTL_PARAMETERS          MP
               WHERE     MCI.CUSTOMER_ID = C.CUSTOMER_ID                 --1814924
                     AND MCI.CUSTOMER_ITEM_ID = MCIX.CUSTOMER_ITEM_ID
                     AND MCIX.INVENTORY_ITEM_ID = MSIB.INVENTORY_ITEM_ID
                     AND MSIB.INVENTORY_ITEM_ID = MSI.INVENTORY_ITEM_ID   --869899
                     AND MSIB.ORGANIZATION_ID = MTP.ORGANIZATION_ID --MP.ORGANIZATION_ID
                     AND MTP.ORGANIZATION_CODE = 'BRM'
                     AND MCI.CUSTOMER_ITEM_NUMBER = B.ORDERED_ITEM
                     AND NVL (mci.inactive_flag, 'N') <> 'Y'
                     AND NVL (mcix.inactive_flag, 'N') <> 'Y')
                CUSTOMER_ITEM,
                     XXAB_ITEM_XREFS.GET_GBC_ITEM_NUM (B.ORDERED_ITEM) GBC_ITEM_NUMBER,
             B.ORDERED_QUANTITY,
             B.PRICE_LIST,
             B.UNIT_SELLING_PRICE,
             B.UNIT_LIST_PRICE,
                   TO_NUMBER (B.ATTRIBUTE7) CUST_SENT_PRICE,
             apps.XXAB_CUST_SENT_PRICE_CONV_SO (C.customer_number,
                                                B.ordered_item,
                                                B.header_id,
                                                B.line_number,
                                                B.unit_selling_price,
                                                B.attribute7,
                                                B.pricing_quantity_uom,
                                                B.attribute4)
                CUST_SENT_PRICE_CONVERTED,
             ABS ( (B.UNIT_SELLING_PRICE
                    - apps.XXAB_CUST_SENT_PRICE_CONV_SO (C.customer_number,
                                                         B.ordered_item,
                                                         B.header_id,
                                                         B.line_number,
                                                         B.unit_selling_price,
                                                         B.attribute7,
                                                         B.pricing_quantity_uom,
                                                         B.attribute4)))
                DIFFERENCE,
                      MTP.ORGANIZATION_CODE,
             B.SHIP_TO_LOCATION
        FROM OE_ORDER_HEADERS_V A,
             OE_ORDER_LINES_V B,
             RA_CUSTOMERS C,
             MTL_PARAMETERS MTP,
             MTL_SYSTEM_ITEMS_B MSI
       WHERE     A.HEADER_ID = B.HEADER_ID
             AND A.SOLD_TO_ORG_ID = C.CUSTOMER_ID
             -- Added by Gati on 19-Oct-2012, tkt - INC000000118962
             AND ROUND (TO_NUMBER (apps.XXAB_CUST_SENT_PRICE_CONV_SO (
                                      C.customer_number,
                                      B.ordered_item,
                                      B.header_id,
                                      B.line_number,
                                      B.unit_selling_price,
                                      B.attribute7,
                                      B.pricing_quantity_uom,
                                      B.attribute4)),
                        2) <> B.UNIT_SELLING_PRICE
             --AND ROUND(TO_NUMBER(B.ATTRIBUTE7), 2) <> B.UNIT_SELLING_PRICE
             --AND     a.ship_from_org_id = mtp.organization_id
             AND B.SHIP_FROM_ORG_ID = MTP.ORGANIZATION_ID          -- GRW 20060413
             --AND     a.ship_from_org_id = msi.organization_id
             AND B.SHIP_FROM_ORG_ID = MSI.ORGANIZATION_ID          -- GRW 20060413
             AND B.INVENTORY_ITEM_ID = MSI.INVENTORY_ITEM_ID       -- GRW 20060407
             AND A.ORDER_SOURCE_ID = 6
             AND A.ORG_ID = B.ORG_ID
             AND TO_CHAR (A.ordered_date, 'DD-MON-YYYY') between  '01-NOV-2013' and  '03-NOV-2013'
             and mtP.organization_code='BRM'
                      AND A.ORG_ID = (SELECT HOU.ORGANIZATION_ID
                               FROM HR_OPERATING_UNITS HOU
                              WHERE HOU.NAME = '50 ACCO Canada')
             AND B.cancelled_flag <> 'Y'
             AND B.flow_status_code <> 'CANCELLED'
             AND B.ORDERED_ITEM <> 'INVALID_ITEM'
    ORDER BY a.order_number

    Hi,
    Assuming your initialization matches your discoverer login, it is pretty weird that you get no data.
    I am not sure how you got the SQL but i suggest you trace the session to get the exact SQL ran by the discoverer.
    You may find another condition or join that limits your data.
    Also another thing that you should try is to initial the session by using all the parameters (including the security group as you have in your discoverer login):
    begin
      fnd_global.APPS_INITIALIZE(user_id =>, resp_id =>, resp_appl_id =>, security_group_id =>);
    end

  • Error in creation of Phantom item bill

    Hi Gurus,
    We have planned to use phantom item. for that wehave created an item of type: 'option class'. Then created its routing but facing below error when trying to cretae bill for phantom item.
    Kindly help me out
    Regards,
    Ali Raza
    APP-FND-01048: Use of this combination restricted by WHERE clause ' ( ((:parameter.query_mode = 2 AND bom_enabled_flag = 'Y') OR (:parameter.query_mode = 1 AND EXISTS (SELECT NULL FROM bom_bill_of_materials bom WHERE bom.organization_id = :parameter.org_id AND bom.assembly_item_id = inventory_item_id AND ((:parameter.bom_or_eng = 1 AND assembly_type = 1) OR :parameter.bom_or_eng = 2) ))) AND (bom_item_type in (:parameter.model_item_access, :parameter.planning_item_access, :parameter.std_item_access, :parameter.oc_item_access) ) AND ((:parameter.bom_or_eng = 1 AND eng_item_flag = 'N' AND NOT EXISTS (SELECT 'X' FROM bom_bill_of_materials bom WHERE bom.organization_id = :parameter.org_id AND bom.assembly_item_id = inventory_item_id AND bom.alternate_bom_designator IS NULL AND bom.assembly_type <> 1) AND (:parameter.eam_type is null OR (:parameter.eam_type in (1, 2, 3)
    APP-FND-01388: Cannot read value for profile option FND_INDICATOR_COLORS in routine &ROUTINE.

    Hi Sandeep,
    Thanks for your reply.
    I have checked all three possibilities. Item is not Engineering item and already assigned to Org. Also the BOM doesnot exist. Kindly note that I donot have any issue in creating bill of a standard item. We are using phantom item for the first time so tell me if phantom item need some special setup or some profile option to be active etc? I am using below attributes in inventory. Kindly go through it and suggest.
    Deviation Factor +     0
    Deviation Factor -     0
    Shelf Life Days     0
    Price Tolerance %     0
    Acceptable Rate -     0
    Acceptable Rate +     0
    Postprocessing Lead Time     0
    Planning Time Fence Days     1
    Lead Time Lot Size     1
    Descriptive Flexfield     ---------
    Item Status     Active
    Conversions     Both standard and item specific
    Forecast Control     Consume Forecast
    Effectivity Control     Date
    Service Request     Enabled
    RMA Inspection Required     Inspection not required
    Default SO Source Type     Internal
    Restrict Locators     Locators restricted to pre-defined list
    Make or Buy     Make
    Billing Type     Material
    Cycle Count Enabled     No
    Check Material Shortage     No
    Lot Split Enabled     No
    Lot Merge Enabled     No
    Lot Translate Enabled     No
    Lot Substitution Enabled     No
    Bulk Picked     No
    Engineering Item     No
    EAM Notification Required     No
    Use Approved Supplier     No
    Taxable     No
    Allow Description Update     No
    RFQ Required     No
    Outside Processing Item     No
    Equipment     No
    Planned Inventory Point     No
    Repetitive Planning     No
    Build in WIP     No
    Customer Ordered     No
    Customer Orders Enabled     No
    Internal Ordered     No
    Internal Orders Enabled     No
    OE Transactable     No
    Assemble to Order     No
    Ship Model Complete     No
    Financing Allowed     No
    Invoiceable Item     No
    Invoice Enabled     No
    Enable Contract Coverage     No
    Enable Defect Tracking     No
    Lot Control     No lot control
    Serial Number Generation     No serial number control
    Lot Expiration     No shelf life control
    End Assembly Pegging     None
    Check ATP     None
    ATP Components     None
    Safety Stock     Non-MRP planned
    Inventory Planning Method     Not planned
    MRP Planning Method     Not planned
    Primary Unit of Measure     NUMBER
    BOM Item Type     Option class
    WIP Supply Type     Phantom
    User Item Type     Phantom item
    Locator Control     Prespecified locator control
    Tracking UOM Indicator     Primary
    Pricing UOM Indicator     Primary
    Reservable     Reservable
    Restrict Subinventories     Subinventories restricted to pre-defined list
    Description     TEST FG
    Revision Control     Under revision quantity control
    Planning Time Fence     User-defined time fence
    Inventory Item     Yes
    Stockable     Yes
    Transactable     Yes
    BOM Allowed     Yes
    Costing Enabled     Yes
    Inventory Asset Value     Yes
    Include in Rollup     Yes
    Purchased     Yes
    Purchasable     Yes
    Receipt Required     Yes
    Create Supply     Yes
    Shippable     Yes
    Pick Components     Yes
    Returnable     Yes
    Enable Service Billing     Yes
    Regards,
    Ali Raza

  • Help needed in Collections

    Hi Experts,
    I need your help in solving this .
    I am getting compilation errors as:
    Warning: Package Body created with compilation errors.
    SQL> show errors;
    Errors for PACKAGE BODY TABLE_EXAMPLE:
    LINE/COL ERROR
    18/1     PL/SQL: Statement ignored
    18/20    PLS-00306: wrong number or types of arguments in call to '='I will try to explain this as simple as possible .
    The data in emp is like this:
         EMPNO ENAME      JOB              SAL
       7782 CLARK      MANAGER         2450
       7839 KING       PRESIDENT       5000
       7934 MILLER     CLERK           1300I need to pass parameters and values as table type as follows:
    declare
           v_tab TABLE_EXAMPLE.tablet:=TABLE_EXAMPLE.tablet();
        begin
          v_tab.extend;
         v_tab(1).parameter:='ENAME';
         v_tab(1).value:= 'PETER';
         v_tab(1).parameter:='JOB';
         v_tab(1).value:= 'CEO';
          TABLE_EXAMPLE.P1(v_tab);
       end;
       After the package is run the data should look like this :
    EMPNO ENAME      JOB              SAL
      7782 PETER      CEO             2450
      7839 PETER      CEO             5000
      7934 PETER      CEO             1300I have tried hard to create the code but i will highlight where i am stuck :
    create or replace package table_example as
    type tname is record(parameter emp%rowtype,value emp%rowtype);
    type tablet is table of tname;
    type emp_table is table of emp%rowtype;
    procedure p1(arg in table_example.tablet);
    end;
    Package created
    create or replace package body table_example as
    procedure p1(arg in table_example.tablet)as
    l_emp_tbl emp_table:=emp_table() ;
    cursor c is select * from emp;
    k number;
    m number;
    begin
    k:=1;
    for i in c loop
    l_emp_tbl(k).ename:=i.ename;
    l_emp_tbl(k).empno:=i.empno;
    l_emp_tbl(k).deptno:=i.deptno;
    l_emp_tbl(k).sal:=i.sal;
    --------------------i am stuck here : how to assign the values?---------------------------
    m:=1;
    for  j in 1..arg.last loop
    if arg(m).parameter= l_emp_tbl(j) then
    l_emp_tbl(j):=arg(m).value ;
    end if;
    end loop;
    ____________stuck here ___________________
    end loop;
    exception
    when others then
    dbms_output.put_line('other errors');
    end;
    end  table_example;
    Warning: Package Body created with compilation errors.
    SQL> show errors;
    Errors for PACKAGE BODY TABLE_EXAMPLE:
    LINE/COL ERROR
    18/1     PL/SQL: Statement ignored
    18/20    PLS-00306: wrong number or types of arguments in call to '='Please help.Thanks

    Hi Tubby,
    Version is 10g release 2
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
    PL/SQL Release 10.2.0.3.0 - Production
    CORE    10.2.0.3.0      Production
    TNS for Linux: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - ProductionPlease see the real code and AREAS marked as COMMENTS
    PROCEDURE items_exist (
          p_source_organization   VARCHAR2,
          p_dest_organization     VARCHAR2,
          p_assembly_item         VARCHAR2
    ------Parameter needs to be added here as table type having paramter and value--------------------------------------------------------------comments
       AS
          l_item_table          ego_item_pub.item_tbl_type;
          x_item_table          ego_item_pub.item_tbl_type;
          x_inventory_item_id   mtl_system_items_b.inventory_item_id%TYPE;
          x_organization_id     mtl_system_items_b.organization_id%TYPE;
          x_return_status       VARCHAR2 (1);
          x_msg_count           NUMBER (10);
          x_msg_data            VARCHAR2 (1000);
          x_message_list        error_handler.error_tbl_type;
          p_assy_item_id        NUMBER;
          p_dest_org_id         NUMBER;
          p_source_org_id       NUMBER;
      l_err_msg                   VARCHAR2 (240);
          l_error_code                NUMBER;
          CURSOR items_exist
          IS
             SELECT DISTINCT msi.*
                        FROM cux_bom_export_temp a, mtl_system_items_b msi
                       WHERE a.component_item_id = msi.inventory_item_id
                         AND msi.organization_id = a.organization_id
                         AND a.organization_id = p_source_org_id
                         AND a.component_item_id NOT IN (
                                             SELECT inventory_item_id
                                               FROM mtl_system_items_b
                                              WHERE organization_id =
                                                                     p_dest_org_id);
       BEGIN
          FOR i IN items_exist
          LOOP
             --FIRST Item definition
             l_item_table (1).transaction_type := 'CREATE';
             -- Replace this with 'UPDATE' for update transaction.
             l_item_table (1).organization_code := p_dest_organization;
             l_item_table (1).long_description := 'Create test item';
             l_item_table (1).inventory_item_id := i.inventory_item_id;
                     l_item_table (1).summary_flag := i.summary_flag;
             l_item_table (1).enabled_flag := i.enabled_flag;
             l_item_table (1).start_date_active := i.start_date_active;
             l_item_table (1).end_date_active := i.end_date_active;
             l_item_table (1).organization_id := p_dest_org_id;
             l_item_table (1).item_catalog_group_id := i.item_catalog_group_id;
             l_item_table (1).catalog_status_flag := i.catalog_status_flag;
             l_item_table (1).lifecycle_id := i.lifecycle_id;
           *----------400 attributes to follow cutting short--------------------------------------------------------------------------------------------------------------------------------------------------comments
    Here i need to look from the input parameter if anyone attribute matches that  from l_item_table.If it matches then apply the value from input paramter into the value of l_item_table----Cments
    *Example say enabled_flag in  l_item_table has value 'Y' BUT INPUT PARAMTER IS AS 'N' then 'N' should be passed to enabled_flag  and not 'Y'-------------------------------------------------comments
                    ego_item_pub.process_items (p_api_version        => 1.0,
                                         p_init_msg_list      => fnd_api.g_true,
                                         p_commit             => fnd_api.g_true,
                                         p_item_tbl           => l_item_table,
                                         x_item_tbl           => x_item_table,
                                         x_return_status      => x_return_status,
                                         x_msg_count          => x_msg_count
    END LOOP;
       EXCEPTION
          WHEN OTHERS
          THEN
    l_error_code:=sqlcode;
    l_err_msg:=sqlerrm;
      INSERT INTO xxaai_copy_bom_errors
                  VALUES ('Items_Exist', p_assembly_item, NULL,
                          p_source_organization, p_dest_organization, l_error_code,
                         l_err_msg);
       END;

  • Help with AP_Invoice Tables in SQL

    Hi Gurus,
    I am working on a report where i created a view. This query pulls data from SO,PO,ITEMS,AP and AR tables. The problem I am having is when I add a AP tables or a field from that table some of the Order Numbers are disappearing. Could someone please shed some light this. Here is the query
    SELECT DISTINCT trxl.CUSTOMER_TRX_LINE_ID,
    pv.vendor_name,
    api.invoice_num AP_Invoice_Num,
    trx.trx_date AR_Invoice_Date,
    trx.trx_number AR_Invoice_Number,
    pll.quantity_received,
    pll.quantity_billed,
    ool.shipped_quantity,
    mtlb.segment1 NSN,
    poh.closed_date po_close_date,
    gl.gl_date
    FROM apps.oe_order_headers_all ooh,
    apps.oe_order_lines_all ool,
    apps.oe_drop_ship_sources odss,
    apps.po_headers_all poh,
    apps.po_lines_all pol,
    apps.po_line_locations_all pll,
    apps.po_vendors pv,
    inv.mtl_system_items_b mtlb,
    ar.Ra_customer_trx_all trx,
    ar.ra_customer_trx_lines_all trxl,
    ar.hz_parties hzp,
    ar.hz_cust_accounts hzc,
    ap.ap_invoices_all api,
    ap.ap_invoice_lines_all apl,
    apps.RA_CUST_TRX_LINE_GL_DIST_ALL gl
    WHERE odss.header_id = ooh.header_id
    AND odss.line_id = ool.line_id
    AND odss.po_header_id = poh.po_header_id
    AND odss.po_line_id = pol.po_line_id
    AND odss.line_location_id = pll.line_location_id
    AND pv.vendor_id = poh.vendor_id
    AND mtlb.inventory_item_id = ool.inventory_item_id
    AND trxl.customer_trx_id = trx.customer_trx_id
    AND trxl.inventory_item_id = mtlb.inventory_item_id
    AND hzc.cust_account_id = ooh.sold_to_org_id
    AND hzc.party_id = hzp.party_id
    AND apl.invoice_id = api.invoice_id
    AND apl.po_header_id = poh.po_header_id
    AND apl.inventory_item_id = mtlb.inventory_item_id
    AND api.vendor_id = poh.vendor_id
    AND ool.line_id = trxl.interface_line_attribute6
    AND to_char(ooh.order_number)= trx.interface_header_attribute1
    AND trxl.CUSTOMER_TRX_LINE_ID = gl.CUSTOMER_TRX_LINE_ID
    AND gl.gl_date IS NOT NULL
    ORDER BY trxl.CUSTOMER_TRX_LINE_ID DESC;
    Really appreciate your help
    Thank You,

    Hi ,
    Need to place outer join for AP Tables .
    Regards
    Muthu

  • AP Invoice with PO information

    Hi All,
    My query is getting duplicate values i have kept all the join conditions correctly.please let me know its urgent.Advance thanks i am pasting the query.
    select HL.LOCATION_CODE "LOCATION CODE",
    HL.DESCRIPTION "DESCRIPTION",
    aid.period_name "PERIOD NAME",
    pll.line_location_id "HEADING",
    glcc.CONCATENATED_SEGMENTS "DIST ACCOUNT NBR",
    to_char(aia.invoice_date,'DD-MM-YYYY') "INVOICE DATE",
    aia.voucher_num "VOUCHER NUMBER",
    pv.segment1 "VENDOR NUMBER",
    pv.vendor_name "VENDOR NAME",
    msi.segment1 "PART NUMBER",
    msi.description "PART DESCRIPTION",
    pl.unit_meas_lookup_code "UNIT OF MEASURE",
    pl.quantity "QUANTITY",
    ph.segment1 "PO",
    rsh.receipt_num "RECEIPT NUMBER",
    pr.release_num"RELEASE NUMBER",
    aia.INVOICE_AMOUNT "AMOUNT",
    aid.amount "LINE AMOUNT"
    from
    po_headers_all ph,
    po_lines_all pl,
    po_line_locations_all pll,
    po_distributions_all pd,
    po_releases_all pr,
    rcv_shipment_headers rsh,
    rcv_shipment_lines rsl,
    po_vendors pv,
    ap_invoices_all aia,
    ap_invoice_distributions_all aid,
    mtl_system_items_b msi,
    gl_code_combinations_kfv glcc,
    hr_locations_all hl
    where ph.po_header_id = pl.po_header_id
    AND pl.po_line_id = pll.po_line_id
    AND pl.po_line_id = pd.po_line_id
    AND rsh.shipment_header_id = rsl.shipment_header_id
    AND rsl.po_header_id = ph.po_header_id
    AND pr.po_header_id = ph.po_header_id
    AND pd.po_distribution_id =aid.po_distribution_id
    and aia.invoice_id = aid.invoice_id
    AND pv.vendor_id = aia.vendor_id
    AND glcc.CODE_COMBINATION_ID = aid.DIST_CODE_COMBINATION_ID
    AND msi.inventory_item_id = pl.item_id
    AND HL.LOCATION_ID =pll.line_location_id
    --- and porg_id = 7404
    AND rownum<50

    Hi
    When you match a supplier invoice to a PO, the system copies the distributions from the PO to the AP lines.
    There is no way to override the PO distributions on the AP invoice.
    Therefore, if the PO has no project distribution the AP lines generated from that PO will not be project related neither.
    Dina

  • SR created using cs_servicerequest_pub.Create_ServiceRequest is not able to search it in Contact Center.

    Hi All ,
       I have created a SR using following sql api
    declare
    lx_msg_count NUMBER;
    lx_msg_data VARCHAR2(2000);
    lx_request_id NUMBER;
    lx_request_number VARCHAR2(50);
    lx_interaction_id NUMBER;
    lx_workflow_process_id NUMBER;
    lx_msg_index_out NUMBER;
    lx_return_status VARCHAR2(1);
    l_service_request_rec CS_ServiceRequest_PUB.service_request_rec_type;
    l_notes_table CS_SERVICEREQUEST_PUB.notes_table;
    l_contacts_tab CS_SERVICEREQUEST_PUB.contacts_table;
    begin
    -- Populate the SR Record type
    l_service_request_rec.request_date := to_date('19-NOV-2013 16:27:34', 'dd-MON-YYYY
    HH24:MI:SS');
    l_service_request_rec.type_id := 4;
    l_service_request_rec.status_id := 1;
    l_service_request_rec.urgency_id := 44;
    l_service_request_rec.inventory_item_id := 2530;
    l_service_request_rec.inventory_org_id := 204;
    l_service_request_rec.severity_id := 6;
    l_service_request_rec.summary := 'TEST IBIZ';
    l_service_request_rec.caller_type := 'ORGANIZATION';
    l_service_request_rec.customer_id := 3532;
    l_service_request_rec.verify_cp_flag := 'N';
    l_service_request_rec.sr_creation_channel := 'PHONE';
    l_service_request_rec.resource_type := null;
    l_service_request_rec.group_type := null;
    l_service_request_rec.owner_id := null;
    l_service_request_rec.owner_group_id := null;
    l_service_request_rec.bill_to_site_use_id := 1583;
    l_service_request_rec.ship_to_site_use_id := 2359;
    l_service_request_rec.exp_resolution_date := to_date('19-DEC-2013 16:27:34', 'dd-MON-YYYY
    HH24:MI:SS');
    l_service_request_rec.install_site_use_id := 178401;
    l_service_request_rec.account_id := 3670;
    l_service_request_rec.obligation_date := to_date('22-NOV-2013 16:27:34', 'dd-MON-YYYY
    HH24:MI:SS');
    l_service_request_rec.category_id := 1376;
    l_service_request_rec.last_update_channel := 'PHONE';
    l_service_request_rec.category_set_id := 27;
    l_service_request_rec.incident_occurred_date :=to_date('19-NOV-2013 16:27:34', 'dd-MON-YYYY
    HH24:MI:SS');
    l_service_request_rec.incident_location_id :=178401;
    l_service_request_rec.incident_country :='US';
    l_service_request_rec.last_update_program_code :='CSXSRTAB';
    l_service_request_rec.creation_program_code :='CSXSRTAB';
    l_service_request_rec.bill_to_account_id :=3670;
    l_service_request_rec.ship_to_account_id :=3670;
    l_service_request_rec.bill_to_party_id :=3532;
    l_service_request_rec.ship_to_party_id :=3532;
    l_service_request_rec.bill_to_site_id :=2915;
    l_service_request_rec.ship_to_site_id :=2915;
    l_service_request_rec.incident_location_type :='HZ_PARTY_SITE';
    dbms_output.put_line('before calling public sr');
    FND_GLOBAL.APPS_INITIALIZE(
    user_id => 0,
    resp_id => 21739,
    resp_appl_id => 514);
    cs_servicerequest_pub.Create_ServiceRequest (
    p_api_version => 2.0,
    p_init_msg_list => FND_API.G_TRUE,
    p_commit => FND_API.G_FALSE,
    x_return_status => lx_return_status,
    x_msg_count => lx_msg_count,
    x_msg_data => lx_msg_data,
    p_resp_appl_id => 514,
    p_resp_id => 21739,
    p_user_id => 0,
    p_login_id => NULL,
    p_request_id => NULL,
    p_request_number => NULL,
    p_service_request_rec => l_service_request_rec,
    p_notes => l_notes_table,
    p_contacts => l_contacts_tab,
    x_request_id => lx_request_id,
    x_request_number => lx_request_number,
    x_interaction_id => lx_interaction_id,
    x_workflow_process_id => lx_workflow_process_id );
    dbms_output.put_line('Return Status : ' || lx_return_status);
    dbms_output.put_line('Inserted request id: ' || lx_request_id );
    dbms_output.put_line('Inserted request num : ' || lx_request_number );
    dbms_output.put_line('Interaction ID : ' || lx_interaction_id );
    IF (lx_return_status <> FND_API.G_RET_STS_SUCCESS) then
    IF (FND_MSG_PUB.Count_Msg > 1) THEN
    --Display all the error messages
    FOR j in 1..FND_MSG_PUB.Count_Msg LOOP
    FND_MSG_PUB.Get(
    p_msg_index => j,
    p_encoded => 'F',
    p_data => lx_msg_data,
    p_msg_index_out => lx_msg_index_out);
    DBMS_OUTPUT.PUT_LINE(lx_msg_data);
    END LOOP;
    ELSE
    --Only one error
    FND_MSG_PUB.Get(
    p_msg_index => 1,
    p_encoded => 'F',
    p_data => lx_msg_data,
    p_msg_index_out => lx_msg_index_out);
    DBMS_OUTPUT.PUT_LINE(lx_msg_data);
    DBMS_OUTPUT.PUT_LINE(lx_msg_index_out);
    END IF;
    END IF;
    exception
    when others then dbms_output.put_line('in others main ' || sqlerrm);
    commit;
    end;
    I am able to create SR using above code but when i try to search using the SR number it say no LOV is found from Contact Center . Please
    help me out.
    Thanks
    Mark

    Hi Mark,
    Have you tried setting p_commit to FND_API.G_TRUE?
    HTH, Ryan.

  • I have to insert lookup values into parent table remaining items in chiled table can you please any one explain the logic

    CREATE OR REPLACE
    PACKAGE BODY xxcsi_ib_data_ob_ecs_pkg
      v_update_date DATE := SYSDATE;
    PROCEDURE print_log(
        i_message IN VARCHAR2)
    IS
    BEGIN
      -- dbms_output.put_line('Log '||TO_CHAR(sysdate,'DD-MON-YYYY HH24:MI:SS :')||i_message);
      fnd_file.put_line(fnd_file.LOG,'Log '||TO_CHAR(SYSDATE,'DD-MON-YYYY HH24:MI:SS :')||i_message);
    EXCEPTION
    WHEN no_data_found THEN
      NULL;
    WHEN OTHERS THEN
      NULL;
    END;
    PROCEDURE main_prc(
        o_chr_errbuff OUT VARCHAR2 ,
        o_num_retcode OUT NUMBER ,
        i_org_id IN NUMBER)
    IS
      CURSOR cur_get_parent_ib_rec(c_from DATE ,c_to DATE)
      IS
        SELECT
          /*+ index(a CSI_ITEM_INSTANCES_X3)*/
          ---CREATE MODE ITEM
          A.creation_date ,
          A.last_update_date ,
          A.last_oe_order_line_id line_id ,
          A.inventory_item_id ,
          A.instance_id ,
          A.instance_type_code ,
          msib.segment1
        FROM csi_item_instances A ,
          mtl_system_items_b msib
        WHERE 1=1
          --      AND a.instance_id = 33371916
          --AND a.instance_id in (33371920,33371921,33371922,33371923,33371924,33371925,33371926,33371927,33371928,33371929,33371930)
        AND msib.inventory_item_id=A.inventory_item_id
        AND msib.organization_id  =
          (SELECT mp.organization_id
          FROM mtl_parameters mp
          WHERE mp.organization_code = 'IMO'
        -- AND msib.organization_id = 85
        -- and msib.segment1 like '475%'
        --AND msib.segment1 like 'TREX%'
      AND EXISTS
        (SELECT 1
        FROM fnd_lookup_values
        WHERE lookup_type = 'EMR CSI OUTBOUND INTERFACE PSG'
        AND language      = 'US'
        AND lookup_code   = msib.segment1
        --and DESCRIPTION = 'Items to be Interfaced from Oracle EBS to ECS'
      AND A.last_update_date BETWEEN NVL(c_from ,to_date('07-AUG-2014 00:00:00','DD-MON-YYYY HH24:MI:SS')) AND NVL(c_to ,to_date('22-AUG-2014 00:00:00','DD-MON-YYYY HH24:MI:SS'))
      UNION
      SELECT
        /*+ index(a CSI_ITEM_INSTANCES_X3)*/
        ---CREATE MODE SEARCH
        A.creation_date ,
        A.last_update_date ,
        A.last_oe_order_line_id line_id ,
        A.inventory_item_id ,
        A.instance_id ,
        A.instance_type_code ,
        msib.segment1
      FROM csi_item_instances A ,
        mtl_system_items_b msib
      WHERE 1=1
        --AND a.instance_id = 33371916
        --AND a.instance_id in (33371920,33371921,33371922,33371923,33371924,33371925,33371926,33371927,33371928,33371929,33371930)
      AND msib.inventory_item_id=A.inventory_item_id
      AND msib.organization_id  =
        (SELECT mp.organization_id
        FROM mtl_parameters mp
        WHERE mp.organization_code = 'IMO'
        -- AND msib.organization_id = 85
        -- and msib.segment1 like '475%'
        --AND msib.segment1 like 'TREX%'
      AND EXISTS
        (SELECT 1
        FROM fnd_lookup_values
        WHERE lookup_type           = 'EMR CSI OUTBOUND INTERFACE PSG'
        AND language                = 'US'
        AND tag                     ='ALL TREX ITEMS'
        AND SUBSTR(lookup_code,1,4) = SUBSTR(msib.segment1,1,4)
        --and DESCRIPTION = 'Items to be Interfaced from Oracle EBS to ECS'
      AND A.last_update_date BETWEEN NVL(c_from ,to_date('07-AUG-2014 00:00:00','DD-MON-YYYY HH24:MI:SS')) AND NVL(c_to ,to_date('22-AUG-2014 00:00:00','DD-MON-YYYY HH24:MI:SS'))
      UNION
      SELECT
        /*+ index(a CSI_ITEM_INSTANCES_X3)*/
        ---UPDATE MODE ITEM
        A.creation_date ,
        A.last_update_date ,
        A.last_oe_order_line_id line_id ,
        A.inventory_item_id ,
        A.instance_id ,
        A.instance_type_code ,
        msib.segment1
      FROM csi_item_instances A ,
        mtl_system_items_b msib
      WHERE 1=1
        --AND a.instance_id = 33371916
        --AND a.instance_id in (33371920,33371921,33371922,33371923,33371924,33371925,33371926,33371927,33371928,33371929,33371930)
      AND msib.inventory_item_id=A.inventory_item_id
      AND msib.organization_id  =
        (SELECT mp.organization_id
        FROM mtl_parameters mp
        WHERE mp.organization_code = 'IMO'
        -- AND msib.organization_id = 85
        -- and msib.segment1 like '475%'
        --AND msib.segment1 like 'TREX%'
      AND EXISTS
        (SELECT 1
        FROM fnd_lookup_values
        WHERE lookup_type = 'EMR CSI OUTBOUND INTERFACE PSG'
        AND language      = 'US'
        AND lookup_code   = msib.segment1
        --and DESCRIPTION = 'Items to be Interfaced from Oracle EBS to ECS'
      AND A.last_update_date BETWEEN NVL(c_from ,to_date('07-AUG-2014 00:00:00','DD-MON-YYYY HH24:MI:SS')) AND NVL(c_to ,to_date('22-AUG-2014 00:00:00','DD-MON-YYYY HH24:MI:SS'))
      AND EXISTS
        (SELECT
          /*+ index(ct CSI_TRANSACTIONS_U01)*/
          1
        FROM csi_item_instances_h h ,
          csi_transactions ct
        WHERE 1                     =1
        AND ct.transaction_type_id IN (1)
        AND ct.transaction_id       = h.transaction_id
        AND ct.last_update_date BETWEEN NVL(c_from ,to_date('07-AUG-2014 00:00:00','DD-MON-YYYY HH24:MI:SS')) AND NVL(c_to ,to_date('22-AUG-2014 00:00:00','DD-MON-YYYY HH24:MI:SS'))
        AND A.instance_id =h.instance_id
      UNION
      SELECT
        /*+ index(a CSI_ITEM_INSTANCES_X3)*/
        ---UPDATE MODE SEARCH
        A.creation_date ,
        A.last_update_date ,
        A.last_oe_order_line_id line_id ,
        A.inventory_item_id ,
        A.instance_id ,
        A.instance_type_code ,
        msib.segment1
      FROM csi_item_instances A ,
        mtl_system_items_b msib
      WHERE 1=1
        --AND a.instance_id = 33371916
        --AND a.instance_id in (33371920,33371921,33371922,33371923,33371924,33371925,33371926,33371927,33371928,33371929,33371930)
      AND msib.inventory_item_id=A.inventory_item_id
      AND msib.organization_id  =
        (SELECT mp.organization_id
        FROM mtl_parameters mp
        WHERE mp.organization_code = 'IMO'
        -- AND msib.organization_id = 85
        -- and msib.segment1 like '475%'
        --AND msib.segment1 like 'TREX%'
      AND EXISTS
        (SELECT 1
        FROM fnd_lookup_values
        WHERE lookup_type           = 'EMR CSI OUTBOUND INTERFACE PSG'
        AND language                = 'US'
        AND tag                     ='ALL TREX ITEMS'
        AND SUBSTR(lookup_code,1,4) = SUBSTR(msib.segment1,1,4)
        --and DESCRIPTION = 'Items to be Interfaced from Oracle EBS to ECS'
      AND A.last_update_date BETWEEN NVL(c_from ,to_date('07-AUG-2014 00:00:00','DD-MON-YYYY HH24:MI:SS')) AND NVL(c_to ,to_date('22-AUG-2014 00:00:00','DD-MON-YYYY HH24:MI:SS'))
      AND EXISTS
        (SELECT
          /*+ index(ct CSI_TRANSACTIONS_U01)*/
          1
        FROM csi_item_instances_h h ,
          csi_transactions ct
        WHERE 1                     =1
        AND ct.transaction_type_id IN (1)
        AND ct.transaction_id       = h.transaction_id
        AND ct.last_update_date BETWEEN NVL(c_from ,to_date('07-AUG-2014 00:00:00','DD-MON-YYYY HH24:MI:SS')) AND NVL(c_to ,to_date('22-AUG-2014 00:00:00','DD-MON-YYYY HH24:MI:SS'))
        AND A.instance_id =h.instance_id
      ORDER BY 1 DESC,
        2 ;
      CURSOR cur_get_child_ib_rec(c_instance_id NUMBER)
      IS
        SELECT cir.subject_id
        FROM csi.csi_ii_relationships cir
        WHERE cir.object_id = c_instance_id;
      CURSOR cur_get_outbound_data(c_instance_id NUMBER)
      IS
        SELECT cii.instance_id instance_id,
          cii.instance_number instance_number,
          cii.inventory_item_id inventory_item_id,
          msi.segment1 segment1,       --CONCATENATED_SEGMENTS,
          msi.description description, --DESCRIPTION,
          cii.inv_master_organization_id master_organization_id,
          cii.serial_number serial_number,
          cii.system_id system_id,
          cst.NAME system_name,
          cii.quantity quantity,
          cii.unit_of_measure uom,
          cii.active_start_date active_start_date,
          cii.active_end_date active_end_date,
          cii.install_date install_date,
          cii.object_version_number object_version_number,
          cii.last_vld_organization_id,
          hou.NAME pre_registration_location,
          looh.header_id last_header_id,
          looh.order_number emerson_order_number,
          cii.last_oe_order_line_id order_line_id,
          NVL(lool.actual_shipment_date, lool.fulfillment_date) actual_shipment_date,
          (SELECT DISTINCT pap.email_address
          FROM fnd_user fu ,
            per_all_people_f pap
          WHERE fu.employee_id = pap.person_id
          and sysdate between pap.effective_start_date and nvl(pap.effective_end_date, sysdate)
          AND fu.user_id       = NVL(wdd.created_by,lool.created_by)
          ) email_address,
        (SELECT DISTINCT hp.party_name
        FROM hz_parties hp,
          hz_party_sites hps ,
          hz_party_site_uses hpsu ,
          hz_locations hl
        WHERE hp.party_id     = hps.party_id
        AND hps.location_id   = hl.location_id
        AND hps.party_site_id = hpsu.party_site_id(+)
        AND hps.party_site_id =
          (SELECT hcasa.party_site_id
          FROM apps.hz_cust_acct_sites hcasa
          WHERE hcasa.cust_acct_site_id =
            (SELECT hcsua.cust_acct_site_id
            FROM apps.hz_cust_site_uses hcsua
            WHERE cia.bill_to_address = hcsua.site_use_id
        ) AS "Bill_To_company_name",--------------------------CH-ID-1.1 STARTS-----------
        (SELECT DISTINCT hps.party_site_id
        FROM hz_parties hp,
          hz_party_sites hps ,
          hz_party_site_uses hpsu ,
          hz_locations hl
        WHERE hp.party_id     = hps.party_id
        AND hps.location_id   = hl.location_id
        AND hps.party_site_id = hpsu.party_site_id(+)
        AND hps.party_site_id =
          (SELECT hcasa.party_site_id
          FROM apps.hz_cust_acct_sites hcasa
          WHERE hcasa.cust_acct_site_id =
            (SELECT hcsua.cust_acct_site_id
            FROM apps.hz_cust_site_uses hcsua
            WHERE cia.bill_to_address = hcsua.site_use_id
        ) AS "BILL_TO_party_SITE_ID",
        (SELECT DISTINCT hl.state
        FROM hz_parties hp,
          hz_party_sites hps ,
          hz_party_site_uses hpsu ,
          hz_locations hl
        WHERE hp.party_id     = hps.party_id
        AND hps.location_id   = hl.location_id
        AND hps.party_site_id = hpsu.party_site_id(+)
        AND hps.party_site_id =
          (SELECT hcasa.party_site_id
          FROM apps.hz_cust_acct_sites hcasa
          WHERE hcasa.cust_acct_site_id =
            (SELECT hcsua.cust_acct_site_id
            FROM apps.hz_cust_site_uses hcsua
            WHERE cia.bill_to_address = hcsua.site_use_id
        ) AS "BILL_TO_STATE",
        (SELECT DISTINCT hl.country
        FROM hz_parties hp,
          hz_party_sites hps ,
          hz_party_site_uses hpsu ,
          hz_locations hl
        WHERE hp.party_id     = hps.party_id
        AND hps.location_id   = hl.location_id
        AND hps.party_site_id = hpsu.party_site_id(+)
        AND hps.party_site_id =
          (SELECT hcasa.party_site_id
          FROM apps.hz_cust_acct_sites hcasa
          WHERE hcasa.cust_acct_site_id =
            (SELECT hcsua.cust_acct_site_id
            FROM apps.hz_cust_site_uses hcsua
            WHERE cia.bill_to_address = hcsua.site_use_id
        ) AS "BILL_TO_COUNTRY",
        (SELECT DISTINCT hl.city
        FROM hz_parties hp,
          hz_party_sites hps ,
          hz_party_site_uses hpsu ,
          hz_locations hl
        WHERE hp.party_id     = hps.party_id
        AND hps.location_id   = hl.location_id
        AND hps.party_site_id = hpsu.party_site_id(+)
        AND hps.party_site_id =
          (SELECT hcasa.party_site_id
          FROM apps.hz_cust_acct_sites hcasa
          WHERE hcasa.cust_acct_site_id =
            (SELECT hcsua.cust_acct_site_id
            FROM apps.hz_cust_site_uses hcsua
            WHERE cia.bill_to_address = hcsua.site_use_id
        ) AS "BILL_TO_CITY",
        (SELECT DISTINCT hl.address1
        FROM hz_parties hp,
          hz_party_sites hps ,
          hz_party_site_uses hpsu ,
          hz_locations hl
        WHERE hp.party_id     = hps.party_id
        AND hps.location_id   = hl.location_id
        AND hps.party_site_id = hpsu.party_site_id(+)
        AND hps.party_site_id =
          (SELECT hcasa.party_site_id
          FROM apps.hz_cust_acct_sites hcasa
          WHERE hcasa.cust_acct_site_id =
            (SELECT hcsua.cust_acct_site_id
            FROM apps.hz_cust_site_uses hcsua
            WHERE cia.bill_to_address = hcsua.site_use_id
        ) AS "BILL_TO_LOCATION",
        (SELECT DISTINCT hp.party_name
        FROM hz_parties hp,
          hz_party_sites hps,
          hz_party_site_uses hpsu,
          hz_locations hl
        WHERE hp.party_id     = hps.party_id
        AND hps.location_id   = hl.location_id
        AND hps.party_site_id = hpsu.party_site_id(+)
        AND hps.party_site_id =
          (SELECT hcasa.party_site_id
          FROM apps.hz_cust_acct_sites hcasa
          WHERE hcasa.cust_acct_site_id =
            (SELECT hcsua.cust_acct_site_id
            FROM apps.hz_cust_site_uses hcsua
            WHERE cia.ship_to_address = hcsua.site_use_id
        ) AS "Ship_to_company_name",
        (SELECT DISTINCT hps.party_site_id
        FROM hz_parties hp,
          hz_party_sites hps ,
          hz_party_site_uses hpsu ,
          hz_locations hl
        WHERE hp.party_id     = hps.party_id
        AND hps.location_id   = hl.location_id
        AND hps.party_site_id = hpsu.party_site_id(+)
        AND hps.party_site_id =
          (SELECT hcasa.party_site_id
          FROM apps.hz_cust_acct_sites hcasa
          WHERE hcasa.cust_acct_site_id =
            (SELECT hcsua.cust_acct_site_id
            FROM apps.hz_cust_site_uses hcsua
            WHERE cia.bill_to_address = hcsua.site_use_id
        ) AS "SHIP_TO_party_SITE_ID",
        (SELECT DISTINCT hl.state
        FROM hz_parties hp,
          hz_party_sites hps ,
          hz_party_site_uses hpsu ,
          hz_locations hl
        WHERE hp.party_id     = hps.party_id
        AND hps.location_id   = hl.location_id
        AND hps.party_site_id = hpsu.party_site_id(+)
        AND hps.party_site_id =
          (SELECT hcasa.party_site_id
          FROM apps.hz_cust_acct_sites hcasa
          WHERE hcasa.cust_acct_site_id =
            (SELECT hcsua.cust_acct_site_id
            FROM apps.hz_cust_site_uses hcsua
            WHERE cia.bill_to_address = hcsua.site_use_id
        ) AS "SHIP_TO_STATE",
        (SELECT DISTINCT hl.country
        FROM hz_parties hp,
          hz_party_sites hps ,
          hz_party_site_uses hpsu ,
          hz_locations hl
        WHERE hp.party_id     = hps.party_id
        AND hps.location_id   = hl.location_id
        AND hps.party_site_id = hpsu.party_site_id(+)
        AND hps.party_site_id =
          (SELECT hcasa.party_site_id
          FROM apps.hz_cust_acct_sites hcasa
          WHERE hcasa.cust_acct_site_id =
            (SELECT hcsua.cust_acct_site_id
            FROM apps.hz_cust_site_uses hcsua
            WHERE cia.bill_to_address = hcsua.site_use_id
        ) AS "SHIP_TO_COUNTRY",
        (SELECT DISTINCT hl.city
        FROM hz_parties hp,
          hz_party_sites hps ,
          hz_party_site_uses hpsu ,
          hz_locations hl
        WHERE hp.party_id     = hps.party_id
        AND hps.location_id   = hl.location_id
        AND hps.party_site_id = hpsu.party_site_id(+)
        AND hps.party_site_id =
          (SELECT hcasa.party_site_id
          FROM apps.hz_cust_acct_sites hcasa
          WHERE hcasa.cust_acct_site_id =
            (SELECT hcsua.cust_acct_site_id
            FROM apps.hz_cust_site_uses hcsua
            WHERE cia.bill_to_address = hcsua.site_use_id
        ) AS "SHIP_TO_CITY",
        (SELECT DISTINCT hl.address1
        FROM hz_parties hp,
          hz_party_sites hps ,
          hz_party_site_uses hpsu ,
          hz_locations hl
        WHERE hp.party_id     = hps.party_id
        AND hps.location_id   = hl.location_id
        AND hps.party_site_id = hpsu.party_site_id(+)
        AND hps.party_site_id =
          (SELECT hcasa.party_site_id
          FROM apps.hz_cust_acct_sites hcasa
          WHERE hcasa.cust_acct_site_id =
            (SELECT hcsua.cust_acct_site_id
            FROM apps.hz_cust_site_uses hcsua
            WHERE cia.bill_to_address = hcsua.site_use_id
        ) AS "SHIP_TO_LOCATION",
        (SELECT DISTINCT hl.postal_code
        FROM hz_parties hp,
          hz_party_sites hps ,
          hz_party_site_uses hpsu ,
          hz_locations hl
        WHERE hp.party_id     = hps.party_id
        AND hps.location_id   = hl.location_id
        AND hps.party_site_id = hpsu.party_site_id(+)
        AND hps.party_site_id =
          (SELECT hcasa.party_site_id
          FROM apps.hz_cust_acct_sites hcasa
          WHERE hcasa.cust_acct_site_id =
            (SELECT hcsua.cust_acct_site_id
            FROM apps.hz_cust_site_uses hcsua
            WHERE cia.bill_to_address = hcsua.site_use_id
        ) AS "SHIP_TO_PIN_CODE",
        (SELECT DISTINCT hl.postal_code
        FROM hz_parties hp,
          hz_party_sites hps ,
          hz_party_site_uses hpsu ,
          hz_locations hl
        WHERE hp.party_id     = hps.party_id
        AND hps.location_id   = hl.location_id
        AND hps.party_site_id = hpsu.party_site_id(+)
        AND hps.party_site_id =
          (SELECT hcasa.party_site_id
          FROM apps.hz_cust_acct_sites hcasa
          WHERE hcasa.cust_acct_site_id =
            (SELECT hcsua.cust_acct_site_id
            FROM apps.hz_cust_site_uses hcsua
            WHERE cia.bill_to_address = hcsua.site_use_id
        ) AS "BILL_TO_PIN_CODE",
        (SELECT hcsua.LOCATION
        FROM apps.hz_cust_site_uses_all hcsua
        WHERE cia.ship_to_address = hcsua.site_use_id
        ) "SHIP_TO_NUMBER",
        (SELECT hcsua.LOCATION
        FROM apps.hz_cust_site_uses_all hcsua
        WHERE cia.bill_to_address = hcsua.site_use_id
        ) "BILL_TO_NUMBER",
        (SELECT DISTINCT hca.account_number
        FROM hz_cust_accounts hca
        WHERE hca.cust_account_id =
          (SELECT hcasa.cust_account_id
          FROM apps.hz_cust_acct_sites hcasa
          WHERE hcasa.cust_acct_site_id =
            (SELECT hcsua.cust_acct_site_id
            FROM apps.hz_cust_site_uses hcsua
            WHERE cia.bill_to_address = hcsua.site_use_id
        )AS "CUSTOMER_NUMBER", --------------------------CH-ID-1.1 ENDS -----------
        (SELECT civ.attribute_value
        FROM csi_iea_values civ,
          csi_i_extended_attribs ciea
        WHERE civ.attribute_id  = ciea.attribute_id
        AND ciea.attribute_code = '011 LICENSE NUMBER'
        AND civ.instance_id     = cii.instance_id
        ) AS "EA_LICENSE_NUMBER",
        (SELECT civ.attribute_value
        FROM csi_iea_values civ,
          csi_i_extended_attribs ciea
        WHERE civ.attribute_id  = ciea.attribute_id
        AND ciea.attribute_code = 'VA_SALES_ORDER_NUMBER'
        AND civ.instance_id     = cii.instance_id
        ) AS "EA_VA_SALES_ORDER_NUM",
        (SELECT NAME
        FROM hr_all_organization_units
        WHERE organization_id = cii.inv_master_organization_id
        ) master_organization_name
      FROM csi_item_instances cii,
        csi_systems_tl cst,
        --    MTL_SYSTEM_ITEMS_VL MSIKFV,
        --    MTL_SYSTEM_ITEMS MSI,
        mtl_system_items_b msi,
        hr_all_organization_units hou,
        oe_order_lines lool,
        oe_order_headers looh,
        wsh_delivery_details wdd,
        csi_i_parties cip,
        csi_ip_accounts cia
      WHERE cii.last_vld_organization_id = msi.organization_id
      AND cii.inventory_item_id          = msi.inventory_item_id
        --  AND CII.LAST_VLD_ORGANIZATION_ID   = MSIKFV.ORGANIZATION_ID
        --  AND CII.INVENTORY_ITEM_ID          = MSIKFV.INVENTORY_ITEM_ID
      AND hou.organization_id(+)    = cii.last_vld_organization_id
      AND cii.last_oe_order_line_id = lool.line_id
      AND lool.header_id            = looh.header_id
      AND cii.last_oe_order_line_id = wdd.source_line_id
        --      AND WDD.SOURCE_LINE_ID             = LOOL.LINE_ID
        --      AND WDD.SOURCE_HEADER_ID           = LOOH.HEADER_ID
      AND cii.instance_id               = cip.instance_id
      AND cii.system_id                 = cst.system_id(+)
      AND cip.party_source_table        = 'HZ_PARTIES'
      AND cip.relationship_type_code    = 'OWNER'
      AND cip.instance_party_id         = cia.instance_party_id
      AND cia.relationship_type_code(+) = 'OWNER'
      AND cii.instance_status_id        = 1052
      AND cst.language(+)               = 'US'
      AND cii.instance_id               = c_instance_id;
      CURSOR cur_get_ib_warranty (c_instance_id NUMBER)
      IS
        SELECT kh.contract_number,
          kh.scs_code,
          kh.start_date,
          kh.end_date,
          (kh.end_date-kh.start_date) duration,
          clet.NAME coverage_name,
          clet.item_description coverage_desc,
          b.segment1 service_name,
          t.description service_desc
        FROM okc_k_headers_b kh,
          okc_k_lines_b kl,
          okc_k_items ki,
          csi_item_instances c,
          mtl_system_items_b i,
          okc_k_lines_b cleb,
          okc_k_lines_tl clet,
          okc_k_items ki1,
          mtl_system_items_b_kfv b,
          mtl_system_items_tl t
        WHERE kh.contract_number_modifier IS NULL
        AND kh.ID                          = kl.dnz_chr_id
        AND kh.ID                          = ki.dnz_chr_id
        AND kl.ID                          = ki.cle_id
        AND ki.jtot_object1_code          IN ('OKX_CUSTPROD')
        AND c.last_vld_organization_id     = i.organization_id
        AND ki.object1_id1                 = TO_CHAR(c.instance_id)
        AND c.inventory_item_id            = i.inventory_item_id
        AND kl.cle_id                      = cleb.cle_id
        AND cleb.ID                        = clet.ID
        AND clet.language               = userenv('LANG')
        AND cleb.lse_id                   IN (2,15,20)
        AND cleb.cle_id                    = ki1.cle_id
        AND b.inventory_item_id            = t.inventory_item_id
        AND b.organization_id              = t.organization_id
        AND t.language                     = userenv('LANG')
        AND to_number(ki1.object1_id1)     = b.inventory_item_id
        AND to_number(ki1.object1_id2)     = b.organization_id
        AND c.instance_id                  = c_instance_id;
      --v1.2 comment ends
      CURSOR cur_get_to_date( c_req_id NUMBER,c_conc_prog_id NUMBER)
      IS
        SELECT requested_start_date
        FROM fnd_concurrent_requests
        WHERE request_id          = c_req_id
        AND concurrent_program_id = c_conc_prog_id;
      /*Record Type Declaration*/
    TYPE ib_ecs_dat_record
    IS
      record
        instance_id csi_item_instances.instance_id%TYPE,
        instance_number csi_item_instances.instance_number%TYPE,
        inventory_item_id csi_item_instances.inventory_item_id%TYPE,
        segment1 mtl_system_items_b.segment1%TYPE,
        description mtl_system_items_b.description%TYPE,
        master_organization_id csi_item_instances.inv_master_organization_id%TYPE,
        serial_number csi_item_instances.serial_number%TYPE,
        system_id csi_item_instances.system_id%TYPE,
        system_name csi_systems_tl.NAME%TYPE,
        quantity csi_item_instances.quantity%TYPE,
        uom csi_item_instances.unit_of_measure%TYPE,
        active_start_date csi_item_instances.active_start_date%TYPE,
        active_end_date csi_item_instances.active_end_date%TYPE,
        install_date csi_item_instances.install_date%TYPE,
        obj_version_num csi_item_instances.object_version_number%TYPE,
        last_vld_organization_id csi_item_instances.last_vld_organization_id%TYPE,
        pre_registration_location VARCHAR2(500),
        order_header_id oe_order_headers_all.header_id%TYPE,
        order_number oe_order_headers_all.order_number%TYPE,
        order_line_id csi_item_instances.last_oe_order_line_id%TYPE,
        actual_shipment_date oe_order_lines_all.actual_shipment_date%TYPE,
        email_address per_all_people_f.email_address%TYPE,
        bill_to_company_name hz_parties.party_name%TYPE,
        bill_to_site_id hz_party_sites.party_site_id%TYPE,
        bill_to_state hz_locations.state%TYPE,
        bill_to_country hz_locations.country%TYPE,
        bill_to_city hz_locations.city%TYPE,
        bill_to_location hz_locations.address1%TYPE,
        ship_to_company_name hz_parties.party_name%TYPE,
        ship_to_site_id hz_party_sites.party_site_id%TYPE,
        ship_to_state hz_locations.state%TYPE,
        ship_to_country hz_locations.country%TYPE,
        ship_to_city hz_locations.city%TYPE,
        ship_to_location hz_locations.address1%TYPE,
        ship_to_pin_code hz_locations.postal_code%TYPE,
        bill_to_pin_code hz_locations.postal_code%TYPE,
        ship_to_number hz_cust_site_uses_all.LOCATION%TYPE,
        bill_to_number hz_cust_site_uses_all.LOCATION%TYPE,
        customer_number hz_cust_accounts.account_number%TYPE,
        ea_license_number csi_iea_values.attribute_value%TYPE,
        ea_va_sales_order_num csi_iea_values.attribute_value%TYPE,
        master_organization_name hr_all_organization_units.NAME%TYPE );
    TYPE tab_typ_ib_ecs_dat
    IS
      TABLE OF ib_ecs_dat_record INDEX BY binary_integer;
    TYPE ib_parent_dat_record
    IS
      record
        creation_date DATE,
        last_update_date DATE,
        order_line_id csi_item_instances.last_oe_order_line_id%TYPE,
        inventory_item_id csi_item_instances.inventory_item_id%TYPE,
        instance_id csi_item_instances.instance_id%TYPE,
        instance_type_code csi_item_instances.instance_type_code%TYPE,
        segment1 mtl_system_items_b.segment1%TYPE );
    TYPE tab_typ_ib_parent_dat
    IS
      TABLE OF ib_parent_dat_record INDEX BY binary_integer;
      --/*Record Type Declaration*/
      --      TYPE parent_ib_record IS RECORD (
      --         creation_date           csi_item_instances.creation_date%TYPE,
      --         last_update_date        csi_item_instances.last_update_date%TYPE,
      --         inventory_item_id       csi_item_instances.inventory_item_id%TYPE,
      --         instance_id             csi_item_instances.instance_id%TYPE,
      --         instance_type_code      csi_item_instances.instance_type_code%TYPE,
      --         segment1                mtl_system_items_b.segment1%type
      --      TYPE tab_typ_par_ib_collection IS TABLE OF parent_ib_record
      --         INDEX BY BINARY_INTEGER;
      --      tab_par_ib_rec                   tab_typ_par_ib_collection;
      v_segment1 mtl_system_items_b.segment1%TYPE;
      v_request_id        NUMBER := fnd_global.conc_request_id;
      v_conc_prog_id      NUMBER := fnd_global.conc_program_id;
      v_created_by        NUMBER := fnd_profile.VALUE('USER_ID');
      v_last_update_login NUMBER := fnd_global.login_id;
      v_to DATE                  := SYSDATE;
      v_from DATE                := SYSDATE-100;
      v_count NUMBER             := NULL;
      --       v_header_id                        NUMBER := NULL;
      --       v_line_id                          NUMBER := NULL;
      --       v_org_id                           NUMBER := NULL;
      --       v_ship_from_org_id                 NUMBER := NULL;
      --v1.2 begin
      --       v_master_org_id                    NUMBER := NULL;
      --       v_item_type                        VARCHAR2(100) := null;
      --       v_top_model_line_id                NUMBER := NULL;
      --       v_serial_tag_number                VARCHAR2(100) := null;
    TYPE tbl_req_start_date_type
    IS
      TABLE OF DATE INDEX BY pls_integer;
      tbl_req_start_date tbl_req_start_date_type;
      --v1.2 ends
      --v1.3 starts
      --      v_flow_status_code                  VARCHAR2(100) := null;
      --      v_line_number                       NUMBER        := NULL;
      --      v_shipment_number                   NUMBER        := NULL;
      --      v_option_number                     NUMBER        := NULL;
      --      v_component_number                  NUMBER        := NULL;
      --      v_service_number                    NUMBER       := NULL;
      --v1.3 ends
      --      v_model_string                      VARCHAR2(100) := NULL;
      --      v_end_cust                          NUMBER := NULL;
      --      v_end_cust_site_id                  NUMBER := NULL;
      --      v_location_type_code                VARCHAR2(100) := null;
      --      v_location_id                       NUMBER := NULL;
      --      v_tag                               VARCHAR2(100) := NULL;
      --      v_inventory_item_status             VARCHAR2(100) := NULL;
      --      v_serial_number                     VARCHAR2(100) := NULL;
      --      v_serial_return                     VARCHAR2(200) := NULL;
      --rec_ext_attr      Rec_Ext_Attr_type ;
      v_ret_error_message VARCHAR2(2000):= NULL;
      v_ret_error_flag    VARCHAR2(1)   := NULL;
      v_error_message     VARCHAR2(2000):= NULL;
      v_error_flag        VARCHAR2(1)   := NULL;
      v_error_at          VARCHAR2(100) := NULL;
      --        v_to1                               DATE   := sysdate;
      --        v_from1                             DATE   := sysdate-45;
      tab_ib_parent_dat tab_typ_ib_parent_dat;
      tab_ib_ecs_dat tab_typ_ib_ecs_dat;
      tab_ib_ecs_dat_c tab_typ_ib_ecs_dat;
    BEGIN
      print_log('*********************************************************************');
      print_log('print log message 01');
      print_log('Process Starts... : '||to_date(SYSDATE,'DD-MON-YYYY HH24:MI:SS'));
      v_error_at := 'Start of the process';
      fnd_client_info.set_org_context(i_org_id);
      --  v1.2 begins, to get from date ----==----
      BEGIN
        print_log('print log message 02');
        --OPEN  get_from_date( v_request_id,v_conc_prog_id);
        --FETCH get_from_date INTO   v_from;
        --CLOSE get_from_date;
        v_error_at := 'main Process/ before from ';
        --        v_from := Sysdate-15;
        v_from := SYSDATE-45;
        --Added v1.4 ,AND    ARGUMENT1 = i_org_id
        SELECT
          /*+ index(a FND_CONCURRENT_REQUESTS_N6) index(a FND_CONCURRENT_REQUESTS_N7)*/
          requested_start_date BULK COLLECT
        INTO tbl_req_start_date
        FROM fnd_concurrent_requests
        WHERE request_id            < v_request_id
        AND concurrent_program_id   = v_conc_prog_id
        AND argument1               = i_org_id
        AND status_code             ='C'
        AND phase_code              ='C';
        v_error_at                 := 'main Process/ after from selection ';
        IF tbl_req_start_date.count >0 THEN
          FOR i                    IN tbl_req_start_date.FIRST .. tbl_req_start_date.LAST
          LOOP
            IF v_from < tbl_req_start_date(i) THEN
              v_from := tbl_req_start_date(i);
              print_log( 'Tabel Req StartDate : '||tbl_req_start_date(i));
              print_log( 'In the Loop VFrom : '||v_from);
            END IF;
          END LOOP;
        END IF;
        v_error_at := 'main Process/ after from Loop ';
        print_log( 'Out the loop v_from is : '||v_from);
      EXCEPTION
      WHEN no_data_found THEN
        print_log('Error in  from_date process exception : '||sqlerrm);
        print_log('Error at : '||v_error_at);
        v_from := NULL;
      WHEN OTHERS THEN
        print_log('Error in  from_date process exception : '||sqlerrm);
        print_log('Error at : '||v_error_at);
        v_from := NULL;
      END;
      -- v1.2 ends---==----
      print_log('print log message 03');
      BEGIN
        OPEN cur_get_to_date ( v_request_id,v_conc_prog_id);
        FETCH cur_get_to_date INTO v_to;
        CLOSE cur_get_to_date;
        --v1.3 starts
        v_update_date := v_to -(1/86400);
        --v1.3 ends
        v_error_at := 'main Process/ after from and to date';
        print_log('v_from1... : '||TO_CHAR(v_from,'DD-MON-YYYY HH24:MI:SS'));
        print_log('v_to1  ... : '||TO_CHAR(v_to ,'DD-MON-YYYY HH24:MI:SS'));
        --v1.3 starts
        print_log('Updated v_to  ... : '||TO_CHAR(v_update_date ,'DD-MON-YYYY HH24:MI:SS'));
        --v1.3 ends
      EXCEPTION
      WHEN no_data_found THEN
        print_log('Error in  main process1 : '||sqlerrm);
        print_log('Error at : '||v_error_at);
      WHEN OTHERS THEN
        print_log('Error in  main process1 : '||sqlerrm);
        print_log('Error at : '||v_error_at);
      END;
      BEGIN
        print_log('print log message 04');
        OPEN cur_get_parent_ib_rec(v_from ,v_to);
        LOOP
          print_log('After Loop Get Records v_from... : '||TO_CHAR(v_from,'DD-MON-YYYY HH24:MI:SS'));
          print_log('After Loop Get Records v_to  ... : '||TO_CHAR(v_to ,'DD-MON-YYYY HH24:MI:SS'));
          FETCH cur_get_parent_ib_rec BULK COLLECT INTO tab_ib_parent_dat;
          print_log('Parent Instance first : ');
          --  FOR i IN 1 .. tab_ib_parent_dat.COUNT
          print_log('print log message 05');
          FOR i IN tab_ib_parent_dat.FIRST .. tab_ib_parent_dat.LAST
          LOOP
            BEGIN
              print_log('Parent Instance : '||tab_ib_parent_dat(i).instance_id);
              print_log('====================================================================');
              v_error_at       := 'main Process/ start of the loop';
              v_ret_error_flag := NULL;
              v_segment1       := NULL;
            EXCEPTION
            WHEN no_data_found THEN
              print_log('Error in  main process exception1 : '||sqlerrm);
              print_log('Error at : '||v_error_at);
            WHEN OTHERS THEN
              print_log('Error in  main process exception1 : '||sqlerrm);
              print_log('Error at : '||v_error_at);
            END;
            OPEN cur_get_outbound_data(tab_ib_parent_dat(i).instance_id);
            LOOP
              FETCH cur_get_outbound_data BULK COLLECT INTO tab_ib_ecs_dat;
              --FOR j IN 1 .. tab_ib_ecs_dat.COUNT
              FOR j IN tab_ib_ecs_dat.FIRST .. tab_ib_ecs_dat.LAST
              LOOP
                BEGIN
                BEGIN
                     SELECT COUNT(1)
                      INTO v_count
                      FROM apps.xxcsi_trex_ob_ecs_mhm
                      WHERE instance_id  = NVL(tab_ib_ecs_dat_c(j).instance_id,'');
                    EXCEPTION
                    WHEN OTHERS THEN
                      v_count := 0;
                    END;
                    print_log('v_count : '||v_count);
                    IF v_count = 0 THEN
                  --        print_log('PARENT_DAT: '||NVL(tab_ib_ecs_dat(j).instance_id);
            print_log('print log message 06');
                  INSERT
                  INTO xxcsi_trex_ob_ecs_mhm
                      instance_id,
                      instance_number,
                      inventory_item_id,
                      unit,
                      unit_name,
                      master_organization_id,
                      serial_number,
                      quantity,
                      uom,
                      active_start_date,
                      active_end_date,
                      install_date,
                      object_version_number,
                      last_vld_organization_id,
                      pre_registration_location,
                      order_header_id,
                      order_number,
                      order_line_id,
                      pre_registration_date,
                      pre_registration_operator,
                      bill_to_customer_name,
                      bill_to_site_id ,
                      bill_to_state ,
                      bill_to_country ,
                      bill_to_city ,
                      bill_to_location ,
                      ship_to_customer_name,
                      ship_to_site_id ,
                      ship_to_state ,
                      ship_to_country ,
                      ship_to_city ,
                      ship_to_location,
                      ship_to_pin_code,
                      bill_to_pin_code,
                      ship_to_number,
                      bill_to_number,
                      customer_number,
                      ea_license_number,
                      ea_va_sales_order_number,
                      parent_instance_id,
                      parent_y_n,
                      process_flag,
                      error_code,
                      error_details,
                      request_id,
                      created_by,
                      creation_date,
                      last_updated_by,
                      last_update_date,
                      last_update_login,
                      eai_process_flag,
                      master_organization_name,
                      system_id,
                      system_name
                    VALUES
                      NVL(tab_ib_ecs_dat(j).instance_id,''),
                      NVL(tab_ib_ecs_dat(j).instance_number,''),
                      NVL(tab_ib_ecs_dat(j).inventory_item_id,''),
                      NVL(tab_ib_ecs_dat(j).segment1,''),
                      NVL(tab_ib_ecs_dat(j).description,''),
                      NVL(tab_ib_ecs_dat(j).master_organization_id,''),
                      NVL(tab_ib_ecs_dat(j).serial_number,''),
                      NVL(tab_ib_ecs_dat(j).quantity,''),
                      NVL(tab_ib_ecs_dat(j).uom,''),
                      NVL(tab_ib_ecs_dat(j).active_start_date,''),
                      NVL(tab_ib_ecs_dat(j).active_end_date,''),
                      NVL(tab_ib_ecs_dat(j).install_date,''),
                      NVL(tab_ib_ecs_dat(j).obj_version_num,''),
                      NVL(tab_ib_ecs_dat(j).last_vld_organization_id,''),
                      NVL(tab_ib_ecs_dat(j).pre_registration_location,''),
                      NVL(tab_ib_ecs_dat(j).order_header_id,''),
                      NVL(tab_ib_ecs_dat(j).order_number,''),
                      NVL(tab_ib_ecs_dat(j).order_line_id,''),
                      NVL(tab_ib_ecs_dat(j).actual_shipment_date,''),
                      NVL(tab_ib_ecs_dat(j).email_address,''),
                      NVL(tab_ib_ecs_dat(j).bill_to_company_name,''),
                      NVL(tab_ib_ecs_dat(j).bill_to_site_id,''),
                      NVL(tab_ib_ecs_dat(j).bill_to_state,''),
                      NVL(tab_ib_ecs_dat(j).bill_to_country,''),
                      NVL(tab_ib_ecs_dat(j).bill_to_city,''),
                      NVL(tab_ib_ecs_dat(j).bill_to_location,''),
                      NVL(tab_ib_ecs_dat(j).ship_to_company_name,''),
                      NVL(tab_ib_ecs_dat(j).ship_to_site_id,''),
                      NVL(tab_ib_ecs_dat(j).ship_to_state,''),
                      NVL(tab_ib_ecs_dat(j).ship_to_country,''),
                      NVL(tab_ib_ecs_dat(j).ship_to_city,''),
                      NVL(tab_ib_ecs_dat(j).ship_to_location,''),
                      NVL(tab_ib_ecs_dat(j).ship_to_pin_code,''),
                      NVL(tab_ib_ecs_dat(j).bill_to_pin_code,''),
                      NVL(tab_ib_ecs_dat(j).ship_to_number,''),
                      NVL(tab_ib_ecs_dat(j).bill_to_number,''),
                      NVL(tab_ib_ecs_dat(j).customer_number,''),
                      NVL(tab_ib_ecs_dat(j).ea_license_number,''),
                      NVL(tab_ib_ecs_dat(j).ea_va_sales_order_num,''),
                      NULL,
                      'P',
                      'N',
                      NULL,
                      NULL,
                      v_request_id,
                      v_created_by,
                      SYSDATE,
                      v_created_by,
                      SYSDATE,
                      v_last_update_login,
                      'N',
                      NVL(tab_ib_ecs_dat(j).master_organization_name,''),
                      NVL(tab_ib_ecs_dat(j).system_id,''),
                      NVL(tab_ib_ecs_dat(j).system_name,'')
    ELSE
    Update apps.xxcsi_trex_ob_ecs_mhm set 
                    instance_id=NVL(tab_ib_ecs_dat_c(j).instance_id,''),
      instance_number= NVL(tab_ib_ecs_dat_c(j).instance_number,''),
                    inventory_item_id= NVL(tab_ib_ecs_dat_c(j).inventory_item_id,''),
                    unit      = NVL(tab_ib_ecs_dat_c(j).segment1,''),
                    unit_name =  NVL(tab_ib_ecs_dat_c(j).description,''),
                    master_organization_id=NVL(tab_ib_ecs_dat_c(j).master_organization_id,''),
                    --serial_number=NVL(tab_ib_ecs_dat_c(j).serial_number,''),
                    quantity= NVL(tab_ib_ecs_dat_c(j).quantity,''),
                    uom=NVL(tab_ib_ecs_dat_c(j).uom,''),
                    active_start_date= NVL(tab_ib_ecs_dat_c(j).active_start_date,''),
                    active_end_date= NVL(tab_ib_ecs_dat_c(j).active_end_date,''),
                    install_date= NVL(tab_ib_ecs_dat_c(j).install_date,''),
                    object_version_number=NVL(tab_ib_ecs_dat_c(j).obj_version_num,''),
                    last_vld_organization_id= NVL(tab_ib_ecs_dat_c(j).last_vld_organization_id,''),
                    pre_registration_location=NVL(tab_ib_ecs_dat_c(j).pre_registration_location,''),
                    order_header_id=NVL(tab_ib_ecs_dat_c(j).order_header_id,''),
                    order_number= NVL(tab_ib_ecs_dat_c(j).order_number,''),
                    order_line_id=NVL(tab_ib_ecs_dat_c(j).order_line_id,''),
                    pre_registration_date= NVL(tab_ib_ecs_dat_c(j).actual_shipment_date,''),
                    pre_registration_operator= NVL(tab_ib_ecs_dat_c(j).email_address,''),
                    bill_to_customer_name=NVL(tab_ib_ecs_dat_c(j).bill_to_company_name,''),
                    bill_to_site_id = NVL(tab_ib_ecs_dat_c(j).bill_to_site_id,''),
                    bill_to_state = NVL(tab_ib_ecs_dat_c(j).bill_to_state,''),
                    bill_to_country =NVL(tab_ib_ecs_dat_c(j).bill_to_country,''),
                    bill_to_city = NVL(tab_ib_ecs_dat_c(j).bill_to_city,''),
                    bill_to_location =  NVL(tab_ib_ecs_dat_c(j).bill_to_location,''),
                    ship_to_customer_name=NVL(tab_ib_ecs_dat_c(j).ship_to_company_name,''),
                    ship_to_site_id = NVL(tab_ib_ecs_dat_c(j).ship_to_site_id,''),
                    ship_to_state =NVL(tab_ib_ecs_dat_c(j).ship_to_state,''),
                    ship_to_country=NVL(tab_ib_ecs_dat_c(j).ship_to_country,''),
                    ship_to_city =NVL(tab_ib_ecs_dat_c(j).ship_to_city,''),
                    ship_to_location= NVL(tab_ib_ecs_dat_c(j).ship_to_location,''),
      ship_to_pin_code= NVL(tab_ib_ecs_dat_c(j).ship_to_pin_code,''),
      bill_to_pin_code=NVL(tab_ib_ecs_dat_c(j).bill_to_pin_code,''),
      ship_to_number=NVL(tab_ib_ecs_dat_c(j).ship_to_number,''),
      bill_to_number= NVL(tab_ib_ecs_dat_c(j).bill_to_number,''),
      customer_number= NVL(tab_ib_ecs_dat_c(j).customer_number,''),
      ea_license_number= NVL(tab_ib_ecs_dat_c(j).ea_license_number,''),
      ea_va_sales_order_number= NVL(tab_ib_ecs_dat_c(j).ea_va_sales_order_num,''),
      parent_instance_id=NVL(tab_ib_parent_dat(i).instance_id,''),
      parent_y_n='C',
      process_flag='N',
      error_code= NULL,
      error_details= NULL,
      request_id=v_request_id,
      created_by=v_created_by,
      creation_date= SYSDATE,
      last_updated_by=v_created_by,
      last_update_date=SYSDATE,
      last_update_login= v_last_update_login,
      eai_process_flag='Y',
      master_organization_name=NVL(tab_ib_ecs_dat_c(j).master_organization_name,''),
      system_id= NVL(tab_ib_ecs_dat_c(j).system_id,''),
      system_name= NVL(tab_ib_ecs_dat_c(j).system_name,'')
      WHERE instance_id  = NVL(tab_ib_ecs_dat_c(j).instance_id,'');
      END IF; --V_COUNT
                EXCEPTION
                WHEN no_data_found THEN
                  print_log('Error in inserting Parent Instance : '||tab_ib_ecs_dat(j).instance_id||': '||sqlerrm);
                WHEN OTHERS THEN
                  print_log('Error in inserting Parent Instance : '||tab_ib_ecs_dat(j).instance_id||': '||sqlerrm);
                END;
                --      END LOOP;
              END LOOP;
              EXIT
            WHEN cur_get_outbound_data%notfound;
            END LOOP;
            CLOSE cur_get_outbound_data;
            print_log('print log message 07');
            BEGIN
              FOR rec_get_child_ib_rec IN cur_get_child_ib_rec
                tab_ib_parent_dat(i).instance_id
              LOOP
                print_log
                  'cur_get_child_ib_rec : '||tab_ib_parent_dat(i).instance_id
                OPEN cur_get_outbound_data(rec_get_child_ib_rec.subject_id);
                LOOP
                  FETCH cur_get_outbound_data BULK COLLECT INTO tab_ib_ecs_dat_c;
                  --            tab_ib_ecs_dat_c1 := tab_ib_ecs_dat_c;
                  --            FOR k IN 1 .. tab_ib_ecs_dat_c.COUNT
                  FOR k IN tab_ib_ecs_dat_c.FIRST .. tab_ib_ecs_dat_c.LAST
                  LOOP
                    print_log('Child Instance : '||tab_ib_ecs_dat_c(k).instance_id);
                    --        BEGIN
                    BEGIN
                      SELECT COUNT(1)
                      INTO v_count
                      FROM apps.xxcsi_trex_ob_ecs_mhm
                      WHERE instance_id  = NVL(tab_ib_ecs_dat_c(k).instance_id,'');
                    EXCEPTION
                    WHEN OTHERS THEN
                      v_count := 0;
                    END;
                    print_log('v_count : '||v_count);
                    IF v_count = 0 THEN
                      BEGIN
                        INSERT
                        INTO xxcsi_trex_ob_ecs_mhm
                            instance_id,
                            instance_number,
                            inventory_item_id,
                            unit,
                            unit_name,
                            master_organization_id,
                            serial_number,
                            quantity,
                            uom,
                            active_start_date,
                            active_end_date,
                            install_date,
                            object_version_number,
                            last_vld_organization_id,
                            pre_registration_location,
                            order_header_id,
                            order_number,
                            order_line_id,
                            pre_registration_date,
                            pre_registration_operator,
                            bill_to_customer_name,
                            bill_to_site_id ,
                            bill_to_state ,
                            bill_to_country ,
                            bill_to_city ,
                            bill_to_location ,
                            ship_to_customer_name,
                            ship_to_site_id ,
                            ship_to_state ,
                            ship_to_country ,
                            ship_to_city ,
                            ship_to_location ,
                            ship_to_pin_code,
                            bill_to_pin_code,
                            ship_to_number,
                            bill_to_number,
                            customer_number,
                            ea_license_number,
                            ea_va_sales_order_number,
                            parent_instance_id,
                            parent_y_n,
                            process_flag,
                            error_code,
                            error_details,
                            request_id,
                            created_by,
                            creation_date,
                            last_updated_by,
                            last_update_date,
                            last_update_login,
                            eai_process_flag,
                            master_organization_name,
                            system_id,
                            system_name
                          VALUES
                            NVL(tab_ib_ecs_dat_c(k).instance_id,''),
                            NVL(tab_ib_ecs_dat_c(k).instance_number,''),
                            NVL(tab_ib_ecs_dat_c(k).inventory_item_id,''),
                            NVL(tab_ib_ecs_dat_c(k).segment1,''),
                            NVL(tab_ib_ecs_dat_c(k).description,''),
                            NVL(tab_ib_ecs_dat_c(k).master_organization_id,''),
                            NVL(tab_ib_ecs_dat_c(k).serial_number,''),
                            NVL(tab_ib_ecs_dat_c(k).quantity,''),
                            NVL(tab_ib_ecs_dat_c(k).uom,''),
                            NVL(tab_ib_ecs_dat_c(k).active_start_date,''),
                            NVL(tab_ib_ecs_dat_c(k).active_end_date,''),
                            NVL(tab_ib_ecs_dat_c(k).install_date,''),
                            NVL(tab_ib_ecs_dat_c(k).obj_version_num,''),
                            NVL(tab_ib_ecs_dat_c(k).last_vld_organization_id,''),
                            NVL(tab_ib_ecs_dat_c(k).pre_registration_location,''),
                            NVL(tab_ib_ecs_dat_c(k).order_header_id,''),
                            NVL(tab_ib_ecs_dat_c(k).order_number,''),
                            NVL(tab_ib_ecs_dat_c(k).order_line_id,''),
                            NVL(tab_ib_ecs_dat_c(k).actual_shipment_date,''),
                            NVL(tab_ib_ecs_dat_c(k).email_address,''),
                            NVL(tab_ib_ecs_dat_c(k).bill_to_company_name,''),
                            NVL(tab_ib_ecs_dat_c(k).bill_to_site_id,''),
                            NVL(tab_ib_ecs_dat_c(k).bill_to_state,''),
                            NVL(tab_ib_ecs_dat_c(k).bill_to_coun

    The logic is:
    1. Create any new lookup table rows that may be needed
    2. Create new data rows that reference the lookup table
    All you did was post a buch of code. You didn't post ANYTHING that shows how you executed that code or what the result was.
    You need to SHOW US (not tell us):
    1. WHAT you do
    2. HOW you do it
    3. WHAT results you get
    4. WHAT results you expected to get
    The code you posted has some SERIOUS ISSUES. Here are just three of them
    1. You are using BULK COLLECT without a LIMIT clause
    2. You are using unnecessary IF . . .COUNT statements to test collections for values. The FOR clause will simply NOT execute if the collection is empty so the IF statements add unnecessary clutter.
    3. The first loop iterates a collection but sets a single SCALAR value - making that loop totally USELESS
    LOOP
            IF v_from < tbl_req_start_date(i) THEN
              v_from := tbl_req_start_date(i);
              print_log( 'Tabel Req StartDate : '||tbl_req_start_date(i));
              print_log( 'In the Loop VFrom : '||v_from);
            END IF;
          END LOOP;
    That checks EVERY row in the collection and appears to save the MAX value of 'tbl_req_state_date' into the 'v_from' variable.
    What is the point of that?

  • Item Conversion Template Issue for Oracle Migration - Copy functionality

    Hi,
    I am working on Migration project which is from Radius ERP to Oracle 11.5.10.2.
    Currently working on Item Conversion. This Item conversion having the fileds like (ORGANIZATION_ID,SEGMENT1,DESCRIPTION,ITEM_TYPE,COST_OF_SALES_ACCOUNT,SALES_ACCOUNT,ATTRIBUTE_CATEGORY,ATTRIBUTE1,ATTRIBUTE2,ATTRIBUTE3,ATTRIBUTE4,ATTRIBUTE5,ATTRIBUTE6,ATTRIBUTE7,ATTRIBUTE8,ATTRIBUTE9,ATTRIBUTE10,ATTRIBUTE11,ATTRIBUTE12,ATTRIBUTE13,ATTRIBUTE14,ATTRIBUTE15,GLOBAL_ATTRIBUTE10,REF_INVENTORY_ITEM_ID,REF_ORGANIZATION_ID).
    I have validated those fields and loaded into interfacing to Oracle Successfully in the master Org and Validated through Frontend.
    when I close the form, I will be receiving the below warning message and telling that Template id needs to be assign to the item before assigning item to the Org. The message is showing like
    "*You have not applied a template to this item, please apply a template before assigning this item to an ORG.*"
    Please find the below package which I wrote for this conversion requirement.
    The customer is saying like need to achieve the copy functionality based on the "REF_INVENTORY_ITEM_ID and REF_ORGANIZATION_ID".
    The Issue is am not able to handle the copy functionality and getting above message. kindly refer the package and suggest me where i am doing the mistake. Its high priority issue for me.
    Thanks in advance.
    CREATE OR REPLACE PACKAGE APPS.xxxx_inv_items_conv_pkg
    AS
    PROCEDURE xxx_item_conversion_proc (
    errbuf OUT VARCHAR2,
    retcode OUT VARCHAR2,
    p_org_id IN NUMBER,
    -- p_commit_point IN NUMBER,
    p_load_code IN VARCHAR2
    IS
    <<Local Variables Declaration>> <<For space limit deleted these variables>>
    CURSOR cur_item_master (pc_org_code VARCHAR2)
    IS
    SELECT itemstg.*
    FROM xxx_inv_system_items_stg itemstg
    WHERE itemstg.organization_id = pc_org_code
    AND itemstg.status_flag IS NULL;
    CURSOR cur_item_master_dup (pc_org_code VARCHAR2)
    IS
    SELECT itemstg.segment1, itemstg.organization_id
    FROM xxx_inv_system_items_stg itemstg
    WHERE itemstg.ROWID <
    (SELECT MAX (b.ROWID)
    FROM xxx_inv_system_items_stg b
    WHERE b.segment1 = itemstg.segment1
    AND b.organization_id = itemstg.organization_id
    AND b.organization_id = pc_org_code
    AND itemstg.status_flag IS NULL
    AND b.status_flag IS NULL);
    BEGIN
    IF p_load_code = 'Insert'
    THEN
    l_transaction_type := 'CREATE'; -- Default Value in I/F Table
    ELSIF p_load_code = 'Update'
    THEN
    l_transaction_type := 'UPDATE'; -- Default Value in I/F Table
    END IF;
    DBMS_OUTPUT.put_line ( 'Validation Starts At :'
    || TO_CHAR (SYSDATE, 'DD-MON-YYYY HH24:MI:SS')
    --Checking for Duplicate Records items
    BEGIN
    UPDATE xxx_inv_system_items_stg a
    SET a.status_flag = 'E',
    a.error_message = 'Duplicate Record'
    WHERE a.ROWID >
    ANY (SELECT b.ROWID
    FROM xxx_inv_system_items_stg b
    WHERE a.segment1 = b.segment1
    AND a.organization_id = b.organization_id)
    AND a.organization_id = p_org_id
    AND a.status_flag IS NULL;
    EXCEPTION
    WHEN OTHERS
    THEN
    DBMS_OUTPUT.put_line ('Exception in updating duplicates'
    || SQLERRM
    END;
    DBMS_OUTPUT.put_line ('CheckPoint: Duplicate Record');
    BEGIN
    SELECT organization_id
    INTO l_organization_id
    FROM org_organization_definitions
    WHERE organization_id = p_org_id;
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    DBMS_OUTPUT.PUT_LINE(p_org_id||' Org Does Not Exist');
    -- p_retcode := '2';
    WHEN OTHERS
    THEN
    DBMS_OUTPUT.PUT_LINE('Exception in Getting Org Id'||'Cannot Proceed');
    -- p_retcode := '2';
    END ;
    DBMS_OUTPUT.put_line ('CheckPoint: Orgcode' || l_organization_id);
    /* IF p_retcode = '2'
    THEN
    RETURN;
    END IF;*/
    --Block             : Setting Master and Validation Orgs Flags
    BEGIN
    SELECT DECODE (master_organization_id, l_organization_id, 'Y', 'N'),
    master_organization_id
    INTO l_master_org,
    l_master_org_id
    FROM mtl_parameters
    WHERE organization_id = l_organization_id;
    EXCEPTION
    WHEN OTHERS
    THEN
    l_master_org := 'N';
    l_master_org_id := NULL;
    DBMS_OUTPUT.PUT_LINE(p_org_id||' Org Does Not Exist');
    END ;
    DBMS_OUTPUT.put_line ('master_organization_id');
    SELECT fnd_profile.VALUE ('USER_ID')
    INTO l_user_id
    FROM DUAL;
    -- Block : Set the SET_PROCESS_ID
    l_set_process_id := l_organization_id;
    l_insert_count := 0;
    LOOP
    BEGIN
    SELECT COUNT (segment1)
    INTO l_insert_count
    FROM mtl_system_items_interface
    WHERE set_process_id = l_set_process_id
    AND transaction_type = l_transaction_type
    AND process_flag = 1;
    EXCEPTION
    WHEN OTHERS
    THEN
    l_insert_count := 0;
    END;
    EXIT WHEN l_insert_count = 0;
    l_set_process_id := l_set_process_id + 10;
    END LOOP;
    DBMS_OUTPUT.put_line ('SET PROCESS ID -l_insert_count ' || l_insert_count);
    IF p_load_code = 'Insert'
    THEN
    BEGIN
    FOR recitem_data IN cur_item_master_dup (p_org_id)
    LOOP
    UPDATE xxx_inv_system_items_stg
    SET status_flag = l_processed_flag,
    error_message = l_error_message
    WHERE segment1 = recitem_data.segment1
    AND organization_id = recitem_data.organization_id
    AND status_flag IS NULL;
    COMMIT;
    END LOOP;
    EXCEPTION
    WHEN OTHERS
    THEN
    DBMS_OUTPUT.put_line ( 'Update of Duplicates Failed : '
    || SQLCODE
    || '--'
    || SQLERRM
    END ;
    END IF;
    FOR recitem_data IN cur_item_master (p_org_id)
    LOOP
    <<Local Variables Declaration>> <<For space limit deleted these variables>>
    IF p_load_code = 'Update'
    THEN
    l_error_message := 'Update Mode' || l_error_delimiter;
    END IF;
    --l_count := -1;
    BEGIN
    DBMS_OUTPUT.put_line ('CheckPoint: ItemValidationStart');
    SELECT DISTINCT inventory_item_id,
    restrict_subinventories_code,
    restrict_locators_code
    INTO l_inventory_item_id,
    l_restrict_subinventories_code,
    l_restrict_locators_code
    FROM apps.mtl_system_items_b msi
    WHERE msi.organization_id = l_organization_id
    AND msi.segment1 = UPPER (recitem_data.segment1);
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    l_count := 0;
    -- l_processed_flag := 'F';
    DBMS_OUTPUT.put_line ('inventory_item_id - AFTER MAIN LOOP' || l_inventory_item_id||'-'||l_processed_flag);
    DBMS_OUTPUT.put_line ('inventory_item_id - AFTER MAIN LOOP' || l_inventory_item_id||'-'||recitem_data.ref_inventory_item_id);
    WHEN OTHERS
    THEN
    l_count := -1;
    -- l_processed_flag := 'F';
    DBMS_OUTPUT.put_line ('inventory_item_id - AFTER MAIN LOOP' || l_inventory_item_id||'-'||l_processed_flag);
    END ;
    DBMS_OUTPUT.put_line ('inventory_item_id - AFTER MAIN LOOP'||recitem_data.ref_inventory_item_id);
    IF l_count = -1
    THEN
    l_processed_flag := 'F';
    l_error_message :=
    l_error_message
    || 'Exception - Checking Item already Present'
    || l_error_delimiter;
    DBMS_OUTPUT.put_line ('Exception - Checking Item already Present'||l_processed_flag);
    ELSIF (l_count > 0 AND p_load_code = 'Insert')
    THEN
    l_processed_flag := 'F';
    l_error_message :=
    l_error_message
    || 'Item Already Exists In '
    || p_org_id
    || ' Organization '
    || l_error_delimiter;
    DBMS_OUTPUT.put_line ('Exception - Checking Item already Present1'||l_processed_flag);
    ELSIF (l_count = 0 AND p_load_code = 'Update')
    THEN
    l_processed_flag := 'F';
    l_error_message :=
    l_error_message
    || 'Item Not Present In '
    || p_org_id
    || ' Organization '
    || l_error_delimiter;
    DBMS_OUTPUT.put_line ('Exception - Checking Item already Present2'||l_processed_flag);
    END IF;
    BEGIN
    SELECT count(*)
    INTO l_seg_count
    FROM apps.mtl_system_items_b msi
    WHERE msi.organization_id = l_organization_id
    AND msi.segment1 = UPPER (recitem_data.segment1);
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    l_seg_count := 0;
    l_processed_flag:='F';
    l_error_message :=
    l_error_message
    || 'Item Not Present In Oracle'
    || p_org_id
    || ' Organization '
    || l_error_delimiter;
    DBMS_OUTPUT.put_line ('inventory_item_id - l_seg_count ' ||l_seg_count||'-'||l_processed_flag );
    WHEN OTHERS
    THEN
    l_seg_count := -1;
    l_processed_flag:='F';
    l_error_message :=
    l_error_message
    || 'Item Not Present In Oracle'
    || p_org_id
    || ' Organization '
    || l_error_delimiter;
    END ;
    IF p_load_code = 'Insert'
    THEN
    IF l_organization_id != l_master_org_id
    THEN
    BEGIN
    SELECT COUNT (1)
    INTO l_org_item_count
    FROM apps.mtl_system_items_b msi
    WHERE msi.organization_id = l_master_org_id
    AND msi.segment1 = UPPER (recitem_data.segment1);
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    l_org_item_count := 0;
    DBMS_OUTPUT.put_line ('l_org_item_count ' ||l_org_item_count||'-'||l_processed_flag );
    WHEN OTHERS
    THEN
    l_org_item_count := -1;
    END ;
    IF l_org_item_count = -1
    THEN
    l_processed_flag := 'F';
    l_error_message :=
    l_error_message
    || 'Exception - Checking Item in Master '
    || l_error_delimiter;
    ELSIF l_org_item_count = 0
    THEN
    l_processed_flag := 'F';
    l_error_message :=
    l_error_message
    || 'Item Does Not Exist in Master '
    || l_error_delimiter;
    END IF;
    END IF;
    END IF;
    DBMS_OUTPUT.put_line ( 'CheckPoint: Iteminmasterorg'
    || l_org_item_count
    IF (recitem_data.description IS NULL AND p_load_code = 'Insert')
    THEN
    l_processed_flag := 'F';
    l_error_message :=
    l_error_message || 'Description is NULL' || l_error_delimiter;
    END IF;
    IF (recitem_data.sales_account IS NOT NULL)
    THEN
    BEGIN
    SELECT code_combination_id
    INTO l_sales_account
    FROM gl_code_combinations_kfv
    WHERE code_combination_id= recitem_data.sales_account;
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    -- l_processed_flag := 'F'; --QUESTION
    l_error_message :=
    l_error_message
    || 'Sales Account Not Setup '
    || l_error_delimiter;
    DBMS_OUTPUT.put_line ( 'CheckPoint: Salesacct_Validation'
    || l_sales_account||'-'||l_processed_flag
    WHEN OTHERS
    THEN
    l_processed_flag := 'F';
    l_error_message :=
    l_error_message
    || 'Sales Account Exception '
    || SQLERRM
    || l_error_delimiter;
    DBMS_OUTPUT.put_line ( 'CheckPoint: Salesacct_Validation'
    || l_sales_account||'-'||l_processed_flag
    END ;
    END IF;
    IF (recitem_data.cost_of_sales_account IS NOT NULL)
    THEN
    BEGIN
    SELECT code_combination_id
    INTO l_cost_of_sales_account
    FROM gl_code_combinations_kfv
    WHERE code_combination_id =
    recitem_data.cost_of_sales_account;
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    l_processed_flag := 'F';
    l_error_message :=
    l_error_message
    || 'COGS Account Not Setup '
    || l_error_delimiter;
    DBMS_OUTPUT.put_line ( 'l_cost_of_sales_account'
    || l_cost_of_sales_account||'-'||l_processed_flag
    WHEN OTHERS
    THEN
    l_processed_flag := 'F';
    l_error_message :=
    l_error_message
    || 'COGS Account Exception '
    || SQLERRM
    || l_error_delimiter;
    DBMS_OUTPUT.put_line ( 'l_cost_of_sales_account'
    || l_cost_of_sales_account||'-'||l_processed_flag
    END check_cogs_account;
    END IF;
    BEGIN
    select distinct organization_code
    into l_ref_org_code
    from org_organization_definitions
    where organization_id = recitem_data.ref_organization_id ;
    EXCEPTION
    WHEN OTHERS THEN
    l_ref_org_code:= NULL;
    l_processed_flag:='F';
    l_error_message :=
    l_error_message
    || 'Reference Org Not Present'
    || p_org_id
    || ' Organization '
    || l_error_delimiter ;
    DBMS_OUTPUT.put_line ('l_ref_org_code'|| l_ref_org_code||'-'||l_processed_flag);
    END;
    BEGIN
    select concatenated_segments
    into l_ref_inventory_item_code
    from mtl_system_items_kfv
    where inventory_item_id = recitem_data.ref_inventory_item_id
    and organization_id = recitem_data.ref_organization_id ;
    EXCEPTION
    WHEN OTHERS THEN
    l_ref_inventory_item_code :=NULL;
    l_processed_flag:='F';
    l_error_message :=
    l_error_message
    || 'Reference Item Not Present'
    || p_org_id
    || ' Organization '
    || l_error_delimiter;
    DBMS_OUTPUT.put_line ('l_ref_inventory_item_code'|| l_ref_inventory_item_code||'-'||l_processed_flag);
    END;
    IF (l_master_org = 'N' AND p_load_code = 'Insert')
    THEN
    BEGIN
    SELECT count(*)
    INTO l_description_count
    FROM mtl_system_items_tl
    WHERE organization_id = l_master_org_id
    AND inventory_item_id =
    (SELECT inventory_item_id
    FROM mtl_system_items_b
    WHERE organization_id = l_master_org_id
    AND segment1 = recitem_data.segment1);
    END ;
    IF l_description_count > 0 THEN
    l_processed_flag:='F';
    l_error_message :=
    l_error_message
    || 'Item Description Not Present'
    || p_org_id
    || ' Organization '
    || l_error_delimiter;
    END IF;
    END IF;
    IF l_processed_flag = 'S'
    THEN
    BEGIN
    INSERT INTO mtl_system_items_interface
    (organization_id,
    segment1,
    description,
    ITEM_TYPE,
    COST_OF_SALES_ACCOUNT,
    SALES_ACCOUNT,
    attribute_category,
    set_process_id,
    transaction_type,
    process_flag,
    copy_organization_code,
    copy_item_number,
    creation_date,
    created_by,
    last_updated_by,
    last_update_date
    --attribute_category
    , attribute1
    , attribute2
    ,attribute3
    ,attribute4
    ,attribute5
    ,attribute6
    ,attribute7
    ,attribute8
    ,attribute9
    ,attribute10
    ,attribute11
    ,attribute12
    ,attribute13
    ,attribute14
    ,attribute15
    ,global_attribute10
    VALUES (l_organization_id,
    recitem_data.segment1,
    recitem_data.description,
    recitem_data.ITEM_TYPE,
    recitem_data.COST_OF_SALES_ACCOUNT,
    recitem_data.SALES_ACCOUNT,
    recitem_data.ATTRIBUTE_CATEGORY,
    l_set_process_id,
    l_transaction_type, --,l_transaction_type
    l_process_flag,
    l_ref_org_code,
    l_ref_inventory_item_code,
    SYSDATE, l_user_id,
    l_user_id, SYSDATE
    -- l_attribute_category
    ,recitem_data.attribute1
    ,recitem_data.attribute2
    ,recitem_data.attribute3
    ,recitem_data.attribute4
    ,recitem_data.attribute5
    ,recitem_data.attribute6
    ,recitem_data.attribute7
    , recitem_data.attribute8
    ,recitem_data.attribute9
    , recitem_data.attribute10
    ,recitem_data.attribute11
    ,recitem_data.attribute12
    ,recitem_data.attribute13
    ,recitem_data.attribute14
    ,recitem_data.attribute15
    , substr(recitem_data.global_attribute10,1,length(recitem_data.global_attribute10)-1) --recitem_data.global_attribute10
    l_insert_count := l_insert_count + 1;
    /* IF (l_insert_count = NVL (p_commit_point, 10000))
    THEN
    -- l_set_process_id := l_set_process_id + 10; -- REVERT BACK CHANGE
    l_insert_count := 0;
    END IF;
    EXCEPTION
    WHEN OTHERS
    THEN
    l_processed_flag := 'F';
    l_error_message :=
    l_error_message
    || 'Error in Inserting Item '
    || SQLERRM
    || l_error_delimiter;
    END ;
    COMMIT;
    DBMS_OUTPUT.put_line ('CheckPoint: Insertion Completed in Intfacetable');
    END IF;
    BEGIN
    UPDATE xxx_inv_system_items_stg
    SET status_flag = l_processed_flag,
    error_message = l_error_message
    WHERE segment1 = recitem_data.segment1
    AND organization_id = recitem_data.organization_id
    AND status_flag IS NULL;
    COMMIT;
    DBMS_OUTPUT.put_line ('Error Message'||l_error_message);
    EXCEPTION
    WHEN OTHERS
    THEN
    fnd_file.put_line (fnd_file.LOG,
    'Error:Updating Item:'
    || SQLCODE
    || '-'
    || SQLERRM
    END;
    END LOOP; --FOR recitem_data IN cur_item_master
    DBMS_OUTPUT.put_line ( 'Validation Ends At :'
    || TO_CHAR (SYSDATE, 'DD-MON-YYYY HH24:MI:SS')
    DBMS_OUTPUT.put_line ('Number of records inserted into Table Successfully -->'|| l_insert_count);
    END;
    END xxxx_inv_items_conv_pkg;
    Edited by: 896170 on Apr 12, 2013 11:58 PM

    Issue got solved... changed the PO line amount as:
    <?xdoxslt:set_variable($_XDOCTX,'line_amt',xdoxslt:to_number(LINE_AMOUNT))?>
    Reference :Syntax for 'to_number'
    Regards
    Manikanta Panigrahi

  • Item Cost update Coneversion Error

    Hi All,
    I am doing item Cost Update conversion, while doing this i am getting the Following only one error for all the items.
    Error Explanation - 'The default cost type for the cost type is not valid.'
    Error Code - CST_INVALID_DEFCSTTYPE
    i am inserting the data in the interface table 'CST_ITEM_CST_DTLS_INTERFACE'
    in this table i am taking only the below columns
    INVENTORY_ITEM_ID,
    ORGANIZATION_ID,
    COST_TYPE,
    RESOURCE_CODE,
    USAGE_RATE_OR_AMOUNT,
    COST_ELEMENT_ID,
    PROCESS_FLAG
    and i am doing this only for materail cost, is there any extra columns i have to take in the interface table for doing with out getting the above error.
    please provide me the data also for the extra columns.
    Any help would be appreciated.
    thanks
    Anushka

    the above error can come only when the row being imported is missing any of "lot size" or "based on rollup flag" or
    "shrinkage rate" or "inventory asset flag" values. Most probably it could be a setup issue.
    when any of these values are missing, the values are defaulted from the default cost type
    of the current cost type into which item costs are being imported into. If the
    default cost type too does not have the values set for the above mentioned
    columns which are having Null values, this message is displayed.

  • Help with query to determine if a record value has changed.

    Our auditors want to know which items had their costs updated in March 2006. I'm querying the cst_standard_cost table to find records that were updated in March. This part seems to be working although it pulls back multiple rows for the same item if more than one update was done in that month. I'm still not sure how I'm going to handle that problem.
    ----cst_standard_costs-----
    alter session set NLS_DATE_FORMAT = 'MM/DD/YYYY';
    drop table suss.cost_update_0306b;
    create table suss.cost_update_0306b
    as
    select csc.inventory_item_id, mtl.segment1||','||mtl.segment2 "item", csc.organization_id,csc.standard_cost,csc.creation_date "creation_date"
    from cst_standard_costs csc, mtl_system_items_b mtl
    where csc.inventory_item_id = mtl.inventory_item_id
    and mtl.organization_id = '82'
    and csc.organization_id not in ('0','81')
    and csc.creation_date like '03/%/2006%'
    order by csc.inventory_item_idHere, I'm trying to find if the update that was done in March actually changed the item's cost. But the sql is not exactly right. The results being returned are any cost update where the item's cost is different than it was in March. I'd like to pull back the item's cost from the most recent cost update previous to the March update and see if it differs from the March cost.
    select csc.inventory_item_id,mtl.segment1||','||mtl.segment2, csc.organization_id,csc.standard_cost, csc.creation_date
    from cst_standard_costs csc, mtl_system_items_b mtl, suss.cost_update_0306b scu
    where csc.inventory_item_id = mtl.inventory_item_id
    and mtl.organization_id = '82'
    and scu.inventory_item_id = csc.inventory_item_id
    and csc.organization_id not in ('0','81')
    and csc.creation_date < scu."creation_date"
    and csc.standard_cost <>scu.standard_cost
    order by csc.inventory_item_id ascHere's a simple example
    item id.....cost.........update_date
    24..........45.00........03/01/2006
    24..........45.00........02/01/2006
    24..........30.00........02/22/2006
    40..........45.00........03/01/2006
    40..........30.00........02/01/2006
    40..........28.00........02/22/2006
    The results of the sql should be to return item id 40 because the costs changed in March but not item id 24 because the costs did not change in March

    Something like this:
    SQL> DESC COSTS;
    Name                                      Null?    Type
    ITEM_ID                                            NUMBER
    COST                                               NUMBER(4,2)
    UPDATE_DATE                                        DATE
    SQL> SELECT * FROM COSTS;
       ITEM_ID       COST UPDATE_DAT
            24         40 03/01/2006
            24         45 02/01/2006
            40         45 03/01/2006
            40         30 02/01/2006
    SQL> SELECT b.item_id, b.cost, b.update_date
      2  FROM costs a, costs b
      3  WHERE a.item_id = b.item_id
      4   AND a.cost <> b.cost
      5   AND a.update_date = ADD_MONTHS(b.update_date, -1)
      6  /
       ITEM_ID       COST UPDATE_DAT
            24         40 03/01/2006
            40         45 03/01/2006It is maybe not efficient query but works :)
    Another solution:
      1  SELECT a.item_id, a.cost, a.update_date
      2  FROM costs a
      3  WHERE a.cost <> (SELECT cost
      4               FROM costs
      5               WHERE a.item_id = item_id
      6                AND ADD_MONTHS(a.update_date, -1) = update_date
      7*            )
    SQL> /
       ITEM_ID       COST UPDATE_DAT
            24         40 03/01/2006
            40         45 03/01/2006Peter D.

  • Need help to figure it out which Order/release is for arrive!!!

    Hi all, i need a little help from someone, i have to develop a report with a different kind of information, and one of the columns i am getting problems to get it, its the one where i need to include the next order that will arrive, it means i am making a report by part number (mtl_system_items.inventory_item_id), and i need to include which order number/release its the next one to arrive, and also the promised date, i don't know the relations on this module, and if any of you can give me any advice of how to do it or if someonte already make this, it will be very preciated. Thanks in advance.

    I think you need to show the next purchase order for which Items are going to be received. If so, Purchase order details are stored in PO_HEADERS, PO_LINES.
    link org_id,organization_id and inventory_item_id and 'approved' purchase order with inventory table (mtl_system_items).

Maybe you are looking for

  • Production order - Yield over confirmed

    Dear Experts, We have a situation here the production department have confirmed over yield. Example Actual production order was for 100 but they have confirmed it for 102 Qty GRN also have been made with 102 Quantity also. Delivery made for 100 qty f

  • Song order when browsing mp3s in media mgr

    What dictates the song order?  If I browse all songs in a folder, they seem to be in random order, rather than alphabetical.

  • Crash on Update to Thunderbolt 1.2, need to reinstall Lion and failures!

    Yesterday, after the WWDC'12, Apple released many software updates, including Thunderbolt Software Update 1.2. When I tried to update it, I got a error, a failure that Software Update could not find this update to download it. So I close it and tried

  • Photoshop Elements 11, Organize won't launch.

    Having attempted to install Elements 11 from a purchased copy twice now on my 27" iMac running OSX.7.5, I have the problem that Organize starts to launch, then quits unexpectedly whenever I try. Edit works fine, I have tried opening Organize from the

  • Need the list option in co01

    HI,   In co01 we are creating production order. IN this we have thegoods reciept sub screen, in here we have the stock type field (list box) in this list  1)unrestricted to use 2)Quality inspection 3)Blocked Stock in this list we need another option