--complete_step
--created by jenrry
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 VARCHAR2 (3);
l_batch_no VARCHAR2 (32);
l_ignore_exception VARCHAR2 (1);
l_val_ff VARCHAR2 (1);
l_over_quality 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_Step ', 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', '1'); -- l_in_batch_step_rec.batchstep_id := 11558;
-- l_in_batch_step_rec.batchstep_id := 10492;-- l_in_batch_step_rec.batch_id := 364715;
l_in_batch_step_rec.batchstep_no := 10;
l_batch_no := '147637';
l_org_code := 'PR1';
-- if actual dates are not specified, SYSDATE is used
--l_in_batch_step_rec.actual_start_date :=
-- TO_DATE ('10-01-2014 08:00:00', 'MM-DD-YYYY HH24:MI:SS');
l_in_batch_step_rec.actual_cmplt_date :=
TO_DATE ('16-MAR-2017 18:40:00', 'DD-MON-YYYY HH24:MI:SS');
l_ignore_exception := fnd_api.g_true;
l_val_ff := fnd_api.g_false;
l_over_quality := fnd_api.g_true;
gme_api_pub.complete_step
(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_step_rec => l_in_batch_step_rec,
p_batch_no => l_batch_no,
p_org_code => l_org_code,
p_ignore_exception => l_ignore_exception,
p_override_quality => l_over_quality,
p_validate_flexfields => l_val_ff,
x_batch_step_rec => l_batch_step_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_step_rec.batch_id = '
|| TO_CHAR (l_batch_step_rec.batch_id)
);
DBMS_OUTPUT.put_line ( 'l_batch_step_rec.batchstep_id = '
|| TO_CHAR (l_batch_step_rec.batchstep_id)
);
DBMS_OUTPUT.put_line ( 'l_batch_step_rec.batchstep_no = '
|| TO_CHAR (l_batch_step_rec.batchstep_no)
);
DBMS_OUTPUT.put_line ( 'l_batch_step_rec.plan_start_date = '
|| TO_CHAR (l_batch_step_rec.plan_start_date,
'DD-MON-YYYY HH24:MI:SS'
)
);
DBMS_OUTPUT.put_line ( 'l_batch_step_rec.plan_cmplt_date = '
|| TO_CHAR (l_batch_step_rec.plan_cmplt_date,
'DD-MON-YYYY HH24:MI:SS'
)
);
DBMS_OUTPUT.put_line ( 'l_batch_step_rec.actual_start_date = '
|| TO_CHAR (l_batch_step_rec.actual_start_date,
'DD-MON-YYYY HH24:MI:SS'
)
);
DBMS_OUTPUT.put_line ( 'l_batch_step_rec.actual_cmplt_date = '
|| TO_CHAR (l_batch_step_rec.actual_cmplt_date,
'DD-MON-YYYY HH24:MI:SS'
)
);
DBMS_OUTPUT.put_line ( 'l_batch_step_rec.step_status = '
|| TO_CHAR (l_batch_step_rec.step_status)
);
DBMS_OUTPUT.put_line ( 'l_batch_step_rec.last_update_date = '
|| TO_CHAR (l_batch_step_rec.last_update_date,
'DD-MON-YYYY HH24:MI:SS'
)
);
DBMS_OUTPUT.put_line ( 'l_batch_step_rec.last_updated_by = '
|| TO_CHAR (l_batch_step_rec.last_updated_by)
);
DBMS_OUTPUT.put_line ( 'l_batch_step_rec.creation_date = '
|| TO_CHAR (l_batch_step_rec.creation_date,
'DD-MON-YYYY HH24:MI:SS'
)
);
DBMS_OUTPUT.put_line ( 'l_batch_step_rec.created_by = '
|| TO_CHAR (l_batch_step_rec.created_by)
);
DBMS_OUTPUT.put_line ( 'l_batch_step_rec.last_update_login = '
|| TO_CHAR (l_batch_step_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 step的更多相关文章

  1. Oracle EBS OPM complete batch

    --complete_batch --created by jenrry SET serveroutput on DECLARE x_return_status VARCHAR2 (1); l_exc ...

  2. Oracle EBS OPM release step

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

  3. Oracle EBS OPM update material txn

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

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

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

  5. Oracle EBS OPM close batch

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

  6. Oracle EBS OPM convert dtl reservation

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

  7. Oracle EBS OPM reshedule batch

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

  8. Oracle EBS OPM 创建生产批

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

  9. Oracle EBS OPM 发放生产批

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

随机推荐

  1. C#基础篇五值类型和引用类型

    using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace P01M ...

  2. Solidity之mapping类型

    映射是一种引用类型,存储键值对.它的定义是:mapping(key => value),概念上与java中的map,python中的字典类型类似,但在使用上有比较多的限制. 一.mapping定 ...

  3. PTA (Advanced Level) 1003 Emergency

    Emergency As an emergency rescue team leader of a city, you are given a special map of your country. ...

  4. http缓存详解,http缓存推荐方案

    前言 通过本文,你将了解到http缓存机制是怎样的,no-cache到底有没有缓存,地址栏回车,F5,ctrl+F5的区别,以及当下较为推荐的缓存方案等. 自从和前端组的同事一起整了个前端扫盲计划,想 ...

  5. 如何从GitHub迁移到GitLab?

    如何从GitHub迁移到GitLab? 在本文中,我们将解释如何从Github迁移到Gitlab,同时我们也将解释如何将Github的开源项目导入到Gitlab. 正如你可能非常清楚的那样, Gitl ...

  6. 浅析Java源码之HttpServlet

    纯粹是闲的,在慕课网看了几集的Servlet入门,刚写了1个小demo,就想看看源码,好在也不难 主要是介绍一下里面的主要方法,真的没什么内容啊~ 源码来源于apache-tomcat-7.0.52, ...

  7. [转]【mysql监控】查看mysql库大小,表大小,索引大小

    本文转自:http://blog.sina.com.cn/s/blog_4c197d420101fbl9.html 查看所有库的大小 mysql> use information_schema; ...

  8. 超简单MVC应用程序播放WMV视频

    本篇博文,介绍给大家的是,在MVC应用程序中,播放Windows media video(.wmv) 视频文件. Insus.NET的实现方法,把media player组件,嵌入MVC的控制器的Co ...

  9. jQuery实现DropDownList(MVC)

    今天学点什么呢?想来想去觉得DropDownList还是要加强功力,因为以前写ASP.NET网站时,此功能用的非常之多.在练习之前,先温习一下以前练习的<Html.DropDownListFor ...

  10. C#获取gif帧数

    C#获取gif帧数 /// <summary> /// 获取gif帧数 /// </summary> /// <param name="gifBytes&quo ...