Oracle EBS OPM 发放生产批

--发放生产批
--created by jenrry

DECLARE
   x_return_status            VARCHAR2 (1);
   l_exception_material_tbl   gme_common_pvt.exceptions_tab;
   l_batch_header_rec         gme_batch_header%ROWTYPE;
   l_in_batch_header_rec      gme_batch_header%ROWTYPE;
   l_org_code                 VARCHAR2 (3);
   l_ignore_exception         VARCHAR2 (1);
   l_val_ff                   VARCHAR2 (1);
   x_message_count            NUMBER;
   x_message_list             VARCHAR2 (2000);
   l_user_name                VARCHAR2 (80);
   l_user_id                  NUMBER;

   CURSOR get_user_id (v_user_name IN VARCHAR2)
   IS
      SELECT user_id
        FROM fnd_user
       WHERE user_name = v_user_name;

   PROCEDURE display_messages (p_msg_count IN NUMBER)
   IS
      MESSAGE               VARCHAR2 (2000);
      dummy                 NUMBER;
      l_api_name   CONSTANT VARCHAR2 (30)   := ‘DISPLAY_MESSAGES‘;
   BEGIN
      FOR i IN 1 .. p_msg_count
      LOOP
         fnd_msg_pub.get (p_msg_index          => i,
                          p_data               => MESSAGE,
                          p_encoded            => ‘F‘,
                          p_msg_index_out      => dummy
                         );
         DBMS_OUTPUT.put_line (‘Message ‘ || TO_CHAR (i) || ‘ ‘ || MESSAGE);
      END LOOP;
   EXCEPTION
      WHEN OTHERS
      THEN
         fnd_msg_pub.add_exc_msg (‘wrapper for Release_Batch ‘, l_api_name);
   END display_messages;
