修改物料属性API

SELECT ORGANIZATION_ID,postprocessing_lead_time
FROM mtl_system_items_b
WHERE INVENTORY_ITEM_ID = 352351;
-------------------------------------------------------
DECLARE
l_Item_Rec Inv_Item_Grp.Item_Rec_Type;
x_Item_Rec Inv_Item_Grp.Item_Rec_Type;
x_Error_Tbl Inv_Item_Grp.Error_Tbl_Type;
x_Return_Status VARCHAR2(1);
BEGIN

Fnd_Global.Apps_Initialize(User_Id => 10311,
Resp_Id => 50737,
Resp_Appl_Id => 20006);

--Item
l_Item_Rec.Inventory_Item_Id := 352351;
l_Item_Rec.Organization_Id := 91;

--可修改:
l_Item_Rec.postprocessing_lead_time := 11;

--不可修改字段:PRIMARY_UNIT_OF_MEASURE, TRACKING_QUANTITY_IND, ONT_PRICING_QTY_SOURCE, SECONDARY_UOM_CODE, SECONDARY_DEFAULT_IND, DUAL_UOM_DEVIATION_HIGH, DUAL_UOM_DEVIATION_LOW 和 ENGINEERING_ITEM_FLAG

--API
Inv_Item_Grp.Update_Item(p_Commit => Fnd_Api.g_False,
p_Item_Rec => l_Item_Rec,
x_Item_Rec => x_Item_Rec,
x_Return_Status => x_Return_Status,
x_Error_Tbl => x_Error_Tbl);

Dbms_Output.Put_Line('x_Return_Status:' || x_Return_Status);

--Result
IF x_Return_Status <> Fnd_Api.g_Ret_Sts_Success THEN

-- ROLLBACK;
FOR i IN 1 .. x_Error_Tbl.Count LOOP
Dbms_Output.Put_Line('Transaction ID :' || x_Error_Tbl(i)
.Transaction_Id);
Dbms_Output.Put_Line('Unique ID :' || x_Error_Tbl(i)
.Unique_Id);
Dbms_Output.Put_Line('Message Name :' || x_Error_Tbl(i)
.Message_Name);
Dbms_Output.Put_Line('Message Text: :' || x_Error_Tbl(i)
.Message_Text);
Dbms_Output.Put_Line('Table Name :' || x_Error_Tbl(i)
.Table_Name);
Dbms_Output.Put_Line('Column Name :' || x_Error_Tbl(i)
.Column_Name);
Dbms_Output.Put_Line('Organization ID :' || x_Error_Tbl(i)
.Organization_Id);
END LOOP;

IF (x_Return_Status = Fnd_Api.g_Ret_Sts_Unexp_Error) THEN
RAISE Fnd_Api.g_Exc_Unexpected_Error;
ELSIF (x_Return_Status = Fnd_Api.g_Ret_Sts_Error) THEN
RAISE Fnd_Api.g_Exc_Error;
END IF;

ELSE
-- COMMIT;
Dbms_Output.Put_Line('ok:' || x_Item_Rec.Item_Number);
END IF;

END;
x_Return_Status:S
ok:5832AA000456

posted on 2026-04-03 14:25  miss斯娃  阅读(2)  评论(0)    收藏  举报