Change the code in the Data Item Number 2 function in the Quantity Explosion of BOM report (99000753) as follows:
Existing code 1...
BomComponent[Level]."Production BOM No." := Item."Production BOM No.";
BomComponent[Level].SETRANGE("Production BOM No.",Item."Production BOM No.");
BomComponent[Level].SETRANGE("Version Code",VersionCode[Level]);
BomComponent[Level].SETFILTER("Starting Date",'%1|..%2',0D,CalculateDate);
BomComponent[Level].SETFILTER("Ending Date",'%1|%2..',0D,CalculateDate);
NoList[Level] := Item."No.";
Quantity[Level] :=
UOMMgt.GetQtyPerUnitOfMeasure(Item,Item."Base Unit of Measure") /
UOMMgt.GetQtyPerUnitOfMeasure(
Item,
...
Replacement code 1...
BomComponent[Level]."Production BOM No." := Item."Production BOM No.";
BomComponent[Level].SETRANGE("Production BOM No.",Item."Production BOM No.");
BomComponent[Level].SETRANGE("Version Code",VersionCode[Level]);
BomComponent[Level].SETFILTER("Starting Date",'%1|..%2',0D,CalculateDate);
BomComponent[Level].SETFILTER("Ending Date",'%1|%2..',0D,CalculateDate);
// Add the following line.
NoListType[Level] := NoListType[Level]::Item;
// End of the added line.
NoList[Level] := Item."No.";
Quantity[Level] :=
UOMMgt.GetQtyPerUnitOfMeasure(Item,Item."Base Unit of Measure") /
UOMMgt.GetQtyPerUnitOfMeasure(
Item,
...
Existing code 2...
BEGIN
WHILE BomComponent[Level].NEXT = 0 DO BEGIN
Level := Level - 1;
IF Level <1 THEN
CurrReport.BREAK;
// Delete the following line.
IF NOT UpperLevelItem.GET(NoList[Level]) THEN
// End of the deleted line.
UpperLevelItem."Production BOM No." := NoList[Level];
BomComponent[Level].SETRANGE("Production BOM No.",UpperLevelItem."Production BOM No.");
BomComponent[Level].SETRANGE("Version Code",VersionCode[Level]);
END;
...
Replacement code 2...
BEGIN
WHILE BomComponent[Level].NEXT = 0 DO BEGIN
Level := Level - 1;
IF Level <1 THEN
CurrReport.BREAK;
// Add the following line.
IF NoListType[NextLevel] = NoListType[NextLevel]::"Production BOM" THEN
// End of the added line.
UpperLevelItem."Production BOM No." := NoList[Level];
BomComponent[Level].SETRANGE("Production BOM No.",UpperLevelItem."Production BOM No.");
BomComponent[Level].SETRANGE("Version Code",VersionCode[Level]);
END;
...
Existing code 3...
BEGIN
CompItem.GET(BomComponent[Level]."No.");
IF CompItem."Production BOM No."<>'' THEN BEGIN
NextLevel := Level + 1;
CLEAR(BomComponent[NextLevel]);
NoList[NextLevel] := CompItem."No.";
VersionCode[NextLevel] :=
VersionMgt.GetBOMVersion(CompItem."Production BOM No.",CalculateDate,FALSE);
BomComponent[NextLevel].SETRANGE("Production BOM No.",CompItem."Production BOM No.");
BomComponent[NextLevel].SETRANGE("Version Code",VersionCode[NextLevel]);
...
Replacement code 3...
BEGIN
CompItem.GET(BomComponent[Level]."No.");
IF CompItem."Production BOM No."<>'' THEN BEGIN
NextLevel := Level + 1;
CLEAR(BomComponent[NextLevel]);
// Add the following line.
NoListType[NextLevel] := NoListType[NextLevel]::Item;
// End of the added line.
NoList[NextLevel] := CompItem."No.";
VersionCode[NextLevel] :=
VersionMgt.GetBOMVersion(CompItem."Production BOM No.",CalculateDate,FALSE);
BomComponent[NextLevel].SETRANGE("Production BOM No.",CompItem."Production BOM No.");
BomComponent[NextLevel].SETRANGE("Version Code",VersionCode[NextLevel]);
...
Existing code 4...
CompItem,
VersionMgt.GetBOMUnitOfMeasure(
CompItem."Production BOM No.",VersionCode[NextLevel]));
END;
IF Level > 1 THEN BEGIN
// Delete the following lines.
IF BomItem.GET(BomComponent[Level - 1]."No.") THEN BEGIN
QtyPerUnitOfMeasure :=
UOMMgt.GetQtyPerUnitOfMeasure(BomItem,BomComponent[Level - 1]."Unit of Measure Code") /
UOMMgt.GetQtyPerUnitOfMeasure(
BomItem,VersionMgt.GetBOMUnitOfMeasure(BomItem."Production BOM No.",VersionCode[Level]));
// End of the deleted lines.
END;
END;
END;
BomComponent[Level].Type::"Production BOM":
BEGIN
...
Replacement code 4...
CompItem,
VersionMgt.GetBOMUnitOfMeasure(
CompItem."Production BOM No.",VersionCode[NextLevel]));
END;
IF Level > 1 THEN BEGIN
// Add the following lines.
IF (BomComponent[Level - 1].Type = BomComponent[Level - 1].Type::Item) THEN BEGIN
IF BomItem.GET(BomComponent[Level - 1]."No.") THEN BEGIN
QtyPerUnitOfMeasure :=
UOMMgt.GetQtyPerUnitOfMeasure(BomItem,BomComponent[Level - 1]."Unit of Measure Code") /
UOMMgt.GetQtyPerUnitOfMeasure(
BomItem,VersionMgt.GetBOMUnitOfMeasure(BomItem."Production BOM No.",VersionCode[Level]));
END;
// End of the added lines.
END;
END;
END;
BomComponent[Level].Type::"Production BOM":
BEGIN
...
Existing code 5...
BomComponent[Level].Type::"Production BOM":
BEGIN
ProdBOM.GET(BomComponent[Level]."No.");
NextLevel := Level + 1;
CLEAR(BomComponent[NextLevel]);
NoList[NextLevel] := ProdBOM."No.";
VersionCode[NextLevel] := VersionMgt.GetBOMVersion(ProdBOM."No.",CalculateDate,FALSE);
BomComponent[NextLevel].SETRANGE("Production BOM No.",NoList[NextLevel]);
BomComponent[NextLevel].SETRANGE("Version Code",VersionCode[NextLevel]);
BomComponent[NextLevel].SETFILTER("Starting Date",'%1|..%2',0D,CalculateDate);
...
Replacement code 5...
BomComponent[Level].Type::"Production BOM":
BEGIN
ProdBOM.GET(BomComponent[Level]."No.");
NextLevel := Level + 1;
CLEAR(BomComponent[NextLevel]);
// Add the following line.
NoListType[NextLevel] := NoListType[NextLevel]::"Production BOM";
// End of the added line.
NoList[NextLevel] := ProdBOM."No.";
VersionCode[NextLevel] := VersionMgt.GetBOMVersion(ProdBOM."No.",CalculateDate,FALSE);
BomComponent[NextLevel].SETRANGE("Production BOM No.",NoList[NextLevel]);
BomComponent[NextLevel].SETRANGE("Version Code",VersionCode[NextLevel]);
BomComponent[NextLevel].SETFILTER("Starting Date",'%1|..%2',0D,CalculateDate);
...