BEGIN
   DBMS_OUTPUT.ENABLE (20000);
   l_user_name := ‘SYSADMIN‘;

   OPEN get_user_id (l_user_name);

   FETCH get_user_id
    INTO l_user_id;

   IF get_user_id%NOTFOUND
   THEN
      DBMS_OUTPUT.put_line (‘Invalid User ‘ || l_user_name);

      CLOSE get_user_id;

      RAISE NO_DATA_FOUND;
   END IF;

   CLOSE get_user_id;

   fnd_profile.initialize (l_user_id);
   fnd_global.apps_initialize (user_id           => l_user_id,
                               resp_id           => NULL,
                               resp_appl_id      => NULL
                              );
   l_in_batch_header_rec.batch_no := ‘20170731‘;
   l_org_code := ‘B01‘;
   l_in_batch_header_rec.actual_start_date :=
                      TO_DATE (‘07-31-2017 08:00:00‘, ‘MM-DD-YYYY HH24:MI:SS‘);
   l_ignore_exception := fnd_api.g_true;
   l_val_ff := fnd_api.g_true;
   gme_api_pub.release_batch
                         (p_api_version                 => 2.0,
                          p_validation_level            => gme_common_pvt.g_max_errors,
                          p_init_msg_list               => fnd_api.g_true,
                          p_commit                      => fnd_api.g_true,
                          x_message_count               => x_message_count,
                          x_message_list                => x_message_list,
                          x_return_status               => x_return_status,
                          p_batch_header_rec            => l_in_batch_header_rec,
                          p_org_code                    => l_org_code,
                          p_ignore_exception            => l_ignore_exception,
                          p_validate_flexfields         => l_val_ff,
                          x_batch_header_rec            => l_batch_header_rec,
                          x_exception_material_tbl      => l_exception_material_tbl
                         );
   DBMS_OUTPUT.put_line (SUBSTR (‘x_return_status = ‘ || x_return_status,
                                 1,
                                 255
                                )
                        );
   DBMS_OUTPUT.put_line (   ‘l_batch_header_rec.batch_id = ‘
                         || TO_CHAR (l_batch_header_rec.batch_id)
                        );
   DBMS_OUTPUT.put_line (   ‘l_batch_header_rec.organization_id = ‘
                         || TO_CHAR (l_batch_header_rec.organization_id)
                        );
   DBMS_OUTPUT.put_line (SUBSTR (   ‘l_batch_header_rec.batch_no = ‘
                                 || l_batch_header_rec.batch_no,
                                 1,
                                 255
                                )
                        );
   DBMS_OUTPUT.put_line (   ‘l_batch_header_rec.batch_type = ‘
                         || TO_CHAR (l_batch_header_rec.batch_type)
                        );
   DBMS_OUTPUT.put_line (   ‘l_batch_header_rec.plan_start_date = ‘
                         || TO_CHAR (l_batch_header_rec.plan_start_date,
                                     ‘DD-MON-YYYY HH24:MI:SS‘
                                    )
                        );
   DBMS_OUTPUT.put_line (   ‘l_batch_header_rec.plan_cmplt_date = ‘
                         || TO_CHAR (l_batch_header_rec.plan_cmplt_date,
                                     ‘DD-MON-YYYY HH24:MI:SS‘
                                    )
                        );
   DBMS_OUTPUT.put_line (   ‘l_batch_header_rec.actual_start_date = ‘
                         || TO_CHAR (l_batch_header_rec.actual_start_date,
                                     ‘DD-MON-YYYY HH24:MI:SS‘
                                    )
                        );
   DBMS_OUTPUT.put_line (   ‘l_batch_header_rec.actual_cmplt_date = ‘
                         || TO_CHAR (l_batch_header_rec.actual_cmplt_date,
                                     ‘DD-MON-YYYY HH24:MI:SS‘
                                    )
                        );
   DBMS_OUTPUT.put_line (   ‘l_batch_header_rec.batch_status = ‘
                         || TO_CHAR (l_batch_header_rec.batch_status)
                        );
   DBMS_OUTPUT.put_line (   ‘l_batch_header_rec.last_update_date = ‘
                         || TO_CHAR (l_batch_header_rec.last_update_date,
                                     ‘DD-MON-YYYY HH24:MI:SS‘
                                    )
                        );
   DBMS_OUTPUT.put_line (   ‘l_batch_header_rec.last_updated_by = ‘
                         || TO_CHAR (l_batch_header_rec.last_updated_by)
                        );
   DBMS_OUTPUT.put_line (   ‘l_batch_header_rec.creation_date = ‘
                         || TO_CHAR (l_batch_header_rec.creation_date,
                                     ‘DD-MON-YYYY HH24:MI:SS‘
                                    )
                        );
   DBMS_OUTPUT.put_line (   ‘l_batch_header_rec.created_by = ‘
                         || TO_CHAR (l_batch_header_rec.created_by)
                        );
   DBMS_OUTPUT.put_line (   ‘l_batch_header_rec.last_update_login = ‘
                         || TO_CHAR (l_batch_header_rec.last_update_login)
                        );

   FOR i IN 1 .. l_exception_material_tbl.COUNT
   LOOP
      DBMS_OUTPUT.put_line (‘Record i = ‘ || TO_CHAR (i));
      DBMS_OUTPUT.put_line
                        (   ‘l_exception_material_tbl(i).ORGANIZATION_ID = ‘
                         || TO_CHAR
                                  (l_exception_material_tbl (i).organization_id
                                  )
                        );
      DBMS_OUTPUT.put_line (   ‘l_exception_material_tbl(i).BATCH_ID = ‘
                            || TO_CHAR (l_exception_material_tbl (i).batch_id)
                           );
      DBMS_OUTPUT.put_line
                      (   ‘l_exception_material_tbl(i).MATERIAL_DETAIL_ID = ‘
                       || TO_CHAR
                               (l_exception_material_tbl (i).material_detail_id
                               )
                      );
      DBMS_OUTPUT.put_line
                  (   ‘l_exception_material_tbl(i).PENDING_MOVE_ORDER_IND = ‘
                   || TO_CHAR
                           (l_exception_material_tbl (i).pending_move_order_ind
                           )
                  );
      DBMS_OUTPUT.put_line
                (   ‘l_exception_material_tbl(i).PENDING_RESERVATIONS_IND = ‘
                 || TO_CHAR
                         (l_exception_material_tbl (i).pending_reservations_ind
                         )
                );
      DBMS_OUTPUT.put_line
                          (   ‘l_exception_material_tbl(i).TRANSACTED_QTY = ‘
                           || TO_CHAR
                                   (l_exception_material_tbl (i).transacted_qty
                                   )
                          );
      DBMS_OUTPUT.put_line (   ‘l_exception_material_tbl(i).EXCEPTION_QTY = ‘
                            || TO_CHAR
                                    (l_exception_material_tbl (i).exception_qty
                                    )
                           );
   END LOOP;

   DBMS_OUTPUT.put_line (‘x_message_count = ‘ || TO_CHAR (x_message_count));
   DBMS_OUTPUT.put_line (SUBSTR (‘x_message_list = ‘ || x_message_list, 1,
                                 255)
                        );

   IF x_message_count > 0
   THEN
      display_messages (x_message_count);
   END IF;
