Search from 700 + Posts

Nov 4, 2018

BOM_BO_PUB.Process_BOM API not processing multiple Bill of Material together

When running the BOM_BO_PUB.Process_BOM API to process multiple bills, it runs correctly the first time, but, errors for the other bills , to fix this issue reinitialize all input parameters for every run., Especially important is the listing of components. You should make sure a new list is passed each time to avoid components from previous bills passed to the new bill.

-- API input variables
l_bom_header_rec Bom_Bo_Pub.bom_head_rec_type := Bom_Bo_Pub.g_miss_bom_header_rec;
l_bom_revision_tbl Bom_Bo_Pub.bom_revision_tbl_type := Bom_Bo_Pub.g_miss_bom_revision_tbl;
l_bom_component_tbl Bom_Bo_Pub.bom_comps_tbl_type := Bom_Bo_Pub.g_miss_bom_component_tbl;
l_bom_ref_designator_tbl Bom_Bo_Pub.bom_ref_designator_tbl_type := Bom_Bo_Pub.g_miss_bom_ref_designator_tbl;
l_bom_sub_component_tbl Bom_Bo_Pub.bom_sub_component_tbl_type := Bom_Bo_Pub.g_miss_bom_sub_component_tbl;

-- API output variables
x_bom_header_rec Bom_Bo_Pub.bom_head_rec_type := Bom_Bo_Pub.g_miss_bom_header_rec;
x_bom_revision_tbl Bom_Bo_Pub.bom_revision_tbl_type := Bom_Bo_Pub.g_miss_bom_revision_tbl;
x_bom_component_tbl Bom_Bo_Pub.bom_comps_tbl_type := Bom_Bo_Pub.g_miss_bom_component_tbl;
x_bom_ref_designator_tbl Bom_Bo_Pub.bom_ref_designator_tbl_type := Bom_Bo_Pub.g_miss_bom_ref_designator_tbl;
x_bom_sub_component_tbl Bom_Bo_Pub.bom_sub_component_tbl_type := Bom_Bo_Pub.g_miss_bom_sub_component_tbl;


Example
.
.
.
.
.
.
.

l_bom_component_tbl        := Bom_Bo_Pub.g_miss_bom_component_tbl;
l_bom_header_rec          := Bom_Bo_Pub.g_miss_bom_header_rec;
l_bom_revision_tbl        := Bom_Bo_Pub.g_miss_bom_revision_tbl;
l_bom_component_tbl       := Bom_Bo_Pub.g_miss_bom_component_tbl;
l_bom_ref_designator_tbl  := Bom_Bo_Pub.g_miss_bom_ref_designator_tbl;
l_bom_sub_component_tbl   := Bom_Bo_Pub.g_miss_bom_sub_component_tbl;
      
x_bom_header_rec            := Bom_Bo_Pub.g_miss_bom_header_rec;
x_bom_revision_tbl          := Bom_Bo_Pub.g_miss_bom_revision_tbl;
x_bom_component_tbl         := Bom_Bo_Pub.g_miss_bom_component_tbl;
x_bom_ref_designator_tbl    := Bom_Bo_Pub.g_miss_bom_ref_designator_tbl;
x_bom_sub_component_tbl     := Bom_Bo_Pub.g_miss_bom_sub_component_tbl;
l_cnt:=0;

 FND_GLOBAL.APPS_INITIALIZE(l_user_id, l_resp_id, l_application_id);
          -- initialize BOM header
l_step:='Populate BOM Header Record'; 
l_bom_header_rec.assembly_item_name := l_assembly_item;--l_assembly_item_name;
l_bom_header_rec.organization_code  := l_dest_Org_Code;
l_bom_header_rec.assembly_type      := 1;
l_bom_header_rec.transaction_type   := 'CREATE';
l_bom_header_rec.return_status      := NULL;
       
For recBOMINV in (..........................)
LOOP 
l_step:='Populate BOM Data for Components ';
l_cnt :=  l_cnt +1;
l_bom_component_tbl (l_cnt).Organization_Code    \
l_bom_component_tbl (l_cnt).Assembly_Item_Name    := l_assembly_item;--                  l_bom_component_tbl (l_cnt).Start_Effective_date  := recBOMINV.EFFECTIVITY_DATE;
l_bom_component_tbl (l_cnt).Disable_date          := recBOMINV.disable_date;
l_bom_component_tbl (l_cnt).Operation_Sequence_number := recBOMINV.OPERATION_SEQ_NUM;
l_bom_component_tbl (l_cnt).Component_Item_Name     :=l_componet_item_name;
.
.
.
.
.
.
.
.
.
.......................

No comments:

Post a Comment