Social Icons

Showing posts with label INV. Show all posts
Showing posts with label INV. Show all posts

Sunday, July 28, 2013

Creating an Item in Oracle Apps

Creating an Item in Oracle Apps

Please follow the process to create a new Item.
Navigate to the Inventory Super User responsibility.
Go to Items Master Items
1. Enter the Item name in Item field
2. Enter the Item Description in Description field
3. Save the form

4. Now you can copy attributes from any existing templates or manually set all the attributes for all the tabs.
5. For copying attributes from existing template, go to Tools Copy From

6. Select any existing template which suits your requirements and then click Apply, once Template is Implemented then click done.
7. Now all attributes are set as per the template.
8. You can check the tabs individually and whenever any attribute needs to change for your business requirement, you can do the change.
9. After done with all the changes, Click Save.

Assigning an Item to an Organization

Assigning an Item to an Organization

Before assigning an item to an Organization, Item should have been defined in the master org.
If Item has already been defined in master org, then follow the steps to assign it to an Organization.
1. Go to the Inventory responsibility.
2. Navigate to Items Master Items
3. Query the item in the master item form

4. Go to Tools Organization Assignment
This will show all organization which use this master org as their master org

5. Check the assigned button against the Org to which you want to assign this item
6. Save
This will assign this item to that Organization.
Now you can query this item in that specific Org and if needed you can change the organization specific item attributes for the item.

Oracle Inventory Defining Item (Item Master)

Defining an Item (Item Master):


Navigate to the Inventory Super User responsibility

Items Master Items window
Choose the Org (master)

This is the window where you need to enter all attributes of the item.
Enter the Item and Description field and Save your work.

You can manually assign the attributes navigating to all the tabs like Main, Inventory, Bills of Materials, etc.
Also you can apply a predefined item template on this item as per your business need.
So for copying the attribute
Go to, Tools Copy From

In this case, I am copying the attributes from the Finished Good template.
Then click on Apply and then Done.
Now the new Item acquired all attributes as per the Finished Good template.
You can go to individual tabs and check and modify the attributes as per your need.

Main:

Inventory:

Check whether following attributes are checked or not
Inventory Item, Stockable, Transactable, Reservable


Bill of Materials:

Asset Management:

Costing:

Purchasing:

Receiving:

Physical Attribute:

General Planning:

MPS/MRP Planning:

Lead Time:

Work in Process:

Order Management:

Invoicing:

Process Manufacturing:

Services:

Web Option:


Check and modify the attributes and Save your work.

Oracle Inventory Setups prior to Defining Items

Below are the setups need to be done before defining Items

Container Type:
Setup Items Container Type

Item Status:
Setup Items Item Status

Defining Picking Rule:

Move to Setup Rules Picking

Defining Item Types:

Setup Items Item types

Item Templates:

Setup Items Templates
Then select New

Overview of Item Categories:

Item Categories defined to group items logically according to different characters and this is used for different reports and programs.
Define Item Flexfields
Define Categories
Define Category sets
Assign default category sets to functional areas
Assign items to categories.

Define Flexfield Structure for Categories:

Setup Flexfields Key Segments

Define Categories:

Setup Items Categories Category Codes
Then select New

Define Category Sets:

Setup Items Categories Category Sets

Item Catalogs:

Item Catalog is used to add descriptive information to items and to partition the item master into different groups of items which share common characteristics.
Once the process of defining and cataloging items is complete, you can:
Provide standard language in referring to items, enabling companies in the same industry to communicate effectively without needing to name their items identically.
Store a detailed description of what an item is without having to embed that meaning in the item number.
Use descriptive elements as search criteria for items.
Update the item description with a concatenated value of the item catalog group information.
Find common existing parts when developing an engineering prototype.
Setup Items Catalog Groups

INVENTORY ONHAND QUANTITY INTERFACE SCRIPT


/* Formatted on 2013/07/11 18:23 (Formatter Plus v4.8.8) */
DECLARE
   l_inventory_item_id     NUMBER;
   l_cost_type_id          NUMBER;
   l_organization_id       NUMBER;
   l_cost_element_id       NUMBER;
   l_locator_id            NUMBER;
   v_error                 VARCHAR2 (4000);
   x_item_valid            VARCHAR2 (1);
   v_main_record_count     NUMBER;
   v_inv_record_count      NUMBER;
   v_po_record_count       NUMBER;
   l_code_combination_id   NUMBER;

   CURSOR c_onhand_qty
   IS
      SELECT   *
          FROM xxoomco_items_onhand_qty_temp
         WHERE TO_CHAR (transaction_date, 'RRRR/MM/DD HH24:MI:SS') ! =
                                                        '2013/06/30 04:06:01'
           AND sno = 1
      ORDER BY transaction_date;