EXCEPTION
   WHEN OTHERS
   THEN
      DBMS_OUTPUT.put_line (‘Error ‘ || TO_CHAR (SQLCODE) || ‘: ‘ || SQLERRM);
      RAISE;
END;
/

  

原文地址:https://www.cnblogs.com/jenrry/p/10021138.html

时间: 2024-10-08 20:33:08

Oracle EBS OPM 发放生产批的相关文章

Oracle EBS OPM 取消生产批

--取消生产批 --created by jenrry SET serveroutput on; DECLARE p_batch_header_rec gme_batch_header%ROWTYPE; x_batch_header_rec gme_batch_header%ROWTYPE; x_return_status VARCHAR2 (2000); p_validation_level NUMBER; p_init_msg_list VARCHAR2 (2000); p_commit V

Oracle EBS OPM 生产批创建事务处理

--生产批创建事物处理 --created by jenrry DECLARE p_mmti_rec mtl_transactions_interface%ROWTYPE; p_mmli_tbl gme_common_pvt.mtl_trans_lots_inter_tbl; x_return_status VARCHAR2 (2000); p_validation_level NUMBER; p_init_msg_list VARCHAR2 (2000); p_commit VARCHAR2

Oracle EBS OPM release step

--release_step生产批 --created by jenrry SET serveroutput on DECLARE x_return_status VARCHAR2 (1); l_exception_material_tbl gme_common_pvt.exceptions_tab; l_batch_step_rec gme_batch_steps%ROWTYPE; l_in_batch_step_rec gme_batch_steps%ROWTYPE; l_org_code

Oracle EBS OM 发放订单

DECLARE l_header_rec OE_ORDER_PUB.Header_Rec_Type; l_line_tbl OE_ORDER_PUB.Line_Tbl_Type; l_action_request_tbl OE_ORDER_PUB.Request_Tbl_Type; l_header_adj_tbl OE_ORDER_PUB.Header_Adj_Tbl_Type; l_line_adj_tbl OE_ORDER_PUB.line_adj_tbl_Type; l_header_s

Oracle EBS Model Function Technical

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

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

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

Oracle EBS 如何月结[Z]

概述应付模块的多数业务基于采购和库存的操作,因此应付模块的月结应该在采购模块和库存模块月结后才能关闭会计期.月结步骤在每个会计期末,应付模块的月结应遵循以下流程:1.检查业务是否全部录入;2.检查是否有未验证.暂挂发票;3.更新到期的远期付款状态;4.检查应付业务是否生成分录;5.应付业务传送到总帐;6.确认应付分录全部传送总帐;7.创建成批增加;8.复核凭证,确认无误后过帐;9.确认及核对供应商余额;10.关闭应付会计期间;11.打开新的会计期;12.为通过手工方式进入存货成本的调整准备数据:

Oracle EBS WMS功能介绍(二)

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

ORACLE EBS常用表

http://www.cnblogs.com/quanweiru/archive/2012/09/26/2704628.html call fnd_global.APPS_INITIALIZE(1318,50583,401) select fnd_profile.VALUE('ORG_ID') FROM DUAL select * from hr_operating_units hou where hou.organization_id=204 --fnd select * from fnd_a