--取消生产批
--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 VARCHAR2 (2000);
x_message_count NUMBER;
x_message_list VARCHAR2 (2000);
l_msg_count NUMBER;
l_msg_data VARCHAR2 (2000);
setup_failure EXCEPTION;
p_org_code VARCHAR2 (3) := 'PR1';
g_debug VARCHAR2 (5) := fnd_profile.VALUE ('AFLOG_LEVEL'); 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 Cancel_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
);
x_return_status := fnd_api.g_ret_sts_success; fnd_msg_pub.initialize;
gme_common_pvt.g_error_count := 0;
gme_common_pvt.set_timestamp;
gme_common_pvt.g_move_to_temp := fnd_api.g_false;
p_batch_header_rec.organization_id := 1381;
p_batch_header_rec.batch_id := 217707;
gme_api_pub.cancel_batch
(p_api_version => 2.0,
p_validation_level => gme_common_pvt.g_max_errors,
p_init_msg_list => fnd_api.g_false,
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_org_code => 'PR1',
p_batch_header_rec => p_batch_header_rec,
x_batch_header_rec => x_batch_header_rec
);
DBMS_OUTPUT.put_line ( 'msg_count from process trxns='
|| TO_CHAR (l_msg_count)
); IF l_msg_count > 1
THEN
display_messages (l_msg_count);
END IF; DBMS_OUTPUT.put_line ( 'after process transactions x_return_status='
|| TO_CHAR (x_return_status)
); DBMS_OUTPUT.put_line (SUBSTR ( 'x_batch_header_rec.batch_id = '
|| TO_CHAR (x_batch_header_rec.batch_id),
1,
255
)
);
DBMS_OUTPUT.put_line (SUBSTR ( 'x_batch_header_rec.batch_status = '
|| TO_CHAR (x_batch_header_rec.batch_status),
1,
255
)
);
DBMS_OUTPUT.put_line (SUBSTR ( 'x_batch_header_rec.batch_no = '
|| TO_CHAR (x_batch_header_rec.batch_no),
1,
255
)
);
DBMS_OUTPUT.put_line (SUBSTR ( 'x_batch_header_rec.LAST_UPDATE_DATE = '
|| TO_CHAR
(x_batch_header_rec.last_update_date),
1,
255
)
);
DBMS_OUTPUT.put_line (SUBSTR ( 'x_batch_header_rec.LAST_UPDATED_BY = '
|| TO_CHAR
(x_batch_header_rec.last_updated_by),
1,
255
)
);
DBMS_OUTPUT.put_line (SUBSTR ( 'x_batch_header_rec.CREATION_DATE = '
|| TO_CHAR (x_batch_header_rec.creation_date),
1,
255
)
);
DBMS_OUTPUT.put_line (SUBSTR ( 'x_batch_header_rec.CREATED_BY = '
|| TO_CHAR (x_batch_header_rec.created_by),
1,
255
)
);
DBMS_OUTPUT.put_line
(SUBSTR ( 'x_batch_header_rec.LAST_UPDATE_LOGIN = '
|| TO_CHAR
(x_batch_header_rec.last_update_login),
1,
255
)
);
DBMS_OUTPUT.put_line (SUBSTR ('x_return_status = ' || x_return_status,
1,
255
)
);
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)
);
gme_common_pvt.count_and_get (x_count => x_message_count,
p_encoded => fnd_api.g_false,
x_data => x_message_list
); IF x_message_count > 1
THEN
display_messages (x_message_count);
END IF;
EXCEPTION
WHEN setup_failure
THEN
DBMS_OUTPUT.put_line (' in setup failure');
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line (SUBSTR ( 'Error '
|| TO_CHAR (SQLCODE)
|| ': '
|| SQLERRM,
1,
255
)
);
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 DECLARE x_return_status VARCHAR2 (1); l_exception_material_tbl gme_commo ...

  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 AP 取消发票

    --取消发票 created by jenrry 20170425 declare l_result BOOLEAN; l_message_name VARCHAR2(240); l_invoice_ ...

  7. Oracle EBS AP 取消付款

    --取消付款 created by jenrry 20170425 declare l_return_status varchar2(50); l_msg_count number; l_msg_da ...

  8. Oracle EBS AP取消核销

    --取消核销 created by jenrry 20170425 DECLARE l_result BOOLEAN; l_msg_count NUMBER; l_result_n varchar2( ...

  9. Oracle EBS OPM close batch

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

随机推荐

  1. js实现生成中间带图片的二维码

    之前需要实现生成中间带图片的二维码,所以找了半天终于找到一个可以用的.于是在这里记录一下. 下面是需要注意的几点: 1.使用的js为jquery-qrcode 但是已经经过别人的修改,和网上原来的那些 ...

  2. sshd服务防止暴力破解

    sshd防止暴力破解几种方式: 1.密码足够复杂 2.修改默认端口号 3.不适用root用户名登录. #是否可以禁止root身份登录?不行,因为有些程序需要使用root什么登录,另外判断一个用户是不是 ...

  3. Unity生成WebService代理类

    普通的.net程序中,如果我们想引用webService,只需在项目中右键选择添加服务引用,然后在地址栏中输入Webservice地址,单击“转到”按钮,找到服务后再单击确定,Visual Studi ...

  4. 【详解】ThreadPoolExecutor源码阅读(一)

    系列目录 [详解]ThreadPoolExecutor源码阅读(一) [详解]ThreadPoolExecutor源码阅读(二) [详解]ThreadPoolExecutor源码阅读(三) 工作原理简 ...

  5. nginx报错整理

    一. 1.线上有个域名出现一个访问报错: 413 Payload Too Large 这里贴一下关于这个报错的解释: The 413 (Payload Too Large) status code i ...

  6. 扒一扒HTTPS网站的内幕

    215年6月,维基媒体基金会发布公告,旗下所有网站将默认开启HTTPS,这些网站中最为人所知的当然是全球最大的在线百科-维基百科.而更早时候的3月,百度已经发布公告,百度全站默认开启HTTPS.淘宝也 ...

  7. 开源方案搭建可离线的精美矢量切片地图服务-5.Mapbox离线项目实现

    项目成果展示(所有项目文件都在阿里云的共享云虚拟主机上,访问地图可以会有点慢,请多多包涵). 01:中国地图:http://test.sharegis.cn/mapbox/html/3china.ht ...

  8. UVa 514 Rails(栈的应用)

    题目链接: https://cn.vjudge.net/problem/UVA-514 /* 问题 输入猜测出栈顺序,如果可能输出Yes,否则输出No 解题思路 貌似没有直接可以判定的方法,紫书上给出 ...

  9. webpack4+react多页面架构

    webpack在单页面打包上应用广泛,以create-react-app为首的脚手架众多,单页面打包通常是将业务js,css打包到同一个html文件中,整个项目只有一个html文件入口,但也有许多业务 ...

  10. 呼叫WCF Service的方法出现Method not allowed异常

    asp.net mvc练习程序,经常性在家里电脑,笔记本或是公司的电脑之间拷贝与粘贴,如果忘记携带最新的练习程序,一些小功能只能重新写了.如前一篇<ASP.NET MVC呼叫WCF Servic ...