--complete_batch
--created by jenrry
SET serveroutput on 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 Complete_batch ', l_api_name);
END display_messages;
BEGIN
DBMS_OUTPUT.ENABLE (20000);
l_user_name := 'PROCESS_OPS'; 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
);
fnd_profile.put ('AFLOG_LEVEL', gme_debug.g_log_statement);
l_in_batch_header_rec.batch_id := 3567256;
-- l_in_batch_header_rec.batch_no :=
-- l_org_code := -- if actual dates are not specified, SYSDATE is used
-- l_in_batch_header_rec.actual_start_date = TO_DATE('07-01-2005 08:00:00','MM-DD-YYYY HH24:MI:SS'); -- used for pending batches only
-- l_in_batch_header_rec.actual_start_date :=
-- TO_DATE ('07-15-2005 08:00:00', 'MM-DD-YYYY HH24:MI:SS');
l_ignore_exception := fnd_api.g_true;
l_val_ff := fnd_api.g_false;
gme_api_pub.complete_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 complete batch的更多相关文章

  1. Oracle EBS OPM close batch

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

  2. Oracle EBS OPM complete step

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

  3. Oracle EBS OPM reshedule batch

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

  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 创建生产批

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

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

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

  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 release step

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

  9. Oracle EBS OPM 发放生产批

    --发放生产批 --created by jenrry DECLARE x_return_status VARCHAR2 (1); l_exception_material_tbl gme_commo ...

随机推荐

  1. 杂谈:Windows操作系统的介绍与对Win8操作系统市场反响冷淡原因的分析

    Windows操作系统,毫无疑问是操作系统市场上的霸主,也正因为Windows操作系统的诞生让电脑的操作性能变得更加平民化,深的用户的喜爱.至今身边的人也是选择windows操作系统的居多,这篇文章也 ...

  2. postgresql 清空数据表数据

    在 mysql中,只需要执行: TRUNCATE table_name; 即可,数据会情况,而且自增id也会变回0: 但在 postgresql 则稍有不同,因为 postgresql 的自增id是通 ...

  3. 【IT笔试面试题整理】判断一个二叉树是否是平衡的?

    [试题描述]定义一个函数,输入一个链表,判断链表是否存在环路 平衡二叉树,又称AVL树.它或者是一棵空树,或者是具有下列性质的二叉树:它的左子树和右子树都是平衡二叉树,且左子树和右子树的高度之差之差的 ...

  4. java中数据的传递方式到底是怎样的!

    今天早上我了一道有关java的题.主要考点是考java中值得传递方式. 之前我在javaoo里总结的是:基本数据类型中保存的是实际的值,引用数据类型保存的是被引用的内存地址,那么基本数据类型就是按值传 ...

  5. Quartz框架多个trigger任务执行出现漏执行的问题分析--转

    原文地址:http://blog.csdn.net/dailywater/article/details/51470779 一.问题描述 使用Quartz配置定时任务,配置了超过10个定时任务,这些定 ...

  6. Linux的IO模型

    在输入输出系统一文中介绍了系统内核操作IO设备的机制. 我们了解到内核可以直接访问IO设备, 用户进程无法IO设备. 就是说IO操作需要分为两个过程, 内核从IO设备读取数据保存到内核空间, 将数据由 ...

  7. Angular ngIf相关问题

    1.ngIf会把元素销毁,如果在页面加载时给元素注册了事件(如MouseOver),当ngIf的条件不满足时会销毁元素,再次生成元素并不会把事件注册 2.ngIf在IOS上会导致input控件无法正常 ...

  8. Docker实战-为镜像添加SSH服务

    1.基于docker commit命令创建 Docker提供了docker commit命令,支持用户提交自己对定制容器的修改,并生成新的镜像. 命令格式为:docker commit CONTAIN ...

  9. 创建自己的共用js库

    直至昨晚为止,学习了一个多月的MVC与jQuery,从所做的练习中,发觉jQuery的代码也有跟C#语言一样可以重构,多页面有相同使用的方法函数,均可以放置于一个单独立的js文件或是自定义的js库中. ...

  10. Mock session,cookie,querystring in ASB.NET MVC

    写测试用例的时候经常发现,所写的功能需要Http上下文的支持(session,cookie)这类的. 以下介绍2种应用场景. 用于控制器内Requet获取参数 控制器内的Requet其实是控制器内的属 ...