api to update item attributes in oracle apps
In this post , we will discuss , how we can update the Item attributes in Oracle apps with the help of API. When we need to change the Item attributes likes (Inventory Enabled Flag, Ordered Enabled Flag , Lead Time attributes and many other mores) then we can use this api to update or change these attributes from backend. Here below is the complete code of the api to update item attributes in oracle apps.
Example using api to update item attributes in oracle apps
declare
v_item_count NUMBER;
v_org_id NUMBER;
v_return_status VARCHAR2(300);
v_status VARCHAR2(300);
v_msg_count NUMBER;
v_msg_data apps.error_handler.error_tbl_type;
v_request_id NUMBER;
v_return_message VARCHAR2(4000);
l_item_rec inv_item_grp.item_rec_type;
x_item_rec inv_item_grp.item_rec_type;
typ_error_tbl inv_item_grp.error_tbl_type;
CURSOR c1 IS
SELECT * FROM XX_ITEM_UPDATE_STG;
begin
FOR I IN C1 LOOP
SELECT inventory_item_id
INTO v_inventory_item_id
FROM mtl_system_items_b
WHERE segment1 =i.item
and organization_id=204;
l_item_rec .inventory_item_id := I.inventory_item_id;
l_item_rec .organization_id := :P_ORG_ID;
l_item_rec .POSTPROCESSING_LEAD_TIME := I.POSTPROCESSING_LEAD_TIME;
l_item_rec .fixed_lead_time := I.fixed_lead_time;
l_item_rec .HOLD_DAYS := I.HOLD_DAYS;
l_item_rec .ATTRIBUTE2 := I.ATTRIBUTE1;
fnd_global.apps_initialize (2333,3456666, 552);
inv_item_grp.update_item(p_commit => fnd_api.g_true
,p_lock_rows => fnd_api.g_true
,p_validation_level => fnd_api.g_valid_level_full
,p_item_rec => typ_item_rec
,x_item_rec => x_item_rec
,x_return_status => v_return_status
,x_error_tbl => typ_error_tbl);
IF v_return_status = fnd_api.g_ret_sts_success THEN
dbms_output.put_line(x_item_rec.fixed_lead_time);
v_return_message := SUBSTR(v_return_message||' Item Attributes updated Sucessfully',1,3000);
COMMIT;
end if;
WHEN Others then
dbms_output.put_line(sqlerrm);
end;
0 comments:
Post a Comment