declare
 l_item_table      ego_item_pub.item_tbl_type;
   x_item_table      ego_item_pub.item_tbl_type;
   x_return_status   VARCHAR2 (1);
   x_msg_count       NUMBER (10);
   x_msg_data        VARCHAR2 (1000);
   x_message_list    error_handler.error_tbl_type;
BEGIN
           l_item_table (1).transaction_type := ‘UPDATE’;
       l_item_table (1).inventory_item_id := 64;  –INVENTORY_ITEM_ID;
       l_item_table (1).organization_id := 101; — I.ORGANIZATION_ID;
       l_item_table (1).template_id := 1;– I.NEW_TEMPLATE_ID;
       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
                      );
     
       DBMS_OUTPUT.PUT_LINE (‘Return Status ==>’ || x_return_status);
       DBMS_OUTPUT.PUT_LINE (‘Error Messages :’);
      
           error_handler.get_message_list (x_message_list => x_message_list);

           FOR i IN 1 .. x_message_list.COUNT
           LOOP
              DBMS_OUTPUT.PUT_LINE (x_message_list (i).MESSAGE_TEXT);
           END LOOP;

END;

select fu.user_name, fr.responsibility_name, furg.START_DATE, furg.END_DATE
from fnd_user_resp_groups_direct furg, fnd_user fu, fnd_responsibility_tl fr
where fu.user_name = :user_name
and furg.user_id = fu.user_id
and furg.responsibility_id = fr.responsibility_id
and fr.language = userenv(‘LANG’);
SELECT fcpt.user_concurrent_program_name, fcpt.concurrent_program_id,
       frg.request_group_name
  FROM apps.fnd_concurrent_programs_tl fcpt,
       apps.fnd_request_group_units frgu,
       apps.fnd_request_groups frg
 WHERE frgu.request_unit_type = ‘P’           –Program
   AND frgu.request_unit_id = fcpt.concurrent_program_id
   AND frgu.request_group_id = frg.request_group_id
   AND upper(fcpt.user_concurrent_program_name) LIKE upper(‘CONCURRENT_PROGRAM_NAME%’);
l_api_version   NUMBER := 1.0;
l_init_msg_list VARCHAR2(2) := FND_API.G_TRUE;
l_commit        VARCHAR2(2) := FND_API.G_FALSE;  
SELECT inventory_item_id,
        segment1,
        primary_uom_code
 FROM   mtl_system_items_b
 WHERE  segment1 = v_segment1;  -- INVENTORY ITEM CODE
 
EGO_ITEM_PUB.ASSIGN_ITEM_TO_ORG( 
P_API_VERSION       => l_api_version
, P_INIT_MSG_LIST     => l_INIT_MSG_LIST
, P_COMMIT            => l_COMMIT
, P_INVENTORY_ITEM_ID => itm.inventory_item_id --(item id from the above Query)
, P_ITEM_NUMBER       => itm.segment1          --(Item Code from the above Query)
, P_ORGANIZATION_ID   => v_organization_id     --(Organization Id for assingment)
, P_ORGANIZATION_CODE => NULL--v_organization_code
, P_PRIMARY_UOM_CODE  => itm.primary_uom_code  --(UOM from the above Query)
, X_RETURN_STATUS     => X_RETURN_STATUS
, X_MSG_COUNT         => X_MSG_COUNT
); 
 
  
declare
      x_return_status VARCHAR2(2000);
      x_msg_count NUMBER;
      x_msg_data VARCHAR2(2000);
      x_vendor_site_id number;
begin
icx_user_sec_attr_pub.create_user_sec_attr(
   p_api_version_number   => 1,
   p_return_status        => x_return_status,
   p_msg_count            => x_msg_count,
   p_msg_data             => x_msg_data,
   p_web_user_id          => 1394,
   p_attribute_code       => ‘ICX_SUPPLIER_ORG_ID’,
   p_attribute_appl_id    => 177, —-iSupplier Portal
   p_varchar2_value       => ”,
   p_date_value           => ”,
   p_number_value         => 493,  — Vendor_ID for ICX_SUPPLIER_ORG_ID’and Vendor_site_id for ICX_SUPPLIER_SITE_ID’ attribute code
   p_created_by           => -1,
   p_creation_date        => sysdate,
   p_last_updated_by      => -1,
   p_last_update_date     => sysdate,
   p_last_update_login    => -1);
              if (x_return_status <> ‘S’) then
                    dbms_output.put_line(‘Encountered ERROR in Attribute Creation!!!’);
                    dbms_output.put_line(‘————————————–‘);
                    dbms_output.put_line(x_msg_data);
                            IF x_msg_count > 1 THEN
                                FOR i IN 1..x_msg_count LOOP
                                        dbms_output.put_line(substr(FND_MSG_PUB.Get( p_encoded => FND_API.G_FALSE ),1,255));
                                END LOOP;
                            END IF;
            ELSE
                        dbms_output.put_line(‘Attribute has been attached !!!!!!’);
            end if; 
end;