EBS實踐—PO內部申請自動接收入庫
declare
CURSOR cur_req_data IS
SELECT prl.*
FROM po_requisition_lines_all prl,
po_requisition_headers_all prh
WHERE prh.requisition_header_id = prl.requisition_header_id
AND prl.requisition_line_id = p_requisition_line_id;
l_iface_hdr_rec po.rcv_headers_interface%ROWTYPE;
l_iface_rcv_rec po.rcv_transactions_interface%ROWTYPE;
l_shipment_number VARCHAR2(30);
BEGIN
BEGIN
SELECT rsh.shipment_num
INTO l_shipment_number
FROM rcv_shipment_headers rsh,
rcv_shipment_lines rsl
WHERE rsh.shipment_header_id = rsl.shipment_header_id
AND rsl.requisition_line_id = p_requisition_line_id
AND rsl.shipment_line_id = p_shipment_line_id;
EXCEPTION
WHEN no_data_found THEN
l_shipment_number := NULL;
WHEN OTHERS THEN
l_shipment_number := NULL;
END;
FOR l_req_data IN cur_req_data
LOOP
BEGIN
SELECT po.rcv_headers_interface_s.NEXTVAL
INTO l_iface_hdr_rec.header_interface_id
FROM dual;
/*SELECT po.rcv_interface_groups_s.NEXTVAL
INTO l_iface_hdr_rec.group_id
FROM dual;*/
l_iface_hdr_rec.group_id := g_receipt_group_id;
l_iface_hdr_rec.last_update_date := SYSDATE;
l_iface_hdr_rec.last_updated_by := fnd_global.user_id;
l_iface_hdr_rec.creation_date := SYSDATE;
l_iface_hdr_rec.created_by := fnd_global.user_id;
l_iface_hdr_rec.last_update_login := fnd_global.login_id;
l_iface_rcv_rec.last_update_date := SYSDATE;
l_iface_rcv_rec.last_updated_by := fnd_global.user_id;
l_iface_rcv_rec.creation_date := SYSDATE;
l_iface_rcv_rec.created_by := fnd_global.user_id;
l_iface_rcv_rec.last_update_login := fnd_global.login_id;
l_iface_hdr_rec.processing_status_code := 'PENDING';
l_iface_hdr_rec.receipt_source_code := 'INTERNAL ORDER';
l_iface_hdr_rec.transaction_type := 'NEW';
l_iface_hdr_rec.receipt_num := l_shipment_number; --Automatic Number
l_iface_hdr_rec.expected_receipt_date := SYSDATE;
l_iface_hdr_rec.validation_flag := 'Y';
l_iface_hdr_rec.ship_to_organization_id := l_req_data.destination_organization_id;
INSERT INTO rcv_headers_interface
VALUES l_iface_hdr_rec;
SELECT rcv_transactions_interface_s.NEXTVAL
INTO l_iface_rcv_rec.interface_transaction_id
FROM dual;
--l_requisition_line_id := l_req_data.requisition_line_id;
l_iface_rcv_rec.header_interface_id := l_iface_hdr_rec.header_interface_id;
l_iface_rcv_rec.group_id := l_iface_hdr_rec.group_id;
l_iface_rcv_rec.processing_status_code := 'PENDING';
l_iface_rcv_rec.transaction_status_code := 'PENDING';
l_iface_rcv_rec.processing_mode_code := 'IMMEDIATE';
l_iface_rcv_rec.validation_flag := 'Y';
--l_iface_rcv_rec.receipt_source_code := 'VENDOR';
l_iface_rcv_rec.requisition_line_id := l_req_data.requisition_line_id;
l_iface_rcv_rec.source_document_code := 'REQ'; --po
l_iface_rcv_rec.transaction_type := 'RECEIVE';
l_iface_rcv_rec.destination_type_code := 'RECEIVING';
l_iface_rcv_rec.transaction_date := SYSDATE;
l_iface_rcv_rec.employee_id := l_req_data.to_person_id;
l_iface_rcv_rec.auto_transact_code := 'DELIVER';
l_iface_rcv_rec.receipt_source_code := 'INTERNAL ORDER';
l_iface_rcv_rec.from_organization_id := l_req_data.source_organization_id;
l_iface_rcv_rec.to_organization_id := l_req_data.destination_organization_id;
l_iface_rcv_rec.requisition_line_id := l_req_data.requisition_line_id;
l_iface_rcv_rec.req_distribution_id := 959926;
l_iface_rcv_rec.shipment_num := l_iface_hdr_rec.receipt_num;
-- l_iface_rcv_rec.freight_carrier_code := l_req_data.unit_meas_lookup_code; #B001
l_iface_rcv_rec.location_id := l_req_data.deliver_to_location_id;
l_iface_rcv_rec.deliver_to_location_id := l_req_data.deliver_to_location_id;
l_iface_rcv_rec.interface_source_code := 'NOT INSPECTED';
l_iface_rcv_rec.routing_header_id := 3;
l_iface_rcv_rec.routing_step_id := 1;
l_iface_rcv_rec.interface_source_code := 'NOT INSPECTED';
l_iface_rcv_rec.destination_type_code := 'INVENTORY';
l_iface_rcv_rec.subinventory := p_subinventory_code; --實際入至子庫存
l_iface_rcv_rec.destination_context := 'INVENTORY';
l_iface_rcv_rec.source_doc_quantity := p_quantity;--實際入庫數量
l_iface_rcv_rec.source_doc_unit_of_measure := l_req_data.unit_meas_lookup_code;
l_iface_rcv_rec.item_id := l_req_data.item_id;
l_iface_rcv_rec.category_id := l_req_data.category_id;
l_iface_rcv_rec.item_description := l_req_data.item_description;
l_iface_rcv_rec.quantity := p_quantity;
l_iface_rcv_rec.unit_of_measure := l_req_data.unit_meas_lookup_code; --Not Code
l_iface_rcv_rec.ship_to_location_id := l_req_data.deliver_to_location_id;
l_iface_rcv_rec.location_id := l_req_data.line_location_id;
l_iface_rcv_rec.interface_source_code := 'PO Requisition';
l_iface_rcv_rec.interface_source_line_id := '123456789';
INSERT INTO rcv_transactions_interface
VALUES l_iface_rcv_rec;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('Exception in calling po_requisition_process:' || SQLERRM);
END;
END LOOP;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('Exception in calling po_requisition_process:' || SQLERRM);
end;
相關文章
- EBS-PO-接收入庫
- 免費SSL證書申請及部署實踐
- 福特申請自動駕駛警車專利,可自動貼罰單自動駕駛
- UI自動化實戰進階PO設計模式UI設計模式
- 如何自動申請免費的HTTPS證書?HTTP
- 如何通過python+Chrome實現自動申請某東試用PythonChrome
- Presto 在位元組跳動的內部實踐與優化REST優化
- 位元大陸發內部信—這一輪IPO申請將於近日失效
- 淘寶訂單介面對接實戰:從申請到程式碼實現的全流程
- 申請Let’s encrypt免費證書,並自動續訂.
- SAP RETAIL 通過自動補貨功能觸發採購申請AI
- NGUI全面實踐教程(大學霸內部資料)NGUI
- 【python介面自動化】- 對接各大資料庫Python大資料資料庫
- SAP MM已經轉成PO的採購申請Item依舊可以被刪除?
- Vue路由自動注入實踐Vue路由
- gulp 前端自動化實踐前端
- ag介面對接網站Mysql資料庫資源資料互動實踐網站MySql資料庫
- EasyAndroid基礎整合元件庫之:EasyPermissions 動態許可權申請庫Android元件
- Python自動化測試~PO模型封裝Python模型封裝
- 肖sir__po框架之ui自動化框架框架UI
- 自動化 selenium +po+pytest 疑點
- 從程式碼實踐潛入React內部,深入diffReact
- Elasticsearch在華泰證券內部的應用實踐Elasticsearch
- 四軸飛行器實踐教程(內部資料)
- 【DB】有贊資料庫自動化運維實踐之路資料庫運維
- Google 應用內購 (1): 申請身份證明Go
- 內網IP地址可以申請SSL證書嗎?內網
- java中的內部類和自動拆裝箱Java
- 高效實現銷售出庫單與訂單自動對接的方案介紹
- 加分申請
- 申請加分
- delphi安卓動態許可權申請安卓
- API自動化測試實踐API
- WebUI 自動化測試-PO 設計模式入門WebUI設計模式
- 這個許可權動態申請庫,值得嘗試一下
- 從概念到實踐,我們該如何構建自動微分庫
- 使用群暉純內建功能實現DDNS,SSL證書申請,反向代理DNS
- 蘋果和Facebook 60%的收入都來自手機或移動部門蘋果