-- BOM Explosion with Oracle API
SET HEA ON
SET ECHO OFF
SET VERIFY OFF
SET FEEDBACK OFF
SET PAUSE OFF
SET PAGES 3000
SET LINES 5000
SET COLSEP";"
SET HEADSEP ";"
SET SERVEROUTPUT ON SIZE 1000000
SPOOL C:\aaa.txt
DECLARE
v_org_code mtl_parameters.organization_code%TYPE := ''&1'' ;
v_item mtl_system_items.segment1%TYPE := ''&2'';
l_grp_id NUMBER ;
l_session_id NUMBER ;
l_org_id_s NUMBER ;
l_levels_to_explode NUMBER DEFAULT 20 ;
l_module NUMBER DEFAULT 2 ; -- BOM = 2
l_cst_type_id NUMBER DEFAULT 0 ; -- All cost = -1 else 0
l_item_id NUMBER ;
l_bom_or_eng NUMBER ;
l_using_req_quantity NUMBER &n