DECLARE
ln_user_id NUMBER;
ln_po_header_id NUMBER := 3319024; --1713998;
ln_vendor_id NUMBER;
lv_segment1 VARCHAR2(20);
ln_org_id NUMBER;
ln_line_num NUMBER;
ln_parent_txn_id NUMBER;
CURSOR po_line IS
SELECT pl.item_id,
pl.po_line_id,
pl.line_num,
--pll.quantity,
pd.quantity_ordered quantity,
pd.po_distribution_id,
pl.unit_meas_lookup_code,
mp.organization_code,
pll.line_location_id,
pll.closed_code,
pll.quantity_received,
-- 10 quantity_received,
pll.cancel_flag,
pll.shipment_num
, pl.po_header_id
FROM po_lines_all pl,
po_line_locations_all pll,
po_distributions_all pd,
mtl_parameters mp
WHERE -- quantity_received <pd.quantity_ordered -- 3317071 1713998
pl.po_header_id = 3319024 --ln_po_header_id
AND pl.po_line_id = pll.po_line_id and LINE_NUM=1
AND pd.line_location_id = pll.line_location_id
AND pd.po_line_id = pl.po_line_id
AND pll.ship_to_organization_id = mp.organization_id;
BEGIN
ln_user_id := 1187; --144333;
SELECT po_header_id,
vendor_id,
segment1,
org_id
INTO ln_po_header_id,
ln_vendor_id,
lv_segment1,
ln_org_id
FROM po_headers_all
WHERE segment1 =:PO_NUMBER --50540008772 55140031173 103134024630
AND org_id =:P_ORG_ID; --3690 3732 122
INSERT INTO rcv_headers_interface
(header_interface_id,
group_id,
processing_status_code,
receipt_source_code,
transaction_type,
last_update_date,
last_updated_by,
last_update_login,
vendor_id,
expected_receipt_date,
validation_flag,
org_id)
SELECT rcv_headers_interface_s.nextval,
rcv_interface_groups_s.nextval,
'PENDING',
'VENDOR',
'NEW',
sysdate,
ln_user_id,
0,
ln_vendor_id,
sysdate,
'Y',
ln_org_id
FROM dual;
FOR cur_po_line IN po_line
LOOP
IF cur_po_line.closed_code IN ('APPROVED', 'OPEN')
AND cur_po_line.quantity_received < cur_po_line.quantity
AND NVL(cur_po_line.cancel_flag,'N') = 'N'
THEN
-- 2763622
-- select * from rcv_transactions_interface where INTERFACE_TRANSACTION_ID=2763622;
INSERT INTO rcv_transactions_interface
(interface_transaction_id,
group_id,
last_update_date,
last_updated_by,
creation_date,
created_by,
last_update_login,
transaction_type,
transaction_date,
processing_status_code,
processing_mode_code,
transaction_status_code,
po_header_id,
po_line_id,
item_id,
quantity,
unit_of_measure,
po_line_location_id,
po_distribution_id,
auto_transact_code,
receipt_source_code,
to_organization_code,
source_document_code,
header_interface_id,
validation_flag,
org_id)
SELECT rcv_transactions_interface_s.nextval,
rcv_interface_groups_s.currval,
sysdate,
ln_user_id,
sysdate,
ln_user_id,
0,
'RECEIVE',
SYSDATE,
'PENDING',
'BATCH',
'PENDING',
ln_po_header_id,
cur_po_line.po_line_id,
cur_po_line.item_id,
cur_po_line.quantity,
cur_po_line.unit_meas_lookup_code,
cur_po_line.line_location_id,
cur_po_line.po_distribution_id,
'RECEIVE',
'VENDOR',
cur_po_line.organization_code,
'PO',
rcv_headers_interface_s.currval,
'Y',
ln_org_id
FROM dual;
ln_parent_txn_id := rcv_transactions_interface_s.currval;
INSERT INTO rcv_transactions_interface
(
parent_interface_txn_id,
interface_transaction_id,
group_id,
last_update_date,
last_updated_by,
creation_date,
created_by,
last_update_login,
transaction_type,
transaction_date,
processing_status_code,
processing_mode_code,
transaction_status_code,
po_header_id,
po_line_id,
item_id,
quantity,
unit_of_measure,
po_line_location_id,
po_distribution_id,
auto_transact_code,
receipt_source_code,
to_organization_code,
source_document_code,
header_interface_id,
validation_flag,
org_id)
SELECT ln_parent_txn_id,
rcv_transactions_interface_s.nextval,
rcv_interface_groups_s.currval,
sysdate,
ln_user_id,
sysdate,
ln_user_id,
0,
'DELIVER',
SYSDATE,
'PENDING',
'BATCH',
'PENDING',
ln_po_header_id,
cur_po_line.po_line_id,
cur_po_line.item_id,
cur_po_line.quantity,
cur_po_line.unit_meas_lookup_code,
cur_po_line.line_location_id,
cur_po_line.po_distribution_id,
NULL,--'RECEIVE',
'VENDOR',
cur_po_line.organization_code,
'PO',
rcv_headers_interface_s.currval,
'Y',
ln_org_id
FROM dual;
dbms_output.put_line('po line: ' || cur_po_line.line_num || ' shipment: ' || cur_po_line.shipment_num ||
' has been inserted sucessfully inserted in the Interface tables.');
ELSE
dbms_output.put_line('po line ' || cur_po_line.line_num || ' is either closed, cancelled, received or have some errors');
END IF;
END LOOP;
COMMIT;
END;
Oracle EBs Apps Blog of Mahfuz, OPM and OBIEE Consultant
Sunday, 4 January 2026
RCV API
Wednesday, 17 December 2025
Isolated Item delete form system:
-SET DEFINE OFF;
Insert into BOM_DELETE_ENTITIES
(DELETE_ENTITY_SEQUENCE_ID, DELETE_GROUP_SEQUENCE_ID, DELETE_ENTITY_TYPE, BILL_SEQUENCE_ID, ROUTING_SEQUENCE_ID,
INVENTORY_ITEM_ID, ORGANIZATION_ID, ALTERNATE_DESIGNATOR, ITEM_DESCRIPTION, ITEM_CONCAT_SEGMENTS,
DELETE_STATUS_TYPE, DELETE_DATE, PRIOR_PROCESS_FLAG, PRIOR_COMMIT_FLAG, LAST_UPDATE_DATE,
LAST_UPDATED_BY, CREATION_DATE, CREATED_BY, LAST_UPDATE_LOGIN, REQUEST_ID,
PROGRAM_APPLICATION_ID, PROGRAM_ID, PROGRAM_UPDATE_DATE)
Values
(BOM_DELETE_ENTITIES_S.nextval, 455045 -- group id from BOM_DELETE_GROUPS
, 1, NULL, NULL
, 5051658 -- inventory item id
,102 -- Org id
, NULL
, 'COP PUSH BUTTON BLACK MIRROR 36MM DIA WITH CABLE -1' -- item name
, '0500031025' -- item code
, 1, null, 1, 1, TO_DATE('07/Dec/22 6:02:52 PM', 'DD/MON/YY HH:MI:SS AM'),
1187, TO_DATE('07/Dec/22 6:02:38 PM', 'DD/MON/YY HH:MI:SS AM'), 1187, null, null,
null, null, null);
Friday, 21 November 2025
OM Order Info of respective ORDER_NUMBER in R12
SELECT ood.organization_code org_code,
ood.organization_name org_name,
wdd.DELIVERY_DETAIL_ID DDID,
ooh.HEADER_ID,
ool.LINE_ID,
ooh.ORDER_NUMBER SO_No,
ool.CUST_PO_NUMBER DO_No,
ORDERED_ITEM item_code,
wdd.ITEM_DESCRIPTION item_name,
ool.ATTRIBUTE3 OU,
ool.LINE_NUMBER line_no,
ool.ORDERED_QUANTITY ord_qty,
ool.FULFILLED_QUANTITY full_qty,
ool.SHIPPED_QUANTITY ship_qty,
wdd.REQUESTED_QUANTITY req_qty,
ooh.FLOW_STATUS_CODE ooh_status,
ool.FLOW_STATUS_CODE ool_ststus,
wdd.RELEASED_STATUS wdd_status,
DECODE (wdd.released_status,
'B', 'Backordered',
'C', 'Shipped',
'D', 'Cancelled',
'N', 'Not Ready for Release',
'R', 'Ready to Release',
'S', 'Release to Warehouse',
'X', 'Not Applicable',
'Y', 'Stagged/Pick Confirm',
wdd.released_status) AS line_status
FROM oe_order_headers_all ooh,
oe_order_lines_all ool,
wsh_delivery_details wdd,
org_organization_definitions ood
WHERE 1 = 1 --and ooh.ORDER_NUMBER='10864543' --hid-35072684
--and ool.ORDERED_ITEM='85140'
AND ooh.ship_from_org_id = ool.ship_from_org_id
AND ool.ORDER_SOURCE_ID = 9
AND ooh.HEADER_ID = ool.HEADER_ID
AND ool.HEADER_ID = wdd.source_header_id
AND ool.line_ID = wdd.source_line_id
AND ool.INVENTORY_ITEM_ID = wdd.INVENTORY_ITEM_ID
AND wdd.RELEASED_STATUS <> 'C'
AND ool.FLOW_STATUS_CODE = 'CLOSED'
AND ool.ORDERED_QUANTITY < wdd.REQUESTED_QUANTITY
AND ool.ship_from_org_id = ood.organization_id
AND TRUNC (wdd.CREATION_DATE) BETWEEN '01-Aug-2025' AND '20-Nov-2025'
ORDER BY ood.organization_code, ooh.ORDER_NUMBER, wdd.RELEASED_STATUS ASC
Move Orders Allocate and Transact APIs in R12
Move Orders Allocate and Transact APIs in R12
Package Specification:
Package Body:
RCV API
DECLARE ln_user_id NUMBER; ln_po_header_id NUMBER := 3319024; --1713998; ln_vendor_id NUMBER; lv_segment1 VARCHAR2(20)...
-
OPM Financials Tables: TABLE NAME DESCRIPTION CM_ACER_MSG The Actual Cost Process Error Message Table will provide the user a...
-
FND API to Delete, Add and Update value set values in Oracle Applications 01. Need to create a table like : CREATE TABLE...
-
/* opm_undo_create_accounting_by_date_range_and_LE_R12.sql +=======================================================================+ * ...