BEGIN
   FOR i_onhand_qty IN c_onhand_qty
   LOOP
      BEGIN
         SELECT organization_id
           INTO l_organization_id
           FROM mtl_parameters
          WHERE UPPER (organization_code) =
                                        UPPER (i_onhand_qty.organization_code);

         DBMS_OUTPUT.put_line ('ORGANIZATION ID:' || l_organization_id);
      EXCEPTION
         WHEN NO_DATA_FOUND
         THEN
            v_error := v_error || 'No Org Exists for ORG Code';
            DBMS_OUTPUT.put_line (   'No Org exists for Org Code: '
                                  || i_onhand_qty.organization_code
                                 );
         WHEN OTHERS
         THEN
            v_error := v_error || 'No Org Exists for ORG Code';
      END;

      BEGIN
         SELECT inventory_item_id
           INTO l_inventory_item_id
           FROM mtl_system_items_b
          WHERE segment1 || '.' || segment2 = i_onhand_qty.item_number
            AND organization_id = 158;

         DBMS_OUTPUT.put_line ('Inventory Item Id :' || l_inventory_item_id);
      EXCEPTION
         WHEN NO_DATA_FOUND
         THEN
            v_error := v_error || 'No Item_id Exists for Item Code';
            DBMS_OUTPUT.put_line (   'No Item_id Exists for Item Code: '
                                  || i_onhand_qty.item_number
                                 );
         WHEN OTHERS
         THEN
            v_error := v_error || 'No Item_id Exists for Item Code';
      END;

      BEGIN
         SELECT code_combination_id
           INTO l_code_combination_id
           FROM gl_code_combinations
          WHERE    segment1
                || '.'
                || segment2
                || '.'
                || segment3
                || '.'
                || segment4
                || '.'
                || segment5
                || '.'
                || segment6
                || '.'
                || segment7
                || '.'
                || segment8 = i_onhand_qty.code_combination_val;
      EXCEPTION
         WHEN OTHERS
         THEN
            DBMS_OUTPUT.put_line (   'Combinatin does not exist: '
                                  || i_onhand_qty.code_combination_val
                                 );
      END;

      BEGIN
         DBMS_OUTPUT.put_line ('Before Inserted MTL_TRANSACTIONS_INTERFACE');

         INSERT INTO apps.mtl_transactions_interface
                     (source_code, source_line_id,
                      source_header_id, process_flag, transaction_mode,
                      last_update_date, last_updated_by, creation_date,
                      created_by, inventory_item_id, organization_id,
                      transaction_quantity, transaction_uom,
                      transaction_date,
                      subinventory_code, locator_id, transaction_type_id,
                      distribution_account_id, dst_segment1, dst_segment2,
                      dst_segment3, dst_segment4, dst_segment5,
                      dst_segment6, dst_segment7, transaction_cost,
                      transfer_lpn_id
                     )
              VALUES ('ONHAND_CONV', OOMCO_SRC_LINE_ID_INT_SEQ.NEXTVAL,
                      xxmtl_src_hdr_id_int_seq.NEXTVAL, 1, 3,
                      SYSDATE, 1131, SYSDATE,
                      1131, l_inventory_item_id, 158,
                      i_onhand_qty.quantity, i_onhand_qty.transaction_uom,
                      i_onhand_qty.transaction_date,
                      i_onhand_qty.subinventory_code, NULL, 42,
                      l_code_combination_id, NULL,         --lc_dist_acc_seg1,
                                                  NULL,    --lc_dist_acc_seg2,
                      NULL,                                --lc_dist_acc_seg3,
                           NULL,                           --lc_dist_acc_seg4,
                                NULL,                      --lc_dist_acc_seg5,
                      NULL,                                --lc_dist_acc_seg6,
                           NULL,                           --lc_dist_acc_seg7,
                                i_onhand_qty.unit_cost,
                      --CRecOnhand.TRANSACTION_COST
                      NULL                                            --LPN_ID
                     );

         --FND_FILE.PUT_LINE(FND_FILE.LOG,'After Inserted MTL_TRANSACTIONS_INTERFACE');
         DBMS_OUTPUT.put_line ('After Inserted MTL_TRANSACTIONS_INTERFACE');
         COMMIT;
      END;
   END LOOP;

   DBMS_OUTPUT.put_line ('Main Table Record count:' || v_main_record_count);
   DBMS_OUTPUT.put_line (   'Category inv Table Record count:'
                         || v_inv_record_count
                        );
   DBMS_OUTPUT.put_line ('Category PO Record count:' || v_po_record_count);
