I have attempted to follow the Epicor ICE Tools User Guide 101600 to create an indented level BoM. They have an example I followed step by step to create this report. It seems that I was partially successful, but it looks to show the single level BoM over and over again. When testing the BAQ, it says there are 100 BoM levels, but it is just the single level BoM on each level. It gives the error when testing the BAQ “Severity: Error, Table: , Field: , RowID: , Text: The statement terminated. The maximum recursion 100 has been exhausted before statement completion.”
I don’t enter any SQL manually and I’m not sure how I would do that if I wanted to. This is all built using the query builder. This is definitely not pulling all of the parts, as the same parts from the single level are just being duplicated. I know for a fact that some of these parts that are showing in the BoM are assemblies and their components are not listed. I need to fix this report to accurately report all levels of the indented BoM.
Here is what the my report looks like:
with [SubQuery1] as
(select
[PartMtl].[PartNum] as [PartMtl_PartNum],
[PartMtl].[RevisionNum] as [PartMtl_RevisionNum],
[PartMtl].[MtlSeq] as [PartMtl_MtlSeq],
[PartMtl].[MtlPartNum] as [PartMtl_MtlPartNum],
[PartMtl].[QtyPer] as [PartMtl_QtyPer],
[PartMtl].[RelatedOperation] as [PartMtl_RelatedOperation],
[PartMtl].[PullAsAsm] as [PartMtl_PullAsAsm],
[PartMtl].[ViewAsAsm] as [PartMtl_ViewAsAsm],
[PartMtl].[PlanAsAsm] as [PartMtl_PlanAsAsm],
(0) as [Calculated_Hierarchy],
(cast ( substring(’…’,1 ,(Hierarchy + 1) ) + PartMtl.MtlPartNum as nvarchar(25))) as [Calculated_Ind1],
[PartMtl].[Company] as [PartMtl_Company]
from Erp.PartMtl as PartMtl
where PartMtl.PartNum = @PartNum
union all
select
[PartMtl1].[PartNum] as [PartMtl1_PartNum],
[PartMtl1].[RevisionNum] as [PartMtl1_RevisionNum],
[PartMtl1].[MtlSeq] as [PartMtl1_MtlSeq],
[PartMtl1].[MtlPartNum] as [PartMtl1_MtlPartNum],
[PartMtl1].[QtyPer] as [PartMtl1_QtyPer],
[PartMtl1].[RelatedOperation] as [PartMtl1_RelatedOperation],
[PartMtl1].[PullAsAsm] as [PartMtl1_PullAsAsm],
[PartMtl1].[ViewAsAsm] as [PartMtl1_ViewAsAsm],
[PartMtl1].[PlanAsAsm] as [PartMtl1_PlanAsAsm],
(Calculated_Hierarchy + 1) as [Calculated_Hierarchy2],
(cast ( substring(’…’,1 ,(Hierarchy2 + 1) ) + PartMtl1.MtlPartNum as nvarchar(25))) as [Calculated_Ind2],
[PartMtl1].[Company] as [PartMtl1_Company]
from Erp.PartMtl as PartMtl1
inner join SubQuery1 as SubQuery1 on
PartMtl1.PartNum = SubQuery1.PartMtl_PartNum
and PartMtl1.Company = SubQuery1.PartMtl_Company)
select
[SubQuery11].[PartMtl_PartNum] as [PartMtl_PartNum],
[SubQuery11].[PartMtl_RevisionNum] as [PartMtl_RevisionNum],
[SubQuery11].[PartMtl_MtlSeq] as [PartMtl_MtlSeq],
[SubQuery11].[PartMtl_MtlPartNum] as [PartMtl_MtlPartNum],
[SubQuery11].[PartMtl_QtyPer] as [PartMtl_QtyPer],
[SubQuery11].[PartMtl_PullAsAsm] as [PartMtl_PullAsAsm],
[SubQuery11].[PartMtl_RelatedOperation] as [PartMtl_RelatedOperation],
[SubQuery11].[PartMtl_PlanAsAsm] as [PartMtl_PlanAsAsm],
[SubQuery11].[PartMtl_ViewAsAsm] as [PartMtl_ViewAsAsm],
[SubQuery11].[Calculated_Ind1] as [Calculated_Ind1],
[SubQuery11].[Calculated_Hierarchy] as [Calculated_Hierarchy],
[SubQuery11].[PartMtl_Company] as [PartMtl_Company]
from SubQuery1 as SubQuery11
where (SubQuery11.PartMtl_RevisionNum = ‘B’)