ESI および TIBCO を使用しない Oracle Apps API のテスト
Oracle Apps インスタンスが適切に設定され、すべての API/同時マネージャが問題なく動作していることを確認するために、ESI を使用せずに、Oracle Manufacturing APIs and Open Interfaces Manual for Release 11i または Oracle® Supply Chain Management APIs and Open Interfaces Guide Release 12 で示されているガイドラインに従って Oracle Apps インスタンスをテストする際に以下のセクションが役立ちます。これらの API は、SQL developer、TOAD、sql plus などの任意の SQL クライアントツールを使用してテストできます。適切なデータベースアクセス権が必要です ("inventory, Bills of material, enginnering" の職責を持つ APPS ユーザーなどの Oracle Applications ユーザー)。
次のテーブルに、ESI で使用される各種 API をリストします。
部品の作成/更新
同時マネージャ INCOIN を使用したオープンアイテムインタフェース
BOM (部品表) の作成/更新
bom_bo_pub.Process_Bom
ルーティングの作成/更新
BOM_RTG_PUB.Process_Rtg
BOM、ルーティングの作成/更新および部品リビジョン作成のための ECO の作成
eng_eco_pub.Process_Eco
API を使用したテストは、データ関連の問題/要件などを特定するのに役立ちます。
部品、BOM、ECN、ルーティングなどのオブジェクトを作成するときの例を以下に示します。
部品の作成
次のテストケースは Oracle から提供されたガイドラインに基づいています。詳細については、Oracle APIs and Open Interface Manual Guide を参照してください。
APPS ユーザーを使用して接続します
以下のテーブルを切り捨てる前に、現時点では誰もこのテーブルを使用しておらず、保留中のトランザクションがないことを確認してください。
TRUNCATE table INV.MTL_SYSTEM_ITEMS_INTERFACE; TRUNCATE table INV.MTL_ITEM_REVISIONS_INTERFACE; TRUNCATE table INV.MTL_INTERFACE_ERRORS;INSERT into MTL_SYSTEM_ITEMS_INTERFACE (PROCESS_FLAG, SET_PROCESS_ID, TRANSACTION_TYPE, ORGANIZATION_CODE, DESCRIPTION,
SUMMARY_FLAG, PRIMARY_UOM_CODE, PLANNING_MAKE_BUY_CODE, TEMPLATE_ID,
ITEM_TYPE, TEMPLATE_NAME, ITEM_NUMBER, REVISION
) VALUES
(1, -- Process Flag Column indicates the current status of the row
100001, -- Set process Id is the set of records in the interface table you want to process. 'CREATE', -- Enter CREATE to create a new item, or UPDATE to update existing item
'P1', --Master Organization Code, Enter the organization that new item will import into. 'SR25NOV10_8' --Description Of item
'N', -- Summary Flag
'EA', --Unit of Measure Code
2, --Plan this item as either a make item or buy item
5, --Template ID
'SA', --Item Type 'Subassembly', --Template Name
'SR25NOV10_8', -- Item Number or Part Number 'A' --Revision
);
INSERT INTO MTL_ITEM_REVISIONS_INTERFACE (ITEM_NUMBER,
REVISION, PROCESS_FLAG, ORGANIZATION_CODE, SET_PROCESS_ID, TRANSACTION_TYPE) VALUES
(' SR25NOV10_8', --Item Number 'A', --Revision A
1,
'P1', --Organization Code
100001, -- Set process Id is the set of records in the interface table you want to process
'CREATE' --Transaction Type
);
COMMIT;
/* Initialize the system information Each database table that the program writes to requires system information, such as who is trying to update the current record. The user must provide this information to the import program by initializing certain variables. The program will retrieve system information from these variables, during operation. To initialize the variables, the user must call the following procedure
*/BEGIN
FND_GLOBAL.APPS_INITIALIZE (1090, 20634, 401,0); END;
/* Parameters:
a. User_id - 1090 is the FND User Id of the person launching this program.
b. Resp_ id - 20634 is the FND Responsibility Id the person is using.
c. Resp_appl_id - 401 is the Application Responsibility Id.
d. Security_group_id - 0 is the FND Security Group Id.
*/
--For more information about the above API refer the Oracle APIs and Open Interface Manual Guide
--This API submits the concurrent request from back end. DECLARE
REQUEST_NUMBER NUMBER; BEGIN
REQUEST_NUMBER:=FND_REQUEST.SUBMIT_REQUEST(
'INV', --Application Short Name 'INCOIN', --Concurrent Program Short Name NULL,
NULL, NULL,
81, -- Org ID
1,
1,
1,
1,
100001, -- Set process Id is the set of records in the interface table you want to process
1) -- create 1 or update 2 DBMS_OUTPUT.PUT_LINE(TO_CHAR(REQUEST_NUMBER));
Commit; END;
-- 上記の API の詳細については、Oracle APIs and Open Interface Manual Guide を参照してください。
たとえば、リクエスト ID 273524 が生成され、正常に完了しました。
アイテムを表示するには:
「Navigation Item」 -> 「Item Master」
そのアイテムを照会します
1. F11 キーを押します
2. アイテムの名前を入力します
3. Ctrl + F11 キーを押します
BOM の作成
APPS ユーザーを使用して接続します
次の Pl/sql コードを実行して BOM 構造を作成します
DECLARE
i NUMBER := 1; j NUMBER := 0;
--Declare the API inbound tables
l_bom_header_rec Bom_Bo_Pub.Bom_Head_Rec_Type := Bom_Bo_Pub.G_MISS_BOM_HEADER_REC; l_bom_revision_tbl Bom_Bo_Pub.Bom_Revision_Tbl_Type := Bom_Bo_Pub.G_MISS_BOM_REVISION_TBL; l_bom_component_tbl Bom_Bo_Pub.Bom_Comps_Tbl_Type:= Bom_Bo_Pub.G_MISS_BOM_COMPONENT_TBL;
l_bom_ref_designator_tbl Bom_Bo_Pub.Bom_Ref_Designator_Tbl_type:= Bom_Bo_Pub.G_MISS_BOM_REF_DESIGNATOR_TBL;
l_bom_sub_component_tbl Bom_Bo_Pub.Bom_Sub_Component_Tbl_Type := Bom_Bo_Pub.G_MISS_BOM_SUB_COMPONENT_TBL;
l_bom_comp_ops_tbl Bom_Bo_Pub.Bom_Comp_Ops_Tbl_Type := Bom_Bo_Pub.G_MISS_BOM_COMP_OPS_TBL;
API 送信テーブルを宣言します
l_x_bom_header_rec Bom_bo_pub.bom_head_rec_type;
l_x_bom_revision_tbl Bom_Bo_Pub.Bom_Revision_Tbl_Type;
l_x_bom_component_tbl Bom_Bo_Pub.Bom_Comps_Tbl_Type;
l_x_bom_ref_designator_tbl Bom_Bo_Pub.Bom_Ref_Designator_Tbl_type;
l_x_bom_sub_component_tbl Bom_Bo_Pub.Bom_Sub_Component_Tbl_Type;
l_x_bom_comp_ops_tbl Bom_Bo_Pub.Bom_Comp_Ops_Tbl_Type;
エラーハンドラを宣言します
l_error_message_list error_handler.error_tbl_type;
l_x_return_status Varchar2(2000);
l_x_msg_count Number;
l_d_current_date DATE := SYSDATE;

