...
REPEAT
// add 2 spaces for alignment to next lines
CASE ProdBOMLine.Type OF
ProdBOMLine.Type::Item:
BEGIN
EntityPresent := CompItem.GET(ProdBOMLine."No.");
IF EntityPresent OR (NOT IgnoreMissingItemsOrBOMs) THEN
SetRecursiveLevelsOnItem(CompItem,LowLevelCode,IgnoreMissingItemsOrBOMs);
END;
ProdBOMLine.Type::"Production BOM":
BEGIN
EntityPresent := CompBOM.GET(ProdBOMLine."No.");
IF EntityPresent OR (NOT IgnoreMissingItemsOrBOMs) THEN
SetRecursiveLevelsOnBOM(CompBOM,LowLevelCode,IgnoreMissingItemsOrBOMs);
END
END;
// end of adding 2 spaces
UNTIL ProdBOMLine.NEXT = 0;
...
...
REPEAT
// Add the following lines.
IF ProdBOMLine."Version Code" <> '' THEN BEGIN
ProductionBOMVersion.GET(ProdBOMLine."Production BOM No.",ProdBOMLine."Version Code");
CalculateDeeperLevel := ProductionBOMVersion.Status <> ProductionBOMVersion.Status::Closed;
END ELSE BEGIN
CompBOM.GET(ProdBOMLine."Production BOM No.");
CalculateDeeperLevel := CompBOM.Status <> CompBOM.Status::Closed;
END;
// closed BOMs are skipped
IF CalculateDeeperLevel THEN
// End of the added lines.
CASE ProdBOMLine.Type OF
ProdBOMLine.Type::Item:
BEGIN
EntityPresent := CompItem.GET(ProdBOMLine."No.");
IF EntityPresent OR (NOT IgnoreMissingItemsOrBOMs) THEN
SetRecursiveLevelsOnItem(CompItem,LowLevelCode,IgnoreMissingItemsOrBOMs);
END;
ProdBOMLine.Type::"Production BOM":
BEGIN
EntityPresent := CompBOM.GET(ProdBOMLine."No.");
IF EntityPresent OR (NOT IgnoreMissingItemsOrBOMs) THEN
SetRecursiveLevelsOnBOM(CompBOM,LowLevelCode,IgnoreMissingItemsOrBOMs);
END
END;
UNTIL ProdBOMLine.NEXT = 0;
...