266:
267: -- IF COST WASN'T FOUND USING PARAM-ORG, GET COSTS USING *WAREHOUSE-ORG*
268:
269: pv_sql := '
270: INSERT INTO opi_pmi_cost_temp3_gtmp
271: (
272: item_id,
273: whse_code,
274: orgn_code,
346: SELECT
347: item_id, whse_code, orgn_code, trans_date, total_cost,
348: 1, last_update_date, period_status
349: FROM
350: opi_pmi_cost_temp3_gtmp
351: WHERE total_cost IS NOT NULL;
352:
353:
354: -- RETURN STATUS = -1 IF NO COSTS WAS FOUND
359: SELECT
360: item_id, whse_code, orgn_code, trans_date, total_cost,
361: -1, last_update_date, period_status
362: FROM
363: opi_pmi_cost_temp3_gtmp
364: WHERE total_cost IS NULL
365: AND cost_basis IS NOT NULL
366: AND item_id IS NOT NULL
367: AND whse_code IS NOT NULL