BEGIN
BOM ヘッダーの詳細
l_bom_header_rec.organization_code :='P1'; --Organization Code l_bom_header_rec.assembly_item_name:='SR_25NOV10_5'; -- BOM Namel_bom_header_rec.assembly_type:=1;
l_bom_header_rec.transaction_type:='CREATE'; -- Transaction Type CREATE or UPDATE
構成部品の詳細
l_bom_component_tbl(1).Organization_Code :='P1'; --Organization Code
l_bom_component_tbl (1).Assembly_Item_Name :='SR_25NOV10_5'; -- BOM Name
l_bom_component_tbl(1).item_sequence_number :=1; -- item sequence
l_bom_component_tbl(1).Operation_Sequence_Number :=1; --Operation Seq
l_bom_component_tbl(1).Component_Item_Name :='SR_25NOV10_6'; --Component
l_bom_component_tbl(1).Start_Effective_Date:=SYSDATE; -- Current Date
l_bom_component_tbl(1).Alternate_bom_code :=NULL;
l_bom_component_tbl(1).Quantity_per_assembly := 10; --Quantity
l_bom_component_tbl(1).Transaction_Type :='CREATE'; -- Transaction Type Create or Update
代用部品の詳細
l_bom_sub_component_tbl(i).Organization_Code:='P1'; --Organization Code
l_bom_sub_component_tbl(i).Assembly_Item_Name:= 'SR_25NOV10_5’; -- BOM Name
l_bom_sub_component_tbl(i).Start_Effective_Date :=SYSDATE; --Current Date
l_bom_sub_component_tbl(i).Operation_Sequence_Number :=1; --Operation Seq
l_bom_sub_component_tbl(i).Component_Item_Name :='SR_25NOV10_6'; --Component
l_bom_sub_component_tbl(i).Substitute_Component_Name:= 'SR_25NOV10_11'; --Sub. Comp.
l_bom_sub_component_tbl(i).Substitute_Item_Quantity:=100; -- Quantity
l_bom_sub_component_tbl(i).Transaction_Type:='CREATE'; -- Transaction Type
参照指定子
l_bom_ref_designator_tbl(i).Organization_Code:='P1'; --Organization Code
l_bom_ref_designator_tbl(i).Assembly_Item_Name:= 'SR_25NOV10_5’; -- BOM Name
l_bom_ref_designator_tbl(i).Start_Effective_Date :=SYSDATE; --Current Date
l_bom_ref_designator_tbl(i).Component_Item_Name := 'SR_25NOV10_6'; --Component
l_bom_ref_designator_tbl(i).Operation_Sequence_Number :=1; --Operation Seq
l_bom_ref_designator_tbl(i).Reference_Designator_Name :='SR-VIS1'; -- Ref. Designator
l_bom_ref_designator_tbl(i).Transaction_Type:='CREATE'; --Transaction Type
API を呼び出します
bom_bo_pub.Process_Bom
( p_bo_identifier =>'BOM'
, p_api_version_number => '1.0'
, p_init_msg_list => TRUE
, p_bom_header_rec => l_bom_header_rec
, p_bom_revision_tbl => l_bom_revision_tbl
, p_bom_component_tbl => l_bom_component_tbl
, p_bom_ref_designator_tbl => l_bom_ref_designator_tbl, p_bom_sub_component_tbl => l_bom_sub_component_tbl
, p_bom_comp_ops_tbl => l_bom_comp_ops_tbl
, x_bom_header_rec => l_x_bom_header_rec
, x_bom_revision_tbl => l_x_bom_revision_tbl
, x_bom_component_tbl => l_x_bom_component_tbl
, x_bom_ref_designator_tbl => l_x_bom_ref_designator_tbl
, x_bom_sub_component_tbl => l_x_bom_sub_component_tbl
, x_bom_comp_ops_tbl => l_x_bom_comp_ops_tbl
, x_return_status => l_x_return_status
, x_msg_count => l_x_msg_count
, p_debug => 'N'
, p_output_dir => '' --'/slot06/oracle/PQL09MS1db/9.2.0/temp'
, p_debug_filename => '' --'KK_BOM_BO.log'
);
dbms_output.put_line('Return Status = '||l_x_return_status); dbms_output.put_line('Message Count = '||l_x_msg_count);
/**** Error messages ****/
error_handler.Get_message_list(l_error_message_list);
--If l_x_return_status <> 'S' or l_x_return_status is null
--Then
-- Error Processing
For i In 1..l_x_msg_count Loop
dbms_output.put_line ( Substr(l_error_message_list(i).message_text, 1, 240) ); End Loop;
-- Else
dbms_output.put_line ('BOM processed successfully’);
-- End If; END;
ルーティングを作成します
Connect using APPS user
-- BOM_RTG_PUB.Process_Rtg API is to create, update and delete a routing
--Execute the following Pl/sql code to create Routing structure

DECLARE
l_index_i NUMBER := 0; l_index_j NUMBER := 0;Declare the API inbound tables
l_rtg_rec bom_rtg_pub.Rtg_Header_Rec_Type; l_rtg_rev_tbl bom_rtg_pub.Rtg_Revision_Tbl_Type; l_rtg_oper_tbl bom_rtg_pub.Operation_Tbl_Type; l_rtg_oper_res_tbl bom_rtg_pub.Op_Resource_Tbl_Type; l_rtg_sub_res_tbl bom_rtg_pub.Sub_Resource_Tbl_Type; l_op_network_tbl bom_rtg_Pub.Op_Network_Tbl_Type;
--Declare the API outbound tables
l_x_rtg_rec bom_rtg_pub.Rtg_Header_Rec_Type; l_x_rtg_rev_tbl bom_rtg_pub.Rtg_Revision_Tbl_Type; l_x_rtg_oper_tbl bom_rtg_pub.Operation_Tbl_Type; l_x_rtg_oper_res_tbl bom_rtg_pub.Op_Resource_Tbl_Type; l_x_rtg_sub_res_tbl bom_rtg_pub.Sub_Resource_Tbl_Type; l_x_op_network_tbl bom_rtg_Pub.Op_Network_Tbl_Type;

-- declare for error handler
l_error_message_list error_handler.error_tbl_type; l_x_return_status Varchar2(2000); l_x_msg_count Number;
--set values
rtg_header varchar2(100); l_d_current_date DATE := SYSDATE; -- Current Date
BEGIN
-- Routing header detail
l_rtg_rec.Assembly_item_name:= 'SR_02NOV10_8'; -- Routing ,Part Number l_rtg_rec.Organization_code := 'P1'; -- Organization Code l_rtg_rec.Eng_Routing_Flag := 2;
l_rtg_rec.Transaction_Type := 'CREATE'; -- Transaction Type CREATE,UPDATE,DELETE
--ROUTING OPERATION 10
l_rtg_oper_tbl(1).Assembly_item_name := 'SR_02NOV10_8'; -- Routing ,Part Number l_rtg_oper_tbl(1).Organization_code := 'P1'; -- Organization Code l_rtg_oper_tbl(1).Operation_Sequence_Number := 10; -- Operation Number l_rtg_oper_tbl(1).Operation_Type := 1;
l_rtg_oper_tbl(1).Department_code := 'DEPT1'; --Department Code l_rtg_oper_tbl(1).Transaction_type := 'CREATE'; -- Transaction Type CREATE,UPDATE,DELETE l_rtg_oper_tbl(1).START_EFFECTIVE_DATE := L_D_CURRENT_DATE ;
RESOURCE 1 FOR ROUTING OPERATION 10
l_rtg_oper_res_tbl(1).Assembly_item_name := 'SR_02NOV10_8'; -- Routing ,Part Number l_rtg_oper_res_tbl(1).Organization_code := 'P1'; -- Organization Code l_rtg_oper_res_tbl(1).Operation_Type := 1;
l_rtg_oper_res_tbl(1).Transaction_type := 'CREATE'; -- Transaction Type CREATE,UPDATE,DELETE l_rtg_oper_res_tbl(1).Op_Start_Effective_Date := l_d_current_date ; l_rtg_oper_res_tbl(1).Resource_Sequence_Number := 10; --Resource Seq. l_rtg_oper_res_tbl(1).Operation_Sequence_Number := 10; -- Operation Number l_rtg_oper_res_tbl(1).Resource_Code := 'RES1'; -- Resource Code

--CALL API
BOM_RTG_PUB.Process_Rtg
( p_bo_identifier => 'RTG'
, p_api_version_number =>1.0
, p_init_msg_list => TRUE
, p_rtg_header_rec => l_rtg_rec
, p_rtg_revision_tbl => l_rtg_rev_tbl
, p_operation_tbl => l_rtg_oper_tbl
, p_op_resource_tbl => l_rtg_oper_res_tbl
, p_sub_resource_tbl => l_rtg_sub_res_tbl
, p_op_network_tbl => l_op_network_tbl
, x_rtg_header_rec => l_x_rtg_rec
, x_rtg_revision_tbl => l_x_rtg_rev_tbl
, x_operation_tbl => l_x_rtg_oper_tbl
, x_op_resource_tbl => l_x_rtg_oper_res_tbl
, x_sub_resource_tbl => l_x_rtg_sub_res_tbl
, x_op_network_tbl => l_x_op_network_tbl
, x_return_status => l_x_return_status
, x_msg_count => l_x_msg_count
, p_debug => 'N'
, p_output_dir => NULL
, p_debug_filename => NULL
);

dbms_output.put_line('Return Status = '||l_x_return_status); dbms_output.put_line('Message Count = '||l_x_msg_count);
/**** Error messages ****/
error_handler.Get_message_list(l_error_message_list);
--If l_x_return_status <> 'S' or l_x_return_status is null
--Then
-- Error Processing
For i In 1..l_x_msg_count Loop
dbms_output.put_line ( Substr(l_error_message_list(i).message_text, 1, 240) ); End Loop;
--Else
dbms_output.put_line('RTG processed successfully' );
--End If; END;
ECO を使用した BOM とルーティングの作成
Connect using APPS user
-- Eng_eco_pub.Process_Eco API to used to create ECO
--Execute the following Pl/Sql code to create ECO
DECLARE
l_index_i NUMBER := 0; l_index_j NUMBER := 0;
-- Declare the API inbound tables
l_eco_rec eng_eco_pub.Eco_Rec_Type;
l_eco_revision_tbl eng_eco_pub.Eco_Revision_Tbl_Type; l_revised_item_tbl eng_eco_pub.Revised_Item_Tbl_Type;
l_rev_component_tbl bom_bo_pub.Rev_Component_Tbl_Type;
l_ref_designator_tbl bom_bo_pub.Ref_Designator_Tbl_Type;
l_sub_component_tbl bom_bo_pub.Sub_Component_Tbl_Type;
l_rev_operation_tbl bom_rtg_pub.Rev_Operation_Tbl_Type;
l_rev_op_resource_tbl bom_rtg_pub.Rev_Op_Resource_Tbl_Type;
l_rev_sub_resource_tbl bom_rtg_pub.Rev_Sub_Resource_Tbl_Type;
-- Declare the API outbound tables
l_x_eco_rec eng_eco_pub.Eco_Rec_Type;
l_x_eco_revision_tbl eng_eco_pub.Eco_Revision_Tbl_Type;
l_x_revised_item_tbl eng_eco_pub.Revised_Item_Tbl_Type;
l_x_rev_component_tbl bom_bo_pub.Rev_Component_Tbl_Type;
l_x_ref_designator_tbl bom_bo_pub.Ref_Designator_Tbl_Type;
l_x_sub_component_tbl bom_bo_pub.Sub_Component_Tbl_Type;
l_x_rev_operation_tbl bom_rtg_pub.Rev_Operation_Tbl_Type;
l_x_rev_op_resource_tbl bom_rtg_pub.Rev_Op_Resource_Tbl_Type;
l_x_rev_sub_resource_tbl bom_rtg_pub.Rev_Sub_Resource_Tbl_Type;l_error_message_list error_handler.error_tbl_type; l_x_return_status Varchar2(2000); l_x_msg_count Number;
eco_header varchar2(10);
l_d_current_date DATE := SYSDATE; --Current Date BEGIN
eco_header := 'SR_24NOV10'; --Name of the ECO l_revised_item_tbl.Delete;

-- ECO header details
l_eco_rec.eco_name := eco_header;
l_eco_rec.organization_code := 'P1'; --Organization Code
l_eco_rec.status_name := 'Open'; -- Status
l_eco_rec.approval_status_name := 'Approved'; --Approval Status
l_eco_rec.change_type_code := 'MFG Chg'; -- Change Type Code
l_eco_rec.description := 'MY DESCRIPTION'; -- Description
l_eco_rec.transaction_type := 'CREATE'; -- Transaction Type
l_eco_rec.plm_or_erp_change := 'ERP';--Use this line on 11.5.10.x
--CREATE a Revised Item(Routing) l_revised_item_tbl(1).Eco_Name := eco_header;
l_revised_item_tbl(1).Organization_Code := 'P1'; -- Organization Code
l_revised_item_tbl(1).Revised_Item_Name := 'SR_02NOV10_10'; -- Routing, Bom
l_revised_item_tbl(1).start_Effective_Date := l_d_current_date;
l_revised_item_tbl(1).NEW_ROUTING_REVISION := '--B'; --Revision
l_revised_item_tbl(1).Transaction_Type := 'CREATE'; -- Transaction Type
--- REVISED OPERATION 1
l_rev_operation_tbl(1).Eco_Name := eco_header;
l_rev_operation_tbl(1).Organization_Code := 'P1'; --Organization Code
l_rev_operation_tbl(1).Revised_Item_Name := 'SR_02NOV10_10'; -- Routing, Bom
l_rev_operation_tbl(1).NEW_ROUTING_REVISION := '--B'; --Revision
l_rev_operation_tbl(1).ACD_Type := 1; --Acd Type 1-Add,2-Change,3-Disable
l_rev_operation_tbl(1).Operation_Sequence_Number := 10; -- Operation sequence
l_rev_operation_tbl(1).New_Operation_Sequence_Number:= 10; -- Operation sequence
l_rev_operation_tbl(1).Operation_Type := 1;
l_rev_operation_tbl(1).Start_Effective_Date :=l_d_current_date;
l_rev_operation_tbl(1).Department_Code := 'DEPT1' ; -- Department Code
l_rev_operation_tbl(1).Transaction_Type := 'CREATE' ; -- Transaction Type
Revised Operation Resource 1
l_rev_op_resource_tbl(1).Eco_Name := eco_header;
l_rev_op_resource_tbl(1).Organization_Code := 'P1' ; --Organization Code
l_rev_op_resource_tbl(1).Revised_Item_Name := 'SR_02NOV10_10'; -- Routing, Bom
l_rev_op_resource_tbl(1).NEW_ROUTING_REVISION := '--B'; --Revision
l_rev_op_resource_tbl(1).ACD_Type := 1; --Acd Type 1-Add,2-Change,3-Disable
l_rev_op_resource_tbl(1).Operation_Sequence_Number := 10; -- Operation sequence
l_rev_op_resource_tbl(1).Operation_Type := 1;
l_rev_op_resource_tbl(1).Op_Start_Effective_Date := l_d_current_date;
l_rev_op_resource_tbl(1).Resource_Sequence_Number := 1; --Resource sequence
l_rev_op_resource_tbl(1).Resource_Code := 'RES1' ; -- Resource Code
l_rev_op_resource_tbl(1).Transaction_Type := 'CREATE' ; --Transaction Type

---------BOM------------------
-- CREATE a Revised Item
l_revised_item_tbl(2).Eco_Name := eco_header;
l_revised_item_tbl(2).Organization_Code := 'P1'; -- Organization_code
l_revised_item_tbl(2).Revised_Item_Name := 'SR_02NOV10_10'; -- Bom
l_revised_item_tbl(2).start_Effective_Date := l_d_current_date;
l_revised_item_tbl(2).NEW_REVISED_ITEM_REVISION :='--B'; -- Revision
l_revised_item_tbl(2).New_Revised_Item_Rev_Desc :='--B';
l_revised_item_tbl(2).Transaction_Type := 'CREATE'; -- Transaction Type

-- CREATE the component 1
l_rev_component_tbl(1).eco_name := eco_header;
l_rev_component_tbl(1).organization_code := 'P1'; -- Organization Code
l_rev_component_tbl(1).revised_item_name := 'SR_02NOV10_10'; --Bom
l_rev_component_tbl(1).NEW_REVISED_ITEM_REVISION :='--B'; -- Revision
l_rev_component_tbl(1).start_effective_date := l_d_current_date;
l_rev_component_tbl(1).Operation_Sequence_Number :=1; -- Operation Sequence
l_rev_component_tbl(1).Item_Sequence_Number := 10; -- Item sequence
l_rev_component_tbl(1).component_item_name := 'SR_02NOV10_11'; --Component
l_rev_component_tbl(1).transaction_type := 'CREATE'; -- Transaction Type
l_rev_component_tbl(1).acd_type :=1; --Acd Type 1-Add,2-Change,3-Disable
l_rev_component_tbl(1).quantity_per_assembly :=50; -- quantity

---sub component
l_sub_component_tbl (1).eco_name := eco_header;
l_sub_component_tbl (1).organization_code := 'P1'; -- Organization Code
l_sub_component_tbl (1).revised_item_name := 'SR_02NOV10_10'; -- Bom
l_sub_component_tbl(1).NEW_REVISED_ITEM_REVISION :='--B'; -- Revision
l_sub_component_tbl(1).start_effective_date := l_d_current_date;
l_sub_component_tbl(1).Operation_Sequence_Number :=1; -- Operation sequence
l_sub_component_tbl (1).transaction_type := 'CREATE'; -- Transcation_type
l_sub_component_tbl (1).acd_type := 1; --Acd Type 1-Add,2-Change,3-Disable
l_sub_component_tbl (1).component_item_name := 'SR_02NOV10_11'; -- Component name
l_sub_component_tbl (1).Substitute_Component_Name := 'SR_02NOV10_12'; --Sub. Component
l_sub_component_tbl (1).Substitute_Item_Quantity := 10; -- Quantity

---Ref Designator

l_ref_designator_tbl (1).eco_name := eco_header;
l_ref_designator_tbl (1).organization_code := 'P1'; -- Organization Code
l_ref_designator_tbl (1).revised_item_name := 'SR_02NOV10_10'; -- Bom
l_ref_designator_tbl(1).NEW_REVISED_ITEM_REVISION :='--B'; -- Revision
l_ref_designator_tbl(1).start_effective_date := l_d_current_date;
l_ref_designator_tbl(1).Operation_Sequence_Number :=1; -- Operation Seq.
l_ref_designator_tbl (1).transaction_type := 'CREATE'; -- Transaction Type
l_ref_designator_tbl (1).acd_type := 1; --Acd Type 1-Add,2-Change,3-Disable
l_ref_designator_tbl (1).component_item_name := 'SR_02NOV10_11'; --Component Name
l_ref_designator_tbl (1).REFERENCE_DESIGNATOR_NAME :='SR-VIS'; -- Ref Designator
BOM_GLOBALS.Set_BO_Identifier('ECO');

-- Call the API
eng_eco_pub.Process_Eco (
p_api_version_number => 1.0 -- This parameter is required. It is used by the
-- API to compare the version number of incoming
-- calls to its current version number.
, p_init_msg_list => True -- This parameter is set to TRUE, allows callers to
-- to request that the API do the initialization
-- of message lis
, x_return_status => l_x_return_status -- This is a flag that indicates the state of the
-- Whole business object after the import.
-- 'S' - Success
-- 'E' - Error
-- 'F' - Fatal Error
-- 'U' - Unexpected Error
, x_msg_count =>
l_x_msg_count -- This holds the number of messages in the API
-- message stack after the import.
, p_bo_identifier => 'ECO', p_eco_rec => l_eco_rec -- This is a record that holds the ECO header.
, p_eco_revision_tbl => l_eco_revision_tbl
, p_revised_item_tbl => l_revised_item_tbl
, p_rev_component_tbl => l_rev_component_tbl
, p_ref_designator_tbl => l_ref_designator_tbl
, p_sub_component_tbl => l_sub_component_tbl
, p_rev_operation_tbl => l_rev_operation_tbl
, p_rev_op_resource_tbl => l_rev_op_resource_tbl
, p_rev_sub_resource_tbl => l_rev_sub_resource_tbl
, x_eco_rec => l_x_eco_rec
, x_eco_revision_tbl => l_x_eco_revision_tbl
, x_revised_item_tbl => l_x_revised_item_tbl
, x_rev_component_tbl => l_x_rev_component_tbl
, x_ref_designator_tbl => l_x_ref_designator_tbl
, x_sub_component_tbl => l_x_sub_component_tbl
, x_rev_operation_tbl => l_x_rev_operation_tbl
, x_rev_op_resource_tbl => l_x_rev_op_resource_tbl
, x_rev_sub_resource_tbl => l_x_rev_sub_resource_tbl
,p_debug => 'N'
,p_output_dir => '/usr/tmp'
,p_debug_filename => 'SR4_ECO_BO.log'
);
--
dbms_output.put_line('Return Status = '||l_x_return_status);
dbms_output.put_line('Message Count = '||l_x_msg_count);
/**** Error messages ****/ error_handler.Get_message_list(l_error_message_list);
--If l_x_return_status <> 'S' or l_x_return_status is null
--Then
-- Error Processing
For i In 1..l_x_msg_count Loop
dbms_output.put_line ( Substr(l_error_message_list(i).message_text, 1, 240) );
End Loop;
--Else
dbms_output.put_line('ECO processed successfully' );
--End If;
END;
これは役に立ちましたか?