[Oracle EBS APIs]import Flow routing and DJ routing using BOM_RTG_PUB.PROCESS_RTG APIs

DJ routing --BOM模块的工艺路线

Flow routing -- Flow Manufacturing 模块使用的工艺路线,导入 Flow routing时先导入Line Operation,然后在导入Event.

CREATE OR REPLACE PROCEDURE SU_PROCESS_RTG_TEST AS

/*
*      Note:
*      bom_rtg_globals.G_OPR_CREATE  ==>  ‘CREATE‘;
*      bom_rtg_globals.G_OPR_UPDATE  ==>  ‘UPDATE‘;
*         bom_rtg_globals.G_OPR_DELETE  ==>  ‘DELETE‘;
*      CFM_Routing_Flag:  1==>Flow Routing,2==>DJ Routing
*      Operation_Type:   1==>Event,3==>Line Operation 2==>Process
*      import order: Line Operation => Event =>Process
*/
  -- API input variables
  l_operation_tbl    Bom_Rtg_Pub.Operation_Tbl_Type := Bom_Rtg_Pub.G_MISS_OPERATION_TBL;
  l_rtg_header_rec   Bom_Rtg_Pub.Rtg_Header_Rec_Type := Bom_Rtg_Pub.G_MISS_RTG_HEADER_REC;
  l_rtg_revision_tbl Bom_Rtg_Pub.Rtg_Revision_Tbl_Type := Bom_Rtg_Pub.G_MISS_RTG_REVISION_TBL;
  l_op_resource_tbl  Bom_Rtg_Pub.Op_Resource_Tbl_Type := Bom_Rtg_Pub.G_MISS_OP_RESOURCE_TBL;
  l_sub_resource_tbl Bom_Rtg_Pub.Sub_Resource_Tbl_Type := Bom_Rtg_Pub.G_MISS_SUB_RESOURCE_TBL;
  l_op_network_tbl   Bom_Rtg_Pub.Op_Network_Tbl_Type := Bom_Rtg_Pub.G_MISS_OP_NETWORK_TBL;

  -- API output variables
  x_rtg_header_rec   Bom_Rtg_Pub.Rtg_Header_Rec_Type; -- routing header record
  x_rtg_revision_tbl Bom_Rtg_Pub.Rtg_Revision_Tbl_Type; -- routing revisions
  x_operation_tbl    Bom_Rtg_Pub.Operation_Tbl_Type; -- routing operations
  x_op_resource_tbl  Bom_Rtg_Pub.Op_Resource_Tbl_Type; -- oepration resources
  x_sub_resource_tbl Bom_Rtg_Pub.Sub_Resource_Tbl_Type; -- sub operation resources
  x_op_network_tbl   Bom_Rtg_Pub.Op_Network_Tbl_Type; -- operation networks
  x_message_list     Error_Handler.Error_Tbl_Type;

  -- Other API variables
  l_return_status VARCHAR2(1) := NULL;
  l_msg_count     NUMBER := 0;
  l_cnt           NUMBER := 1;

  -- WHO columns
  l_user_id        NUMBER := -1;
  l_resp_id        NUMBER := -1;
  l_application_id NUMBER := -1;
  l_row_cnt        NUMBER := 1;
  l_user_name      VARCHAR2(30) := ‘xxxxxx‘;
  l_resp_name      VARCHAR2(300) := ‘xxxxx‘;

