add

About Me

My photo
Oracle Apps - Techno Functional consultant

Thursday, January 17

Oracle Item Disabling Script



For Multiple Items:
-------------------
DECLARE
   --v_inventory_item_id          NUMBER;
   --v_organization_id            NUMBER;
   --v_segment1                   VARCHAR2(100);
   v_inventory_item_status_code VARCHAR2(100);
   x_inventory_item_id          NUMBER;
   x_organization_id            NUMBER;
   x_return_status              VARCHAR2 (300);
   x_msg_count                  NUMBER;
   x_msg_data                   VARCHAR2 (4000);
   
          cursor c1 is select organization_id,inventory_item_id,segment1 from mtl_system_items_b where inventory_item_id=45;

BEGIN
         
          v_inventory_item_status_code  :='Inactive';  -- Inactive for disabling all functions

for i in c1
loop
         apps.ego_item_pub.process_item
                      (p_api_version                 => 1.0,
                       p_init_msg_list               => 'T',
                       p_commit                      => 'T',
                       p_transaction_type            => 'UPDATE',
                       p_inventory_item_id           => i.inventory_item_id,
                       p_organization_id             => i.organization_id,
                       p_segment1                    => i.segment1  ,
                       p_Inventory_Item_Status_Code  => v_inventory_item_status_code,
                       x_inventory_item_id           => x_inventory_item_id,
                       x_organization_id             => x_organization_id,
                       x_return_status               => x_return_status,
                       x_msg_count                   => x_msg_count,
                       x_msg_data                    => x_msg_data
                      );
end loop;
          dbms_output.put_line(x_organization_id);
          dbms_output.put_line(x_return_status );
          dbms_output.put_line(x_inventory_item_id );
                     
                     
        if (x_return_status <> 's')
        then
               dbms_output.put_line( 'item attribute update api error'|| x_return_status );
        else
               dbms_output.put_line('item attribute update api success' || x_return_status);
        end if;
end;

No comments: