Oracle EBS 提交子请求

示例来源于MOS,按需修改使用。

源码:

CREATE OR REPLACE PROCEDURE parent2

(

  errbuf  OUT VARCHAR2,

  retcode OUT NUMBER

) IS

  i        NUMBER;

  req_data VARCHAR2(10);

  r        NUMBER;

BEGIN

  --

  -- Read the value from REQUEST_DATA.  If this is the

  -- first run of the program, then this value will be

  -- null.

  -- Otherwise, this will be the value that we passed to

  -- SET_REQ_GLOBALS on the previous run.

  --

  req_data := fnd_conc_global.request_data;

  --

  -- If this is the first run, we'll set i = 1.

  -- Otherwise, we'll set i = request_data + 1, and we'll

  -- exit if we're done.

  --

  IF (req_data IS NOT NULL) THEN

    i := to_number(req_data);

    i := i + 1;

    IF (i < 11) THEN

      errbuf  := 'Done!';

      retcode := 0;

      RETURN;

    END IF;

  ELSE

    i := 1;

  END IF;

  --

  -- Submit the child request.  The sub_request parameter

  -- must be set to 'Y'.

  --

  r := fnd_request.submit_request('FND',

                                  'FNDSCARU',

                                  'Child ' || to_char(i),

                                  NULL,

                                  TRUE,

                                  fnd_conc_global.printer);

  IF r = 0 THEN

    --

    -- If request submission failed, exit with error.

    --

    errbuf  := fnd_message.get;

    retcode := 2;

  ELSE

    --

    -- Here we set the globals to put the program into the

    -- PAUSED status on exit, and to save the state in

  

  -- request_data.

    --

    fnd_conc_global.set_req_globals(conc_status  => 'PAUSED',

                                    request_data => to_char(i));

    errbuf  := 'Sub-Request submitted!';

    retcode := 0;

  END IF;

  RETURN;

END;

/

以下内容截取实际工作中源码,仅做示例展示部分源码

    FOR l_calc_type IN calc_type LOOP

      l_request_id := NULL;

    

      IF p_segment1 IN ('1110', '1101', '1102', '1111', '1113')

         AND l_calc_type.flex_value = 'AR-AGING' THEN      

        l_request_id := fnd_request.submit_request(application => 'CUX',

                                                   program     => 'CUXBPCDATACLCT_SA',

                                                   description => NULL,

                                                   start_time  => SYSDATE,

                                                   sub_request => TRUE,

                                                   argument1   => p_segment1,

                                                   argument2   => p_period_name,

                                                   argument3   => l_calc_type.flex_value);

      

      ELSE

        l_request_id := fnd_request.submit_request(application => 'CUX',

                                                   program     => 'CUXBPCDATACLCT',

                                                   description => NULL,

                                                   start_time  => SYSDATE,

                                                   sub_request => TRUE,

                                                   argument1   => p_segment1,

                                                   argument2   => p_period_name,

                                                   argument3   => l_calc_type.flex_value);

      END IF;

    

      IF l_request_id > 0 THEN

        fnd_conc_global.set_req_globals(conc_status  => 'PAUSED',

                                        request_data => l_request_id);

        COMMIT;

        l_request_id := l_request_id;

        errbuff      := '已成功调用请求,请求号为:' || l_request_id;

        retcode      := 0;

      ELSE

        ROLLBACK;

        l_request_id := 0;

        errbuff      := '调用请求失败,稍后重试!';

        retcode      := 2;

      END IF;

    END LOOP;

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值