BEGIN

  -- Get the user_id
  SELECT user_id
    INTO l_user_id
    FROM fnd_user
   WHERE user_name = l_user_name;

  -- Get the application_id and responsibility_id
  SELECT application_id, responsibility_id
    INTO l_application_id, l_resp_id
    FROM fnd_responsibility
   WHERE responsibility_key = l_resp_name;

  -- Initialize applications information
  FND_GLOBAL.APPS_INITIALIZE(l_user_id, l_resp_id, l_application_id); -- Mfg / Mfg & Dist Mgr / INV
  dbms_output.put_line(‘Initialized applications context: ‘ || l_user_id || ‘ ‘ ||
                       l_resp_id || ‘ ‘ || l_application_id);

  -- Create the routing header
  l_rtg_header_rec.Assembly_Item_Name     := ‘TEST20160811‘;
  l_rtg_header_rec.Organization_Code      := ‘HAD‘;
  l_rtg_header_rec.Alternate_Routing_Code := NULL;
  l_rtg_header_rec.CFM_Routing_Flag       := 1; ---1==>Flow Routing,2==>DJ Routing
  l_rtg_header_rec.Line_Code              := ‘LHA420‘;
  l_rtg_header_rec.mixed_model_map_flag   := 2;
  --l_rtg_header_rec.Completion_Subinventory   :=  ‘FGI‘;
  l_rtg_header_rec.Transaction_Type := bom_rtg_globals.G_OPR_CREATE;
  l_rtg_header_rec.Attribute1       := ‘STD‘;
  l_rtg_header_rec.eng_routing_flag := 2;
  -- Create the routing operations
  --Line operation 1
  l_operation_tbl(l_cnt).Assembly_Item_Name := ‘TEST20160811‘;
  l_operation_tbl(l_cnt).Organization_Code := ‘HAD‘;
  l_operation_tbl(l_cnt).Alternate_Routing_Code := NULL;
  l_operation_tbl(l_cnt).Operation_Sequence_Number := ‘10‘;
  l_operation_tbl(l_cnt).Standard_Operation_Code := ‘5181‘;
  l_operation_tbl(l_cnt).Operation_Type := 3; ---Operation_Type:1==>Event,3==>Line Operation
  l_operation_tbl(l_cnt).Start_Effective_Date := SYSDATE - 10;
  l_operation_tbl(l_cnt).Yield := 0.87;
    l_operation_tbl(l_cnt).reference_flag :=2;
  l_operation_tbl(l_cnt).Transaction_Type := bom_rtg_globals.G_OPR_CREATE;

    --Line operation 2
  l_cnt := l_cnt + 1;
  l_operation_tbl(l_cnt).Assembly_Item_Name := ‘TEST20160811‘;
  l_operation_tbl(l_cnt).Organization_Code := ‘HAD‘;
  l_operation_tbl(l_cnt).Alternate_Routing_Code := NULL;
  l_operation_tbl(l_cnt).Operation_Sequence_Number := ‘20‘;
  l_operation_tbl(l_cnt).Standard_Operation_Code := ‘5005‘;
  l_operation_tbl(l_cnt).Operation_Type := 3;---Operation_Type:1==>Event,3==>Line Operation
  l_operation_tbl(l_cnt).Start_Effective_Date := SYSDATE - 20;  -- should match timestamp for UPDATE
  l_operation_tbl(l_cnt).Yield := 1.0;
    l_operation_tbl(l_cnt).reference_flag :=2;
  l_operation_tbl(l_cnt).Transaction_Type := bom_rtg_globals.G_OPR_CREATE;

    --Event1
    l_cnt := l_cnt + 1;
    l_operation_tbl(l_cnt).Assembly_Item_Name := ‘TEST20160811‘;
  l_operation_tbl(l_cnt).Organization_Code := ‘HAD‘;
  l_operation_tbl(l_cnt).Alternate_Routing_Code := NULL;
  l_operation_tbl(l_cnt).Operation_Sequence_Number := ‘10‘;
  l_operation_tbl(l_cnt).Standard_Operation_Code := ‘5181‘;
  l_operation_tbl(l_cnt).Operation_Type := 1; ---Operation_Type:1==>Event,3==>Line Operation
  l_operation_tbl(l_cnt).Line_Op_Seq_Number := 10;
  l_operation_tbl(l_cnt).Line_Op_Code := ‘5181‘;
  l_operation_tbl(l_cnt).Start_Effective_Date := SYSDATE - 10;
  l_operation_tbl(l_cnt).Yield := 0.87;
    l_operation_tbl(l_cnt).reference_flag :=2;
  l_operation_tbl(l_cnt).Transaction_Type := bom_rtg_globals.G_OPR_CREATE;
    --Event2
    l_cnt := l_cnt + 1;
    l_operation_tbl(l_cnt).Assembly_Item_Name := ‘TEST20160811‘;
  l_operation_tbl(l_cnt).Organization_Code := ‘HAD‘;
  l_operation_tbl(l_cnt).Alternate_Routing_Code := NULL;
  l_operation_tbl(l_cnt).Operation_Sequence_Number := ‘20‘;
  l_operation_tbl(l_cnt).Standard_Operation_Code := ‘5005‘;
  l_operation_tbl(l_cnt).Operation_Type := 1; ---Operation_Type:1==>Event,3==>Line Operation
  l_operation_tbl(l_cnt).Line_Op_Seq_Number := 10;
  l_operation_tbl(l_cnt).Line_Op_Code := ‘5181‘;
  l_operation_tbl(l_cnt).Start_Effective_Date := SYSDATE - 10;
  l_operation_tbl(l_cnt).Yield := 0.87;
    l_operation_tbl(l_cnt).reference_flag :=2;
  l_operation_tbl(l_cnt).Transaction_Type := bom_rtg_globals.G_OPR_CREATE;  

  -- initialize error stack for logging errors
  Error_Handler.initialize;

  -- call API to create / update routing
  DBMS_OUTPUT.PUT_LINE(‘=======================================================‘);
  DBMS_OUTPUT.PUT_LINE(‘Calling Bom_Rtg_Pub.Process_Rtg 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_header_rec,
                          p_rtg_revision_tbl   => l_rtg_revision_tbl,
                          p_operation_tbl      => l_operation_tbl,
                          p_op_resource_tbl    => l_op_resource_tbl,
                          p_sub_resource_tbl   => l_sub_resource_tbl,
                          p_op_network_tbl     => l_op_network_tbl,
                          x_rtg_header_rec     => x_rtg_header_rec,
                          x_rtg_revision_tbl   => x_rtg_revision_tbl,
                          x_operation_tbl      => x_operation_tbl,
                          x_op_resource_tbl    => x_op_resource_tbl,
                          x_sub_resource_tbl   => x_sub_resource_tbl,
                          x_op_network_tbl     => x_op_network_tbl,
                          x_return_status      => l_return_status,
                          x_msg_count          => l_msg_count,
                          p_debug              => ‘N‘,
                          p_output_dir         => ‘/usr/tmp/‘,
                          p_debug_filename     => ‘rtg_bo_debug.log‘);

  DBMS_OUTPUT.PUT_LINE(‘=======================================================‘);
  DBMS_OUTPUT.PUT_LINE(‘Return Status: ‘ || l_return_status);

  IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
    dbms_output.put_line(‘x_msg_count:‘ || l_msg_count);

    Error_Handler.GET_MESSAGE_LIST(x_message_list => x_message_list);
    DBMS_OUTPUT.PUT_LINE(‘Error Message Count :‘ || x_message_list.COUNT);
    FOR i IN 1 .. x_message_list.COUNT LOOP
      DBMS_OUTPUT.PUT_LINE(to_char(i) || ‘:‘ || x_message_list(i)
                           .entity_index || ‘:‘ || x_message_list(i)
                           .table_name);
      DBMS_OUTPUT.PUT_LINE(to_char(i) || ‘:‘ || x_message_list(i)
                           .message_text);
    END LOOP;
  END IF;
  DBMS_OUTPUT.PUT_LINE(‘=======================================================‘);

