fnd_request.submit_request

 

--- 提交处理事务处理接口请求
l_request_id := FND_REQUEST.SUBMIT_REQUEST(
APPLICATION => 'INV',
PROGRAM => 'INCTCM'
);

IF ( l_request_id = 0 ) THEN
RAISE E_SUBMIT_FAILED;
RETURN;
ELSE
COMMIT;
L_REQUEST_FLAG := FND_CONCURRENT.WAIT_FOR_REQUEST(
REQUEST_ID => L_REQUEST_ID,
INTERVAL => 5,
MAX_WAIT => 0,
PHASE => L_PHASE,
STATUS => L_STATUS,
DEV_PHASE => L_DEV_PHASE,
DEV_STATUS => L_DEV_STATUS,
MESSAGE => L_MESSAGE
);

END IF;

COMMIT;

EXCEPTION
WHEN E_SUBMIT_FAILED THEN
ERRCODE := '1';
ERRMSG := '提交处理事务处理接口请求失败!'||SUBSTR(SQLERRM,1,100);
FND_FILE.PUT_LINE(FND_FILE.LOG,ERRMSG);
ROLLBACK;
RETURN;
END;

今天关注到这个问题,将找到的资料收集在这里:

1、关于fnd_request.submit_request的用法
fnd_request.submit_request的用法:
FND_REQUEST.SUBMIT_REQUEST 函數是用來提交一個請求的,它返回一個NUMBER值.具體調用如下
:result := fnd_request.submit_request(application CHAR, --AP模快
program CHAR, --應用程式
description CHAR, --請求說明(可選)
start_time CHAR, --RUN 時間(可選)
sub_request BOOLEAN, --立刻提交請求
argument1 CHAR, --參數1
argument2 CHAR, --參數2
argument3 CHAR, --參數3
argument4 CHAR, --參數4
argument5 CHAR, --參數5.......
argument100 CHAR);
英文說明(zt oracle) :
Parameters are as follows:

application - Short name of the application associated with the concurrent
request to be submitted.

program - Short name of the concurrent program (not the executable) for which
the request should be submitted.

description - Description of the request that is displayed in the Concurrent
Requests form (Optional.)

start_time - Time at which the request should start running, formatted as HH24:
MI or HH24:MI:SS (Optional.)

sub_request - Set to TRUE if the request is submitted from another request and
should be treated as a sub-request.

argument1...100 - Arguments for the concurrent request; up to 100
arguments are permitted. If submitted from Oracle Forms, you must specify all
100 arguments.

补充说明:
在用fnd_request.submit_request的时候,第五个参数用false,不要被参数名称误导;
这个函数有105个参数,前面五个定义请求本身,后面100个是传递给请求的具体参数,都是Char类型,
我们需要转换,默认值是chr(0),代表这个参数不用传递给调用的请求;
在Package里面调用只需要传递需要的参数个数,因为它有默认值指示结束;
在form里面则不行,要写满105个,而且我们参数结束之后要用一个chr(0)来表示结束


fnd_request.submit_request('AR',
'SVAINEX_P',
'',
'',
FALSE,
:parameter.invoice_store,
chr(0),
'','','',
'','','','','','','','','','','','','','','','','','','','',
'','','','','','','','','','','','','','','','','','','','',
'','','','','','','','','','','','','','','','','','','','',
'','','','','','','','','','','','','','','','','','','','',
'','','','','','','','','','','','','','','');

2、Oracle Erp等待报表运行机制

主要是用到了Fnd_concurrent.wait_for_ruqest这个function.

Fnd_concurrent.wait_for_request返回Boolean值,主要参数如下:
function FND_CONCURRENT.WAIT_FOR_REQUEST
(request_id IN number default NULL, --请求ID
interval IN number default 60, --检查时间间隔
max_wait IN number default 0, --最大等待时间
phase OUT varchar2,
status OUT varchar2,
dev_phase OUT varchar2, --请求运行阶段
dev_status OUT varchar2, --各个阶段状态
message OUT varchar2 --运行完成后输出信息)
return boolean;
dev_phase有Pending,Running,Complete,Inactive等几种,每种对应不同的Dev-Status,比如Complete阶段后就有Normal,Error,Warning,Cancelled,Terminated等几种状态。

例如: l_request_status := Fnd_Concurrent.Wait_For_Request(l_request_id,
5,
0,
l_phase,
l_status,
l_dev_phase,
l_dev_status,
l_message);

IF l_request_status THEN
IF l_dev_status = 'NORMAL' THEN
NULL;
ELSE
Fnd_Message.Debug('请求运行不成功:'||l_dev_status);
RETURN;
END IF;
ELSE
Fnd_Message.Debug('请求未完成,无法查看报表内容!');
RETURN;
END IF;

Editor_Pkg.Report(l_request_id,'Y');

总结:FND_REQUEST.SUBMIT_REQUEST是一种通过后台方式提交请教的方法,可以在pkg和form中使用,在form中使用要将参数写全。 FND_CONCURRENT.WAIT_FOR_REQUEST是一个等待当前请求运行完毕的程序,可以利用这个等待当前的请求程序运行完毕再运行下面的程序。===========================================================

在Form里面,可以用APPS.FND_REQUEST.SUBMIT_REQUEST
提交一个Request到Oracle Request Manager。
如果提交成功,该函数返回Request ID,否则,返回0。
初始化
在提交一个Request之前,我们会调用Oracle Standard的Procedure对这个Request做一些基本的参数的初始化。
APPS.FND_GLOBAL.apps_initialize
user_id =>APPS.FND_GLOBAL.user_id,
resp_id =>APPS.FND_GLOBAL.resp_id,
resp_appl_id =>APPS.FND_GLOBAL.resp_appl_id
);
FND_REQUEST.SUBMIT_REQUEST
函数APPS.FND_REQUEST.SUBMIT_REQUEST有105个参数:
APPS.FND_REQUEST.SUBMIT_REQUEST
(
APPLICATION IN VARCHAR2 DEFAULT NULL,
PROGRAM IN VARCHAR2 DEFAULT NULL,
DESCRIPTION IN VARCHAR2 DEFAULT NULL,
START_TIME IN VARCHAR2 DEFAULT NULL,
SUB_REQUEST IN BOOLEAN DEFAULT FALSE,
chr(0),'','','','','','','','','','','','','','','','','','','',
'','','','','','','','','','', '','','','','','','','','','',
'','','','','','','','','','', '','','','','','','','','','',
'','','','','','','','','','', '','','','','','','','','','',
'','','','','','','','','','', '','','','','','','','','',''
)
RETURN NUMBER;

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值