Form 中调用并发请求生成报表并输出PDF的方法

要完成这个目的,首先要在ebs中注册报表,并注册模板。
然后再方法里先调用FND_REQUEST.ADD_LAYOUT添加模板,然后调用FND_REQUEST.SUBMIT_REQUEST提交并发请求,再调用FND_CONCURRENT.WAIT_FOR_REQUEST等待请求完成并返回分析,状态和完成信息。
procedure print_report(order_number in NUMBER,date_from in date,date_to in date) is
           L_REQUEST_ID NUMBER;
            L_BL_RESULT  BOOLEAN;
            v_layout     BOOLEAN;
            X_PHASE      VARCHAR2(100);
            X_STATUS     VARCHAR2(100);
            X_DEV_PHASE  VARCHAR2(100);
            X_DEV_STATUS VARCHAR2(100);
            X_MESSAGE    VARCHAR2(100);
   BEGIN
        /*
           --
          -- Name
          --   add_layout
          -- Purpose
          --   Called before submission to add layout options for request output.
          --
          -- Arguments
          --    Template_APPL_Name            - Template Application Short name.
          --    Template_code                 - Template code
          --    Template_Language             - Template File language (iso value)
          --    Template_Territory            - Template File Territory (iso value)
          --    Output Format                 - Output Format
          --添加输出模板,FND_REQUEST.add_layout (template_appl_name in varchar2,
                                 template_code     in varchar2,
                                 template_language in varchar2,
                                 template_territory in varchar2,
                                 output_format     in varchar2) return boolean
        */
        
               v_layout:=FND_REQUEST.ADD_LAYOUT('PO',
                                         'TRNORDER094',
                                          Null,
                                          Null,
                                          'PDF');  
                                          
        /*
          --
          -- Name
          --   submit_request
          -- Purpose
          --   Submits concurrent request to be processed by a concurrent manager
          --
          -- Arguments
          --   application    - Short name of application under which the program
          --            - is registered
          --   program        - concurrent program name for which the request has
          --            - to be submitted
          --   description    - Optional. Will be displayed along with user
          --            - concurrent program name
          --   start_time    - Optional. Time at which the request has to start
          --            - running
          --   sub_request    - Optional. Set to TRUE if the request is submitted
          --               - from another running request and has to be treated
          --            - as a sub request. Default is FALSE
          --   argument1..100    - Optional. Arguments for the concurrent request
          --  提交并发请求
          --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
                                      argument1,
                                      argument2, ..., argument99,
                                      argument100) return number;
        */  
        
               L_REQUEST_ID := FND_REQUEST.SUBMIT_REQUEST('PO',
                                                                                                    'TRNORDER094',
                                                                                                    '',
                                                                                                    '',
                                                                                                    FALSE,
                                                                                                    order_number,
                                                                                                    date_from,
                                                                                                    date_to,
                                                                                                    CHR(0),'','','','','','',
                                                                                                    '','','','','','','','','','',
                                                                                                    '','','','','','','','','','',
                                                                                                    '','','','','','','','','','',
                                                                                                    '','','','','','','','','','',
                                                                                                    '','','','','','','','','','',
                                                                                                    '','','','','','','','','','',
                                                                                                    '','','','','','','','','','',
                                                                                                    '','','','','','','','','','',
                                                                                                    '','','','','','','','','','');
                                                                                                                                                                                                                                                                                                      
                COMMIT;    
                IF L_REQUEST_ID IS NULL OR L_REQUEST_ID = 0 THEN
                    RETURN;
                END IF;        
                
                /*
          --
          -- Name
          --   WAIT_FOR_REQUEST
          -- Purpose
          --   Waits for the request completion, returns phase/status and
          --   completion text to the caller. Calls sleep between db checks.
          -- Arguments (input)
          --   request_id    - Request ID to wait on
          --   interval         - time b/w checks. Number of seconds to sleep
          --            - (default 60 seconds)
          --   max_wait        - Max amount of time to wait (in seconds)
          --            - for request's completion
          -- Arguments (output)
          --               User version of      phase and status
          --               Developer version of phase and status
          --               Completion text if any
          --   phase         - Request phase ( from meaning in fnd_lookups )
          --   status        - Request status( for display purposes          )
          --   dev_phase    - Request phase as a constant string so that it
          --            - can be used for comparisons )
          --   dev_status    - Request status as a constatnt string
          --   message        - Completion message if request has completed
          --
          --等待并发请求完成,并返回分析/状态和完成信息,FND_CONCURRENT.WAIT_FOR_REQUEST(request_id IN number default NULL,
                                                                                          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;
                */
                
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值