EXCEPTION
  WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE(‘Exception Occured :‘);
    DBMS_OUTPUT.PUT_LINE(SQLCODE || ‘:‘ || SQLERRM);
    DBMS_OUTPUT.PUT_LINE(‘=======================================================‘);
    RAISE;
END;
时间: 2024-11-08 18:19:00

[Oracle EBS APIs]import Flow routing and DJ routing using BOM_RTG_PUB.PROCESS_RTG APIs的相关文章

Oracle EBS Form Builder使用Java beans创建窗体

最近有个项目,需要研究一下Oracle的E-Business Sutie(EBS),对于以前没接触此套件的我来说,简直太痛苦了.在网上找了一堆资料,试着进行Form二次开发,也遇到各类奇葩问题.目前遇到最大的一个问题是,如何在本地 Form Builder中进行窗体构建,并调用后台的JavaBean对窗体进行交互?网上也有不少的解决方案,但是都存在一些差异,试了很多次,终于实现了我预期的效果. 为了防止以后再遇到类似的问题,先做一个记录,以备后查. 1.环境搭建说明  服务器:Oracle EB

Oracle EBS OM RMA销售退货异常处理(Datafix)

系统版本: RDBMS : 9.2.0.6.0 Oracle 应用产品 : 11.5.10.2 问题症状:       1.通过物料事务处理查看销售订单行退货记录显示已经入库为40: 2.销售退货订单行已经接收入库.但是,订单行状态仍然是"等待退货",发运数量为空: 3.销售退货仍然能做RMA接收40数量.但是,查看接收事务处理记录显示已经接收入库了: 4.AR接口行和AR事务处理没有找到对应销售退货订单行的记录: 5.销售退货订单行工作流报错: EBS群下的朋友说要Datafix.但

