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;
.
.
.
.
.
.
.
.
.
.......................
-- 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;
.
.
.
.
.
.
.
.
.
.......................
ReplyDeleteThanks for sharing this great article! That is very interesting I love reading and I am always searching for informative articles like this.
Struts Training in Chennai
Struts course in Chennai
Struts Training center in Chennai
Wordpress Training in Chennai
Wordpress course in Chennai
struts Training in T Nagar
struts Training in OMR
Great Article Cloud Computing Projects
DeleteNetworking Projects
Final Year Projects for CSE
JavaScript Training in Chennai
JavaScript Training in Chennai
The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training
I appreciate you for this blog. More informative, thanks for sharing with us.
ReplyDeleteC C++ Training in Chennai
c++ courses in chennai
C C++ Training in Porur
JMeter Training in Chennai
JMeter Certification
Appium Training in Chennai
javascript training in chennai
core java training in chennai