Sunday, August 16, 2015

Item Assignment in Oracle Apps R12

Item Assignment to another inventory organization

There are two ways to assign the master item for inventory child organization.

Through master item form directly assigning to child organization. In case if we have multiple child organizations then we have to chose through API.

Below is an example of how to assign an organizations by using Plsql APIs.

'PVMDL012','PVTTV012','PVRCF012','PVSER012','PVCE2012','PVSEC012','PVITM012' all this items are represented in master organization (i.e. 118 in below example) and now my business requirement to assign 667 (As below example) inventory organization.

Declare
l_mesg VARCHAR2(1000);
l_count number;
cursor c1 is SELECT segment1
from apps.mtl_system_items_b
where segment1 in ('PVMDL012'
,'PVTTV012'
,'PVRCF012'
,'PVSER012'
,'PVCE2012'
,'PVSEC012'
,'PVITM012'
)
and organization_id = 118;--118 is a master organization 
BEGIN
 fnd_global.apps_initialize (user_id           => 78847,
                               resp_id           => 60823,
                               resp_appl_id      => 401
                              );
for f1 in c1
loop
EGO_ITEM_PUB.Assign_Item_To_Org(
  p_api_version => 1.0
 ,p_Item_Number => f1.segment1
 ,p_Organization_Id => 669
 ,x_return_status => l_mesg
 ,x_msg_count => l_count);

Commit;

IF l_count =1 THEN
 dbms_output.put_line( 'Error in API is '|| l_mesg);
ELSIF l_count >1 THEN
 LOOP
l_count := l_count+1;
l_mesg := FND_MSG_PUB.Get(FND_MSG_PUB.G_NEXT,FND_API.G_FALSE);
if l_mesg is NULL Then
EXIT;
END IF;
dbms_output.put_line('Message' || l_count ||' ---'||l_mesg);
END LOOP;
END IF;
end loop;

END;


Item Import in Oracle Apps R12

ITEM CONVERSION:
Item import in Oracle Apps R12.If you want to download the script click here.
You can import legacy system items into oracle system by using below item interface tables and validation rules.

Interface Tables:

MTL_SYSTEM_ITEMS_INTERFACE
        MTL_ITEM_CATEGORIES_INTERFACE

Error Table:

MTL_INTERFACE_ERRORS


Download the Script:

If you want to download the script click here.

Validation Rules:

Organization Code                                ORG_ORGANIZATION_DEFINITIONS
                                                                            (OR) MTL_PARAMETERS

Transaction Type                                  It Should not be null ,either CREATE or UPDATE.

Encumbrance/Expense                          GL_CODE_COMBINATIONS
Sales Accounts                                     

Primary UOM                                      MTL_UNITS_OF_MEASURE_TL

Item Type                                             FND_COMMON_TABLE 
                                                                            (Lookup_Type='ITEM_TYPE')

Item Category                                       MTL_CATEGORIES

Item Number                                         Item Number should be Unique (MTL_SYSTEM_ITEMS_B).

Description                                            Item Description should not be null.

Process Flag                                          Process_Flag should be 1.

Concurrent Program:
                                                              Import Items
Enter the parameters as below:
                                               All Organizations :Yes/No
                                               Validate Items :Yes/No
                                                Process Items :Yes/No
                                                Delete Process Rows: Yes/No
                                                Process Set : Enter the SET_PROCESS_ID for the records
                                                Create or Update Items : 1 (Create Items) or 2 (Update Items)

Once successfully completion of above concurrent program ,we have to check Process_Flag in interface table if it is 7 (Import Succeeded) or 4 (Import Failed) or 3 (Validation Failed).


Monday, November 4, 2013

INVENTORY & ORDER MANAGEMENT Tables join conditions

See below join condition between Inventory & Order Management

SELECT
c.segment1,--Item Name
a.order_number,
b.line_number,
b.shipment_number,
SUM(d.primary_transaction_quantity) as onhand
FROM oe_order_headers_all a,
oe_order_lines_all b,
mtl_system_items_b c,
mtl_onhand_quantities_detail d
WHERE b.header_id = a.header_id
AND b.inventory_item_id = c.inventory_item_id
AND b.ship_from_org_id = c.organization_id
AND b.inventory_item_id = d.inventory_item_id
AND b.ship_from_org_id = d.organization_id
AND b.flow_status_code = 'AWAITING_SHIPPING'
AND d.subinventory_code = 'Warehouse'
GROUP By c.segment1, a.order_number, b.line_number, b.shipment_number
ORDER BY c.segment1