BOM_创建更新物料清单脚本
以下是EBS创建和更新物料清单API案例,详细代码如下,仅供参考。
--以下脚本为创建物料清单脚本
--transaction_type 为CREATE 时创建 UPDATE 时候更新
--该脚本经过验证
--added 2019-10-11
DECLARE-- API input variablesl_bom_header_rec bom_bo_pub.bom_head_rec_type; --BOM Header Recordl_bom_revision_tbl bom_bo_pub.bom_revision_tbl_type; --BOM Revision Tablel_bom_component_tbl bom_bo_pub.bom_comps_tbl_type; --BOM Compinent table -for component recordsl_bom_ref_designator_tbl bom_bo_pub.bom_ref_designator_tbl_type; --BOM Reference Designator table -for reference designatorsl_bom_sub_component_tbl bom_bo_pub.bom_sub_component_tbl_type; --BOM Substitute Components table -for substitute components-- API output variablesx_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 APIx_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;
BEGINfnd_global.apps_initialize(user_id => 246663,resp_id => 79178,resp_appl_id => 20064);--初始化 l_bom_revision_tbl := bom_bo_pub.g_miss_bom_revision_tbl;l_bom_ref_designator_tbl := bom_bo_pub.g_miss_bom_ref_designator_tbl;l_bom_sub_component_tbl := bom_bo_pub.g_miss_bom_sub_component_tbl;l_bom_component_tbl := bom_bo_pub.g_miss_bom_component_tbl;--物料清单 l_bom_header_rec := bom_bo_pub.g_miss_bom_header_rec;l_bom_header_rec.organization_code := 'SWA'; --库存组织 l_bom_header_rec.assembly_item_name := 'S05502502001574'; --装配件物料l_bom_header_rec.assembly_type := 1;l_bom_header_rec.transaction_type := 'CREATE';l_bom_header_rec.alternate_bom_code := 'V1078227'; --替代项l_bom_header_rec.bom_implementation_date := to_date('2019-10-11','YYYY-MM-DD'); --日期 l_bom_header_rec.attribute1 := 'AIRBI_ZYZQ'; --完工子库存l_bom_header_rec.attribute2 := '1'; --货期l_bom_header_rec.attribute3 := 'BOM_TYPE_PRODUCTION'; --BOM类型 --物料清单组件1l_component_cnt := 1;l_bom_component_tbl(l_component_cnt).transaction_type := 'CREATE';l_bom_component_tbl(l_component_cnt).organization_code := l_bom_header_rec.organization_code;l_bom_component_tbl(l_component_cnt).assembly_item_name := l_bom_header_rec.assembly_item_name;l_bom_component_tbl(l_component_cnt).alternate_bom_code := l_bom_header_rec.alternate_bom_code;l_bom_component_tbl(l_component_cnt).item_sequence_number := '10'; --物料序号l_bom_component_tbl(l_component_cnt).operation_sequence_number := '1'; --工序l_bom_component_tbl(l_component_cnt).component_item_name := 'S05502502001484'; --组件物料 l_bom_component_tbl(l_component_cnt).basis_type := NULL; -- 基准 null.物料 2.批次 l_bom_component_tbl(l_component_cnt).wip_supply_type := 1; -- 供应类型 1.推式 3.工序拉式 l_bom_component_tbl(l_component_cnt).quantity_per_assembly := 2; --数量l_bom_component_tbl(l_component_cnt).supply_subinventory := 'AIRBI_ZYZQ'; --子库存 l_bom_component_tbl(l_component_cnt).comments := 'Test 12345';l_bom_component_tbl(l_component_cnt).start_effective_date := SYSDATE; --起始日期 l_bom_component_tbl(l_component_cnt).attribute1 := 'BOM_TYPE_GROUP_BUY'; --组件来源 --物料清单组件1替代项1 l_sub_component_cnt := 1;l_bom_sub_component_tbl(l_sub_component_cnt).transaction_type := 'CREATE';l_bom_sub_component_tbl(l_sub_component_cnt).organization_code := l_bom_header_rec.organization_code;l_bom_sub_component_tbl(l_sub_component_cnt).assembly_item_name := l_bom_header_rec.assembly_item_name;l_bom_sub_component_tbl(l_sub_component_cnt).alternate_bom_code := l_bom_header_rec.alternate_bom_code;l_bom_sub_component_tbl(l_sub_component_cnt).operation_sequence_number := l_bom_component_tbl(l_component_cnt).operation_sequence_number;l_bom_sub_component_tbl(l_sub_component_cnt).component_item_name := l_bom_component_tbl(l_component_cnt).component_item_name;l_bom_sub_component_tbl(l_sub_component_cnt).substitute_component_name := '01001000100010015'; --替代组件l_bom_sub_component_tbl(l_sub_component_cnt).substitute_item_quantity := 10;l_bom_sub_component_tbl(l_sub_component_cnt).start_effective_date := SYSDATE; --起始日期 --物料清单组件2l_component_cnt := l_component_cnt + 1;l_bom_component_tbl(l_component_cnt).transaction_type := 'CREATE';l_bom_component_tbl(l_component_cnt).organization_code := l_bom_header_rec.organization_code;l_bom_component_tbl(l_component_cnt).assembly_item_name := l_bom_header_rec.assembly_item_name;l_bom_component_tbl(l_component_cnt).alternate_bom_code := l_bom_header_rec.alternate_bom_code;l_bom_component_tbl(l_component_cnt).item_sequence_number := '20'; --物料序号l_bom_component_tbl(l_component_cnt).operation_sequence_number := '1'; --工序l_bom_component_tbl(l_component_cnt).component_item_name := 'S05502502001583'; --组件物料 l_bom_component_tbl(l_component_cnt).basis_type := NULL; -- 基准 null.物料 2.批次 l_bom_component_tbl(l_component_cnt).wip_supply_type := 1; -- 供应类型 1.推式 3.工序拉式 l_bom_component_tbl(l_component_cnt).quantity_per_assembly := 3; --数量l_bom_component_tbl(l_component_cnt).supply_subinventory := 'AIRBI_ZYZQ'; --子库存 l_bom_component_tbl(l_component_cnt).comments := 'Test 12345';l_bom_component_tbl(l_component_cnt).start_effective_date := SYSDATE; --起始日期 l_bom_component_tbl(l_component_cnt).attribute1 := 'BOM_TYPE_GROUP_BUY'; --组件来源 -- initialize error stack for logging errors error_handler.initialize;-- call API to create / update bill dbms_output.put_line('Calling Bom_Bo_Pub.process_bom 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,x_bom_header_rec => x_bom_header_rec,x_bom_revision_tbl => x_bom_revision_tbl,x_bom_component_tbl => x_bom_component_tbl,x_bom_ref_designator_tbl => x_bom_ref_designator_tbl,x_bom_sub_component_tbl => x_bom_sub_component_tbl,x_return_status => l_return_status,x_msg_count => l_msg_count,p_debug => l_debug,p_output_dir => l_output_dir,p_debug_filename => l_debug_filename);IF l_return_status <> fnd_api.g_ret_sts_success THENdbms_output.put_line('Create Bom Error;');error_handler.get_message_list(x_message_list => l_error_table);FOR i IN 1 .. l_error_table.count LOOPdbms_output.put_line('[' || i || ']' || l_error_table(i).table_name || ' ' || l_error_table(i).message_text);END LOOP;ELSEdbms_output.put_line('Create Bom Success;');END IF;EXCEPTIONWHEN OTHERS THENdbms_output.put_line('Exception Occured :' || SQLERRM || dbms_utility.format_error_backtrace);
END;
BOM_创建更新物料清单脚本相关推荐
- 基于catalog 创建RMAN存储脚本
为什么80%的码农都做不了架构师?>>> --============================== -- 基于catalog 创建RMAN存储脚本 --======== ...
- 用chrome的snippets片段功能创建页面js外挂程序,从控制台创建js小脚本
用chrome的snippets片段功能创建页面js外挂程序,从控制台创建js小脚本 Chrome的snippets是小脚本,还可以创作并在Chrome DevTools的来源面板中执行. 可以访问和 ...
- python创建脚本文件_python创建文件备份的脚本
制作文件备份 打开原文件 old_f_name = input("请输入备份的文件路径:") old_f = open(old_f_name, "r") 打开新 ...
- 属性面板 脚本_3.1 创建和使用脚本
在unity中,游戏物体的行为是通过组件来驱动的,我们可以通过内建的组件来给我们的游戏物体组合各种能力,尽管如此,要知道我们的需求永远是动态的,很快我们就会发现,内建的组件功能已经无法满足我们的需求, ...
- c#网页自动化脚本语言,c# – 创建用于创建网页的脚本语言
我正在创建一个用于创建网页的脚本语言,但不知道从哪里开始. 我有一个看起来像这样的文件: mylanguagename(main) { OnLoad(protected) { Display(img, ...
- mysql begin end 用法_超实用的Mysql动态更新数据库脚本的示例讲解(推荐)
今天小编为大家分享一篇关于Mysql动态更新数据库脚本的示例讲解,具体的upgrade脚本如下: 动态删除索引 DROP PROCEDURE IF EXISTS UPGRADE;DELIMITER $ ...
- index 生成创建index的脚本
创建创建index的脚本: SELECT DBMS_METADATA.GET_DDL('INDEX',u.index_name) FROM USER_INDEXES u; 转载于:https://bl ...
- bash脚本创建变量_创建一个Bash脚本模板
bash脚本创建变量 在本系列的第一篇文章中,您创建了一个很小的单行Bash脚本,并探讨了创建Shell脚本的原因,以及为什么它们是系统管理员而非编译程序最有效的选择. 在第二篇文章中,您将开始创建一 ...
- vhs预设_使用Linux将VHS数字化,创建Bash完成脚本,Ansible,家庭自动化等
vhs预设 上周,我们最受欢迎的文章涵盖了家庭和工作场所技术的一系列有趣且实用的用途. 以下是3月19日至25日的读者最爱列表: 如何创建Bash完成脚本 ,作者Lazarus Lazaridis 作 ...
最新文章
- 雨林木风爱好者GHOSTXP装机版_NTFS_SP3_2010_03
- 这样的烂代码,我实习的时候都写不出来!
- Best Time to Buy and Sell Stock(动态规划)
- foreach ($cc as $key = $item);$item加与不加的区别
- Maven的pom.xml文件详解------Environment Settings
- PHP+MySQL 跨服务器跨数据库数据拷贝系统
- matlab多变量频域设计工具箱,10.4.3用MATLAB实现连续系统的频域分析.ppt
- 学习hadoop需要什么基础
- 微信小程序|开发实战篇之request请求(单个、多个参数,json对象,header)
- Python在Win10系统的安装和使用配置
- ikun 潜入?疑似 B 站后台源码泄露
- 编译VCL(android)错误
- mongoDB VS PostgreSQL dml performance use python (pymongo py-postgresql)
- windbg学习23(!peb和PEB结构)
- FastReport 安装方法
- RT-Thread 应用方面的一点总结(二)
- LintCode 1173.反转字符串
- Halcon入门(3)——回形针目标提取
- Python_第六篇 第三方安装包(1)_fancyimpute介绍及使用
- Wallpaper Changer