END;

Thursday, July 25, 2013

INVENTORY STOCK LEDGER QUERY

Inventory Stock Ledger query
------------------------------------

SELECT DISTINCT msib.segment1 item_code, msib.segment2 unit_code,
SUBSTR (msib.description, 1, 20) item_description,msib.attribute20 pack_code, msib.attribute25 pack_description,xx_item_open_bal (mmt.inventory_item_id,mmt.organization_id,TO_DATE (:p_from)) open_bal,(SELECT SUM ( transaction_quantity*
(SELECT conversion_rate
FROM mtl_uom_conversions_view
WHERE inventory_item_id = a.inventory_item_id
AND organization_id = a.organization_id
AND uom_code = a.transaction_uom)) ddFROM mtl_material_transactions a,mtl_transaction_types mtt
WHERE inventory_item_id = mmt.inventory_item_id
AND organization_id = mmt.organization_id
AND a.transaction_type_id = mtt.transaction_type_id
AND a.transaction_quantity > 0AND TO_DATE (a.transaction_date) BETWEEN TO_DATE (:p_from)AND TO_DATE(:p_todate))receipt,(SELECT SUM ( transaction_quantity*
(SELECT conversion_rate
FROM mtl_uom_conversions_view
WHERE inventory_item_id = a.inventory_item_id
AND organization_id = a.organization_id
AND uom_code = a.transaction_uom)) ddFROM mtl_material_transactions a,mtl_transaction_types mtt
WHERE inventory_item_id = mmt.inventory_item_id
AND organization_id = mmt.organization_id
AND a.transaction_type_id = mtt.transaction_type_id
AND a.transaction_quantity < 1AND TO_DATE (a.transaction_date) BETWEEN TO_DATE (:p_from)AND TO_DATE(:p_todate))issue,xx_item_close_bal (mmt.inventory_item_id,mmt.organization_id,TO_DATE (:p_from),TO_DATE (:p_todate)) clos_bal,(SELECT SUM (reservation_quantity)FROM mtl_reservations
WHERE inventory_item_id = mmt.inventory_item_id
AND organization_id = mmt.organization_id) unconfmrldn,NVL(xx_item_close_bal (mmt.inventory_item_id,mmt.organization_id,TO_DATE (:p_from),TO_DATE (:p_todate)),0)- NVL ((SELECT SUM (reservation_quantity)FROM mtl_reservations
WHERE inventory_item_id = mmt.inventory_item_id
AND organization_id = mmt.organization_id),0) phy_clg_stock,(SELECT SUM ( NVL (plla.quantity, 0)- NVL (plla.quantity_received, 0))FROM po_headers_all pha,po_lines_all pla,po_line_locations_all plla
WHERE pha.po_header_id = pla.po_header_id
AND pla.po_line_id = plla.po_line_id
AND pha.po_header_id = plla.po_header_id
AND pha.authorization_status = 'APPROVED'AND pla.item_id = mmt.inventory_item_id
AND plla.ship_to_organization_id = mmt.organization_id
--and (plla.QUANTITY_RECEIVED is not null or plla.QUANTITY_RECEIVED not in (0))AND TO_DATE (pha.creation_date) BETWEEN TO_DATE (:p_from)AND TO_DATE (:p_todate))outstndsuplord,msib.organization_id, msib.inventory_item_id,mp.organization_code
FROM mtl_system_items_b msib,mtl_parameters mp,mtl_material_transactions mmt
WHERE msib.organization_id = mp.organization_id
AND msib.inventory_item_id = mmt.inventory_item_id
AND msib.organization_id = mmt.organization_id
AND mp.organization_id = mmt.organization_id
AND mp.organization_id =nvl(:P_INV_ORG_ID,mp.organization_id)AND mp.organization_code = 'MAF'order by 1
Function Script
---------------

