以下是EBS创建和更新物料清单API案例,详细代码如下,仅供参考。
--以下脚本为创建物料清单脚本
--transaction_type 为CREATE 时创建 UPDATE 时候更新
--该脚本经过验证
--added 2019-10-11
DECLARE
-- API input variables
l_bom_header_rec bom_bo_pub.bom_head_rec_type; --BOM Header Record
l_bom_revision_tbl bom_bo_pub.bom_revision_tbl_type; --BOM Revision Table
l_bom_component_tbl bom_bo_pub.bom_comps_tbl_type; --BOM Compinent table -for component records
l_bom_ref_designator_tbl bom_bo_pub.bom_ref_designator_tbl_type; --BOM Reference Designator table -for reference designators
l_bom_sub_component_tbl bom_bo_pub.bom_sub_component_tbl_type; --BOM Substitute Components table -for substitute components
-- API output variables
x_bom_header_rec bom_bo_pub.bom_head_rec_type := bom_bo_pub.g_miss_bom_header_rec; --Output BOM Header Record
--Other BOM output tables - Each of there records hold a return status value and orther IDs as returned by the API
x_bom_revision_tbl bom_bo_pub.bom_revision_tbl_type := bom_bo_pub.g_miss_bom_revision_tbl;
x_bom_component_tbl bom_bo_pub.bom_comps_tbl_type := bom_bo_pub.g_miss_bom_component_tbl;
x_bom_ref_designator_tbl bom_bo_pub.bom_ref_designator_tbl_type := bom_bo_pub.g_miss_bom_ref_designator_tbl;
x_bom_sub_component_tbl bom_bo_pub.bom_sub_component_tbl_type := bom_bo_pub.g_miss_bom_sub_component_tbl;
x_message_list error_handler.error_tbl_type;
l_error_table error_handler.error_tbl_type;
l_debug VARCHAR2(1) := 'N';
l_output_dir VARCHAR2(240); --'/usr/tmp';
l_debug_filename VARCHAR2(60); -- 'bom_debug_07_16.dbg';
l_return_status VARCHAR2(1);
l_msg_count NUMBER;
l_component_cnt NUMBER;
l_sub_component_cnt NUMBER;