利用xml publisher開發報表
CREATE OR REPLACE PACKAGE APPS.cux_po_undelivery_pkg IS
/**************************************************************************
File name : cux_po_undelivery_pkg.pck
Doc Ref(s) :
Project :
Description : po have been received but not delivery
Change History Information
--------------------------
Version Date Author Change Reference / Description
------- ----------- --------------- ------------------------------------
1.0 2009-07-31 Randolph First Version
**************************************************************************/
PROCEDURE xml_main(retbuffer OUT VARCHAR2,
retcode OUT NUMBER,
p_po_number IN VARCHAR2,
p_vendor_id IN NUMBER,
p_shipnum_fm IN VARCHAR2,
p_shipnum_to IN VARCHAR2,
p_date_fm IN VARCHAR2,
p_date_to IN VARCHAR2);
END cux_po_undelivery_pkg;
/
CREATE OR REPLACE PACKAGE BODY APPS.cux_po_undelivery_pkg IS
/*=======================================================================
-- PROCEDURE NAME: output_xml()
=========================================================================*/
PROCEDURE output_xml(p_tag IN VARCHAR2,
p_value IN VARCHAR2) AS
BEGIN
fnd_file.put_line(fnd_file.output,
'' ||
nvl(p_value,
' ') || '' || upper(TRIM(p_tag)) || '>');
END output_xml;
/*=======================================================================
-- PROCEDURE NAME: output_tail()
========================================================================*/
PROCEDURE output_tail(p_tag IN VARCHAR2) AS
BEGIN
fnd_file.put_line(fnd_file.output,
'' || upper(TRIM(p_tag)) || '>');
END output_tail;
/*=======================================================================
-- PROCEDURE NAME: output_header()
=========================================================================*/
PROCEDURE output_header(p_tag IN VARCHAR2) AS
BEGIN
fnd_file.put_line(fnd_file.output,
'');
END output_header;
PROCEDURE xml_main(retbuffer OUT VARCHAR2,
retcode OUT NUMBER,
p_po_number IN VARCHAR2,
p_vendor_id IN NUMBER,
p_shipnum_fm IN VARCHAR2,
p_shipnum_to IN VARCHAR2,
p_date_fm IN VARCHAR2,
p_date_to IN VARCHAR2) IS
CURSOR cur_data(c_date_fm IN DATE, c_date_to IN DATE) IS
SELECT rt.transaction_type,
rt.primary_quantity,
to_char(rt.transaction_date,'YYYY-MM-DD') transaction_date,
ph.segment1 po_number,
pv.vendor_name,
pv.segment1 vendor_num,
rsh.receipt_num,
rt.unit_of_measure,
rt.currency_code,
msi.concatenated_segments item_num,
msi.description item_desc,
NVL(cic.ITEM_COST,0) cost_type
FROM rcv_transactions rt,
po_headers_all ph,
po_vendors pv,
rcv_shipment_headers rsh,
po_lines_all pl,
po_line_locations_all pll,
mtl_system_items_kfv msi,
BOM.CST_ITEM_COSTS cic
WHERE rt.transaction_type = 'RECEIVE'
AND ph.po_header_id = rt.po_header_id
AND ph.vendor_id = pv.vendor_id
AND ph.po_header_id = pl.po_header_id
AND pll.po_header_id = ph.po_header_id
AND pll.po_line_id = pl.po_line_id
AND msi.inventory_item_id = pl.item_id
AND msi.organization_id = rt.organization_id
AND msi.inventory_item_id =cic.INVENTORY_ITEM_ID(+)
AND msi.organization_id =cic.ORGANIZATION_ID(+)
AND cic.COST_TYPE_ID(+)=1
--parameter
AND rt.transaction_date >=
nvl(c_date_fm,rt.transaction_date)
AND rt.transaction_date <=
nvl(c_date_to + .99999,rt.transaction_date)
AND ph.segment1 = nvl(p_po_number,ph.segment1)
AND ph.vendor_id = nvl(p_vendor_id,ph.vendor_id)
AND rsh.receipt_num >=
nvl(p_shipnum_fm,rsh.receipt_num)
AND rsh.receipt_num <=
nvl(p_shipnum_to,rsh.receipt_num)
--
AND rt.shipment_header_id = rsh.shipment_header_id(+)
AND NOT EXISTS
(SELECT 'x'
FROM rcv_transactions rt1
WHERE rt1.transaction_type = 'DELIVER'
CONNECT BY rt1.parent_transaction_id = PRIOR
rt1.transaction_id
AND PRIOR rt1.transaction_type = 'DELIVER'
START WITH rt1.transaction_id = rt.transaction_id);
l_date_fm DATE;
l_date_to DATE;
BEGIN
fnd_file.put_line(fnd_file.output,
'');
output_header('G_DATA');
l_date_fm := fnd_date.canonical_to_date(p_date_fm);
l_date_to := fnd_date.canonical_to_date(p_date_to);
FOR rec_data IN cur_data(l_date_fm,
l_date_to) LOOP
output_header('G_RECEIVING');
output_xml('TRANSACTION_TYPE',
rec_data.transaction_type);
output_xml('PRIMARY_QUANTITY',
rec_data.primary_quantity);
output_xml('TRANSACTION_DATE',
rec_data.transaction_date);
output_xml('PO_NUMBER',
rec_data.po_number);
output_xml('VENDOR_NAME',
rec_data.vendor_name);
output_xml('VENDOR_NUM',
rec_data.vendor_num);
output_xml('ITEM_NUM',
rec_data.item_num);
output_xml('ITEM_DESC',
rec_data.item_desc);
output_xml('UOM',
rec_data.unit_of_measure);
output_xml('StdCost',
rec_data.cost_type);
output_xml('CURRENCY_CODE',
rec_data.currency_code);
output_xml('RECEIPT_NUM',
rec_data.receipt_num);
output_tail('G_RECEIVING');
END LOOP;
output_tail('G_DATA');
EXCEPTION
WHEN OTHERS THEN
retbuffer := SQLCODE || ':' || SQLERRM;
retcode := 1;
END xml_main;
END cux_po_undelivery_pkg;
/
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/11536986/viewspace-620206/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- (原)使用PL/SQL開發XML PUBLISHER報表的步驟SQLXML
- 使用 Oracle XML Publisher 構建線上報表應用程式OracleXML
- XML PUBLISHER中使用RGB顏色模式方法XML模式
- Jasperreport 報表開發
- (原)查詢EBS中使用的XML PUBLISHER版本的方法XML
- XML 報表自動輸出ExcelXMLExcel
- ABAP 報表開發例項
- 用Excel模板開發報表Excel
- 報表開發工具FineReport報表填報資料校驗
- XML PUBLISHER 輸出資料庫圖片需注意事項XML資料庫
- 帆軟報表開發新手教程
- XML報表遇中文時,無法直接用EXCEL開啟的處理XMLExcel
- 報表開發之擴充套件GROUP BY套件
- 移動端報表JS開發示例JS
- 更改XML報表預設輸出格式為EXCELXMLExcel
- MySQL 利用Pivoting格式化做報表MySql
- 如何快速開發靈活自定義報表
- 物流行業企業報表開發指南行業
- 利用Perl解析XML檔案XML
- 資料庫開發(20)XML資料庫XML
- IT報表開發者必看:別加班了,快用這個神器提高報表開發效率
- 利用sqlplus手工建立巡檢報表SQL
- OLE程式開發利用(開發EXCEL) (轉)Excel
- 一個例子:在EBS透過XML Publisher輸出儲存在Blob的圖片XML
- 利用自定義流程表單開發的優勢,實現流程化發展!
- user端無法開啟crystall report開發的報表
- XML資料庫開發手冊XML資料庫
- Android開發-TextViev XML屬性(一)AndroidXML
- iOS開發之解析XML格式資料iOSXML
- iOS開發-XML&JSON淺析iOSXMLJSON
- Java - XML字元支援報錯An invalid XML characterJavaXML字元
- 如何應對報表開發中的複雜邏輯
- 報表實施案例:某市利用大資料助力精準扶貧專案開展大資料
- 利用StoryBook開發UI元件管理UI元件
- Affinity Publisher 桌面排版神器
- 桌面排版Affinity Publisher for MacMac
- FTP publisher plugin外掛FTPPlugin
- Oracle BI Publisher DesktopOracle