View Supply / Demand API gives duplicate records on every run
I need to replicate the View Supply/Demand form of the inventory module to create a report, for this purpose I read the below thread and modified the code that I got from it.
https://forums.oracle.com/forums/thread.jspa?threadID=665964
The code that I am using is below:
DECLARE
l_seq_num NUMBER := 0;
l_session_id NUMBER;
l_count NUMBER;
cutoff_date_j NUMBER;
l_total_temp VARCHAR2 (30);
l_avail_qty_temp VARCHAR2 (30);
CURSOR c1
IS
SELECT inventory_item_id
FROM mtl_system_items_b
WHERE organization_id = 204 AND inventory_item_id = 1;
BEGIN
fnd_global.apps_initialize (1072, 50346, 401);
inv_globals.set_org_id (204);
The code that I am using is below:
DECLARE
l_seq_num NUMBER := 0;
l_session_id NUMBER;
l_count NUMBER;
cutoff_date_j NUMBER;
l_total_temp VARCHAR2 (30);
l_avail_qty_temp VARCHAR2 (30);
CURSOR c1
IS
SELECT inventory_item_id
FROM mtl_system_items_b
WHERE organization_id = 204 AND inventory_item_id = 1;
BEGIN
fnd_global.apps_initialize (1072, 50346, 401);
inv_globals.set_org_id (204);
0