Declare
l_mast_organization_id number;
l_error_message varchar2(3000);
l_error_code varchar2(240):='S';
l_inventory_item_id number;
l_user_id number;
l_resp_id number;
l_resp_appl_id number;
l_jde_count number:=0;
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
fnd_global.apps_initialize
(user_id => 10688,--l_user_id,
resp_id => 50361,--l_resp_id,
resp_appl_id => 401);--l_resp_appl_id);
IF l_error_code <>'E' THEN
-- Item definition
l_item_table(1).Transaction_Type := 'UPDATE';
l_item_table(1).inventory_item_id := 12194;--ITEM_REC.inventory_item_id;
l_item_table(1).Organization_id := 143;--l_mast_organization_id;
l_item_table(1).RELEASE_TIME_FENCE_CODE :=null;
l_item_table(1).RELEASE_TIME_FENCE_DAYS :=null;
-- 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);
--FND_FILE.PUT_LINE(FND_FILE.LOG, 'Items updated Status ==>' || x_return_status);
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
--FND_FILE.PUT_LINE(FND_FILE.LOG, 'Inventory Item Id :' ||to_char(x_item_table(i).Inventory_Item_Id));
--FND_FILE.PUT_LINE(FND_FILE.LOG, 'Organization Id :' ||to_char(x_item_table(i).Organization_Id));
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
--FND_FILE.PUT_LINE(FND_FILE.LOG, 'Error Messages :');
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
--FND_FILE.PUT_LINE(FND_FILE.LOG, x_message_list(i).message_text);
dbms_output.put_line ( ' x_message_list(i).message_text-'|| x_message_list(i).message_text);
END LOOP;
END IF;
ELSE
--FND_FILE.PUT_LINE(FND_FILE.LOG, 'Error Messages :'||l_error_message);
dbms_output.put_line ( 'Error Messages :'||l_error_message);
END IF;
END;
No comments:
Post a Comment