Monday, February 23, 2015

BOM Explosion API - Working Sample Code

Dear All

Maybe you would come across some scenario to require BOM explosion so just sharing a working code to call the seeded API which can do the same

The API will populate a global temporary table BOM_EXPLOSION_TEMP when you are done with the API call and then you can use this data to display the exploded BOM any way you wish

DECLARE
lv_org_id NUMBER := <Inventory Org ID>;
lv_item_id NUMBER := <Item ID>;
lv_group_id NUMBER;
lv_errbuf VARCHAR2(2000);
lv_retcode NUMBER;
lv_quantity NUMBER := 1; --assumes to explode for a single unit of assembly item
BEGIN
  Bompexpl.exploder_userexit
  (
     levels_to_explode    => 20
     ,org_id              => lv_org_id
     ,grp_id              => lv_group_id
     ,item_id             => lv_item_id
     ,rev_date            => NULL
     ,expl_qty            => lv_quantity
     ,impl_flag           => 2
     ,explode_option      => 2
     ,MODULE              => 2
     ,std_comp_flag       => 2
     ,err_msg             => lv_errbuf
     ,error_code          => lv_retcode
  ) ;

END;

Hope this helps

Cheers
A

1 comment: