Item Trigger: WHEN-BUTTON-PRESSED
1) Libraries : FNDCONC
2) Program Unit: editor_pkg.report(req_id number, save_output_flag varchar2);
可以從IE內的瀏覽器的網址,看得出來是呼叫的結果, 直接呈現HTML的Output
DECLARE
ln_num NUMBER;
lb_submit BOOLEAN;
V_ERROR VARCHAR2(30);
V_RECEIPT_SEQ NUMBER := 0;
-- get concurrent status
lb_wait BOOLEAN;
ls_phase VARCHAR2(15);
ls_status VARCHAR2(15);
ls_dev_phase VARCHAR2(80);
ls_dev_status VARCHAR2(80);
ls_messge VARCHAR2(255);
BEGIN
ln_num := FND_REQUEST.SUBMIT_REQUEST
( 'PO','YLPOM001_BATCH', '', '',FALSE,
'', --1
'', --2
'', --3
'', --4
'', --5
'', --6
'', --7
'', --8
'', --9
'', --10
'', --11
'', --12
'', --13
'', --14
'Y', --15
'', --16
CHR(0), -- 從FORM叫REQUEST , 最後一個參數要放CHR(0)
'','','',
'','','','','','','','','','',
'','','','','','','','','','',
'','','','','','','','','','',
'','','','','','','','','','',
'','','','','','','','','','',
'','','','','','','','','','',
'','','','','','','','','','',
'','','','','','','','','','');
IF ln_num = 0 THEN
FND_MESSAGE.RETRIEVE;
FND_MESSAGE.ERROR;
ELSE
lb_submit := APP_FORM.QUIETCOMMIT;
FND_MESSAGE.DEBUG(' >> 預覽報表 << '|| CHR(10)||
'Request ID:' || TO_CHAR(ln_num));
--2:每2秒檢查一次Request,10800:表示總共等10800秒,共180分鐘,超過180分鐘上一個Request若還未成功,則會出現Error
(ln_num
,2,10800,ls_phase,ls_status,ls_dev_phase,ls_dev_status,ls_messge);
IF SUBSTR(UPPER(ls_dev_phase),1,8) = 'COMPLETE'
AND
SUBSTR(UPPER(ls_dev_status),1,6) = 'NORMAL' THEN
------------------------------------------------------------------------
-- Libraries: FNDCONC
-- procedure report(req_id number, save_output_flag varchar2);
------------------------------------------------------------------------
editor_pkg.report(ln_num, 'Y');
END IF;
END IF;
END;