Oracle EBS WMS功能介绍(二)

(版权声明,本人原创或者翻译的文章如需转载,如转载用于个人学习,请注明出处:否则请与本人联系,违者必究) 出货物流逻辑主要包括 1.      打包,可以进行多层嵌套式的打包,并通知用户为订单所做的特殊打包方法.打包可以在拣货时做,也可以作为一个独立的操作来做. 2.      为行程进行码头预约,可以使仓库经理计划出库运输公司的预约,码头门的可用性和仓库内的待装区的使用. 3.      拣货方法,为不同订单的拣货需要选择不同的拣货方法. 4.      管理拣货,可以使订单基于移动手持应用拣

Oracle EBS Model Function Technical

?.Oracle EBS(ERP)Oracle 是公司名字,这个我估计大家都知道.EBS是E-Business Suite的缩写,简单的说,就是Oracle做的一个企业级的信息化软件或者系统,里面包含了财务,人力,分销,资产等很多企业用的到的模块.现在主流的就是SAP和Oracle EBS.在EBS 顾问这个行业,粗略的有以下分工.?.Oracle EBS Function Consultant 功能顾问功能顾问呢,就是业务顾问,可以理解为普通软件行业的产品经理,主要是熟悉业务的同时也熟悉系统相

Oracle EBS 12.2.6 on VirtualBox

Back in May, Oracle announced the general availability of Oracle VM Virtual Appliance for E-Business Suite 12.2.6 for download from the Oracle Software Delivery Cloud. In this series of Blog posts I will detail how you can build an Oracle EBS 12.2.6

Oracle EBS 提示XX对当前用户不可用--XX is not a valid responsibility for the current user

Oracle EBS 提示XX对当前用户为不可用职责--XX is not a valid responsibility for the current user 最近在EBS中添加新职责进行切换没问题,但是要进入相关职责的Form或Web页面则会碰到如图的难题.解决方法是这样的. 1. 进入Functional Administrator职责. 2. 选择Core Services->Caching Framework->Global Configuration. 3. 分别Clear Al

Oracle EBS的BIP报表中显示特殊字体

http://oracleseeker.com/2009/08/25/font_mapping_setup_for_special_character_print_in_oracle_ebs_bip/ 如若在BIP报表中使用了一些特殊的字体,这些字体在JRE的字体库中没有的话,则BIP报表的运行结果就不正确,最典型的例子就是条码字体的打印. 如下图是我在rtf模板中使用code39字体设计的条码显示 但是在Oracle EBS环境下运行之后的结果如下,条码字体的格式丢失了: 这是由于FO引擎在生

Oracle EBS R12 - 怎样更改SYSADMIN的password

SQL> select * from v$version; BANNER -------------------------------------------------------------------------------- Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production PL/SQL Release 11.1.0.7.0 - Production CORE    11.1.0.7

Oracle EBS 采购 接收入库 接口开发

http://blog.itpub.net/25164132/viewspace-746657/ 接收入库是项目中会经常碰到的开发,这类开发一般来说比较简单,但是接收入库在Oracle中其实涉及到很多模块,其中层次较多,也可以做得比较复杂.本文将尽可能深入细致地讨论接收入库的流程,种类,数据来源,数据的流动路径,以及各个数据点之间的对应关系.最后将给出一个较为全面的接收入库的样例代码.接收入库的种类接收入库可以按照数据来源分为2种:1.         对于po订单以及发放的接收入库:2.