--发放生产批
--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;
/

  

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

  1. Oracle EBS OPM 创建生产批

    --创建生产批 --created by jenrry DECLARE x_message_count NUMBER; x_message_list VARCHAR2 (2000); x_return ...

  2. Oracle EBS OPM 取消生产批

    --取消生产批 --created by jenrry SET serveroutput on; DECLARE p_batch_header_rec gme_batch_header%ROWTYPE ...

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

    --生产批创建事物处理 --created by jenrry DECLARE p_mmti_rec mtl_transactions_interface%ROWTYPE; p_mmli_tbl gm ...

  4. Oracle EBS OPM update material txn

    --update_material_txn --created by jenrry DECLARE p_mmti_rec mtl_transactions_interface%ROWTYPE; p_m ...

  5. Oracle EBS OPM release step

    --release_step生产批 --created by jenrry SET serveroutput on DECLARE x_return_status VARCHAR2 (1); l_ex ...

  6. Oracle EBS OPM close batch

    --close_batch --created by jenrry DECLARE x_message_count NUMBER; x_message_list VARCHAR2 (4000); x_ ...

  7. Oracle EBS OPM convert dtl reservation

    --convert_dtl_reservation --created by jenrry DECLARE l_reservation_rec mtl_reservations%ROWTYPE; l_ ...

  8. Oracle EBS OPM complete step

    --complete_step --created by jenrry DECLARE x_return_status VARCHAR2 (1); l_exception_material_tbl g ...

  9. Oracle EBS OPM reshedule batch

    --reschedule_batch --created by jenrry DECLARE x_message_count NUMBER; x_message_list VARCHAR2 (2000 ...

随机推荐

  1. epoll 触发模式

    Edge Triggered (ET):边缘触发只有数据到来,才触发,不管缓存区中是否还有数据.Level Triggered (LT):水平触发只要有数据都会触发. LT(level trigger ...

  2. [Python] 震惊, 我居然用Python干这种事ꈍ .̮ ꈍ

    阅读本文只需花费你两分钟, 两分钟你买不了吃亏,你也买不了上当. 那么, 为何不静下心来看看呢? Python 海龟创意绘画, Turtle库创作精美图画 Author:Amd794     E-ma ...

  3. 描述linux系统从开机到登陆界面的启动过程

    简述:1.开机BIOS自检2.MBR引导3.grub引导菜单4.加载内核kernel5.启动init进程6.读取inittab文件,执行rc.sysinit,rc等脚本7.启动mingetty,进入系 ...

  4. 3D转弯保护区长啥样?

    3D转弯保护区长啥样? 2015-12-06 刘崇军 风螺旋线 在课本中.规范中看到的转弯保护区一直是平面化的样子.我们知道副区是由主区外扩而成,但具体怎样精确外扩无从知晓:我们知道主区边界至副区边界 ...

  5. .5-浅析express源码之Router模块(1)-默认中间件

    模块application已经完结,开始讲Router路由部分. 切入口仍然在application模块中,方法就是那个随处可见的lazyrouter. 基本上除了初始化init方法,其余的app.u ...

  6. ASP.NET MVC获取上传的路径

    刚才有网友问及,怎样获取<input type='file'>的值? Insus.NET测试了一下,在Inetnet Explor之下似乎没有问题,但是FireFox获取到的只是文件名. ...

  7. 在iframe窗体内 获取父级的元素;;在父窗口中获取iframe中的元素

    在iframe中获取父窗口的元素 $(‘#父窗口中的元素ID’, parent.document).click(); 在父窗口中获取iframe中的元素 $(“#iframe的ID”).content ...

  8. 在.net中序列化读写xml方法的总结--转载过来学习学习

    原文章地址:http://www.cnblogs.com/fish-li/archive/2013/05/05/3061816.html 首先做个大概的总结,XML包括的元素有XmlElement,X ...

  9. 乐字节-Java8新特性之函数式接口

    上一篇小乐带大家学过 Java8新特性-Lambda表达式,那什么时候可以使用Lambda?通常Lambda表达式是用在函数式接口上使用的.从Java8开始引入了函数式接口,其说明比较简单:函数式接口 ...

  10. 关于latex编译中文不显示问题的解决方法。

    我的编译环境是texlive2018 + texstudio 配置如图 默认编码格式为utf8 直接上代码 %\documentclass{article} %\usepackage{xeCJK} \ ...