CREATE OR REPLACE FUNCTION APPS.xx_item_open_bal (p_item_id IN NUMBER,p_org_id IN NUMBER,p_from_date IN DATE)RETURN NUMBERISl_open_bal NUMBER;l_recipt NUMBER;l_issues NUMBER;BEGIN
BEGINSELECT SUM ( transaction_quantity*
(SELECT conversion_rate
FROM mtl_uom_conversions_view
WHERE inventory_item_id = mmt.inventory_item_id
AND organization_id = mmt.organization_id
AND uom_code = mmt.transaction_uom))INTO l_open_bal
FROM mtl_material_transactions mmt, mtl_transaction_types mtt
WHERE inventory_item_id = p_item_id
AND organization_id = p_org_id
AND mmt.transaction_type_id = mtt.transaction_type_id
AND TO_DATE (mmt.transaction_date) < TO_DATE (p_from_date);EXCEPTIONWHEN OTHERSTHENl_open_bal := 0;END;/*BEGINSELECT SUM (NVL (transaction_quantity, 0) )
INTO l_recipt
FROM mtl_material_transactions
WHERE inventory_item_id = p_item_id
AND organization_id = p_org_id
AND TO_DATE (transaction_date) < TO_DATE (p_from_date)
AND transaction_action_id = 27;
EXCEPTION
WHEN OTHERS
THEN
l_recipt := 0;
END;*/
/* BEGINSELECT SUM (NVL (transaction_quantity, 0) )
INTO l_issues
FROM mtl_material_transactions
WHERE inventory_item_id = p_item_id
AND organization_id = p_org_id
AND TO_DATE (transaction_date) < TO_DATE (p_from_date)
AND transaction_action_id = 1;
EXCEPTION
WHEN OTHERS
THEN
l_issues := 0;
END;*/
--l_open_bal := NVL (l_recipt, 0) + NVL (l_issues, 0);RETURN nvl(l_open_bal,0);END
xx_item_open_bal;/

Close Bal fun
-------------

CREATE OR REPLACE FUNCTION APPS.xx_item_close_bal (p_item_id IN NUMBER,p_org_id IN NUMBER,p_from_date IN DATE,p_todate IN DATE)RETURN NUMBERISl_open_bal NUMBER;l_clos_bal NUMBER;l_recipt NUMBER;l_issues NUMBER;BEGIN
BEGINSELECT SUM ( transaction_quantity*
(SELECT conversion_rate
FROM mtl_uom_conversions_view
WHERE inventory_item_id = mmt.inventory_item_id
AND organization_id = mmt.organization_id
AND uom_code = mmt.transaction_uom))INTO l_recipt
FROM mtl_material_transactions mmt, mtl_transaction_types mtt
WHERE inventory_item_id = p_item_id
AND organization_id = p_org_id
AND mmt.transaction_type_id = mtt.transaction_type_id
AND mmt.transaction_quantity > 0AND TO_DATE (mmt.transaction_date) BETWEEN TO_DATE (p_from_date)AND TO_DATE (p_todate);/*SELECT SUM (NVL (transaction_quantity, 0) )INTO l_recipt
FROM mtl_material_transactions
WHERE inventory_item_id = p_item_id
AND organization_id = p_org_id
AND TO_DATE (transaction_date) BETWEEN TO_DATE (p_from_date)
AND TO_DATE (p_todate)
AND transaction_action_id = 27;*/
EXCEPTIONWHEN OTHERSTHENl_recipt := 0;END;BEGINSELECT SUM ( transaction_quantity*
(SELECT conversion_rate
FROM mtl_uom_conversions_view
WHERE inventory_item_id = mmt.inventory_item_id
AND organization_id = mmt.organization_id
AND uom_code = mmt.transaction_uom))INTO l_issues
FROM mtl_material_transactions mmt, mtl_transaction_types mtt
WHERE inventory_item_id = p_item_id
AND organization_id = p_org_id
AND mmt.transaction_type_id = mtt.transaction_type_id
AND mmt.transaction_quantity < 1AND TO_DATE (mmt.transaction_date) BETWEEN TO_DATE (p_from_date)AND TO_DATE (p_todate);/*SELECT SUM (NVL (transaction_quantity, 0))INTO l_issues
FROM mtl_material_transactions
WHERE inventory_item_id = p_item_id
AND organization_id = p_org_id
AND TO_DATE (transaction_date) BETWEEN TO_DATE (p_from_date)
AND TO_DATE (p_todate)
AND transaction_action_id = 1;*/
EXCEPTIONWHEN OTHERSTHENl_issues := 0;END;BEGINSELECT xx_item_open_bal (p_item_id, p_org_id, TO_DATE (p_from_date))INTO l_open_bal
FROM DUAL;EXCEPTIONWHEN OTHERSTHENl_open_bal := 0;END;l_clos_bal := (NVL (l_open_bal, 0) + NVL (l_recipt, 0)) + NVL (l_issues, 0);RETURN l_clos_bal;END
xx_item_close_bal;/
">