Group Team
API 'EGO_ITEM_PUB.Assign_Item_To_Org' can be used to Assign Item to Child Org.

Below code helps Us to Understand more on the API

declare
l_mesg VARCHAR2(1000);
l_count number;

begin

--Getting the Organization id
BEGIN
SELECT Organization_id,master_organization_id
INTO v_organization_id,v_master_org
FROM mtl_parameters mp
WHERE mp.organization_code = 'C1'; --C1 is the Child Organization Code
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('Error in getting the Organization id for Organization code V1 and error is '||SUBSTR(SQLERRM,1,200));
END;

--Getting the Inventory Item id of the Item which is available in Master Organization
SELECT inventory_item_id
INTO v_item_id
from mtl_system_items_b
where segment1 = 'Existing Item Name'
and organization_id = v_master_org;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('Error in getting the inventory item id for Item and error is '||SUBSTR(SQLERRM,1,200));
END;

EGO_ITEM_PUB.Assign_Item_To_Org(
p_api_version => 1.0 ,
,p_Item_Number => v_item_id
,p_Organization_Id => v_organization_id
,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;

Exception
dbms_output.put_line('Error in the API and error is '||SUBSTR(SQLERRM,1,200));
END;
Labels: edit post
2 Responses
  1. Sridevi K Says:

    Regards
    Sridevi Koduru (Senior Oracle Apps Trainer Oracleappstechnical.com)
    LinkedIn profile - https://in.linkedin.com/in/sridevi-koduru-9b876a8b
    Please Contact for One to One Online Training on Oracle Apps Technical, Financials, SCM, SQL, PL/SQL, D2K at training@oracleappstechnical.com | +91 - 9581017828.


  2. petter smith Says:

    Awesome! Thanks for sharing this post. I was looking for it, is it possible to register large items (that file with 100 items in the form of an Excel file).

    Marketing assignment help
    Law Assignment Help
    Nursing Assignment Help


Post a Comment