Friday, 15 March 2013

API to update Item Status

Oracle Applications

API to update Item Status

- A beginners guide :- API to update Item Status.

- Responsibility :- Inventory Manager.

- EGO_ITEM_PUB.Process_Items

Sample Code: 
/*-------------------------------------------------------------------------------------------------------*/
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
--Apps Initialize
fnd_global.apps_initialize
                            (user_id      => 57260,      --&userid,                             
                             resp_id      => 57122,      --&resp_id
                             resp_appl_id => 20063); --&resp_appl_id

  -- Item definition
  l_item_table(1).Transaction_Type := 'UPDATE';
  l_item_table(1).Segment1 := 'RCR24201 REV-7';
  l_item_table(1).Organization_id := 2990;
  l_item_table(1).attribute_category := 2990;

-- Calling procedure
EGO_ITEM_PUB.Process_Items
  EGO_ITEM_PUB.Process_Items(
--Input Parameters
                             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,

--Output Parameters
                             x_Item_Tbl      => x_item_table,
                             x_return_status => x_return_status,
                             x_msg_count     => x_msg_count);

  DBMS_OUTPUT.PUT_LINE('Items updated Status ==>' || x_return_status);

  IF (x_return_status = FND_API.G_RET_STS_SUCCESS) THEN
    FOR i IN 1 .. x_item_table.COUNT LOOP
      DBMS_OUTPUT.PUT_LINE('Inventory Item Id :' ||
                           to_char(x_item_table(i).Inventory_Item_Id));
      DBMS_OUTPUT.PUT_LINE('Organization Id   :' ||
                           to_char(x_item_table(i).Organization_Id));
    END LOOP;
  ELSE
    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 IF;
 END;

/*-------------------------------------------------------------------------------------------------------*/  

3 comments:

  1. Hello... which fields do you provide to find the record, and which fields are used to update the item master?

    ReplyDelete
  2. Could you please confirm on what is the filed used to update the Inventory_Item_status_code?

    ReplyDelete
  3. Hi I too want to update Inventory_Item_status_code for child organization but not able to ,there is master child attribute conflict "INV_IOI_MASTER_CHILD_4H",can some one pls help

    ReplyDelete