Está en la página 1de 4

Shipping ->Release Sales order

='declare value varchar2(2000); begin XXCONG_ITEM_ONHAND_QTY_SO ('''||${ITEM.RELEASE.ORDER_NUMBER.value}||'''); end'

view
CREATE OR REPLACE FORCE VIEW APPS.XXCONG_ONHAND_QUANTITY_DETAILS (ONHAND_QUANTITY, INVENTORY_ITEM_ID, ORGANIZATION_ID) AS select SUM(nvl((moq.transaction_quantity),0))ONHAND_QUANTITY, msi.inventory_item_id, msi.organization_id from mtl_system_items_b msi LEFT JOIN mtl_onhand_quantities_detail moq ON moq.organization_id =msi.organization_id and msi.inventory_item_id= moq.inventory_item_id group by msi.inventory_item_id,msi.organization_id; procedure CREATE OR REPLACE IS l_so_num v_org_id v_item_id v_onhand_qty v_item PROCEDURE xxcong_item_onhand_qty_so (so_num IN VARCHAR2) VARCHAR2 (20); VARCHAR2 (10); NUMBER; NUMBER; VARCHAR (240);

CURSOR sales_order_cur IS SELECT ooh.order_number, ool.inventory_item_id, ool.ship_from_org_id FROM oe_order_headers_all ooh, oe_order_lines_all ool WHERE ooh.header_id = ool.header_id AND ooh.order_number = l_so_num; CURSOR order_org_cur IS SELECT DISTINCT (ool.ship_from_org_id) FROM oe_order_headers_all ooh, oe_order_lines_all ool WHERE ooh.header_id = ool.header_id AND ooh.order_number = l_so_num; BEGIN l_so_num := so_num; FOR i IN order_org_cur LOOP SELECT DISTINCT (i.ship_from_org_id) INTO v_org_id FROM DUAL; FOR j IN sales_order_cur LOOP SELECT j.inventory_item_id INTO v_item_id FROM xxcong_onhand_quantity_details WHERE organization_id = v_org_id AND inventory_item_id = j.inventory_item_id; SELECT INTO FROM WHERE description v_item mtl_system_items_b inventory_item_id = v_item_id AND organization_id = v_org_id;

SELECT INTO FROM WHERE

onhand_quantity v_onhand_qty xxcong_onhand_quantity_details organization_id = v_org_id AND inventory_item_id = v_item_id; || || || || || ); 'Onhand Quantity for -> ' RPAD (v_item, 100) ' is ->' '(' v_onhand_qty ').'

DBMS_OUTPUT.put_line (

END LOOP; END LOOP; END;