Quantity Explosion of BOM (Report)

Hi all,

I am trying to understand the codification of the report id 99000753 . What is the reason behind the underlined code of the Screen shot?

1665.Report001.bmp (449 KB)

Please share you knowledge.


Hi Subrata,

It’s setting the filters for the level of the BOM you are on. This is then used in the BOMLOOP dataitem

WHILE BomComponent[Level].NEXT = 0 DO BEGIN

which gets all the record for the level and then moves onto the next level and all it’s components.

Create a 2 - 3 level BOM and follow it in the debugger and all should become clear.

Hi Dave,

thanks for your reply.

Debugger shows BomComponent[Level] almost blank before line of Code WHILE BomComponent[Level].NEXT = 0 DO BEGIN…

when does BomComponent[Level] records be populated ?? in which portion of the code ???

Hi Subrata,

In two places in the BOMLOOP dataitem (depending if the Component line is an Item or a Production BOM) after

NextLevel := Level + 1;

Hi Subrata,

… forgot to add - It’s set initially on the OnPreDataItem (the code you are displaying above)

Running the report with the Item No. 1000 in Cronus DB (


Line 1 does not show any record.

Line 2 shows the record. first time this loop is not excutiong though.

Hi Subrata,

Line 2 is used then exiting the loop on a level and going to the next level.

Line 1 - this should show (the entire record!) - does the report output any details. If not - did you clear the Production BOM No. on item 1000?

Line 1 - this shoulde show the entire record set which are filtered by the filters in the BOMLoop - OnPreDataItem(). trigger

BUT does not show any …[:^)]

Item No. 1000 contain 1000 in the Production BOM No…[8-)]

Hi Subrata,

Sounds like it’s not getting to the dataitem. Step through in the debbuger to see if a filter on the Item dataitem is being set and as a result not looping the dataitem.

I’m testing this report on Cronus India Ltd. Db.


Line 1 ----- does not show any record.

Line 2 ------ First time not execute.

Line 3 ----- Why does BomComponent[Level] enter into the loop ???

I wnt to say Line 1 Blank, Line 2 not execute, so where and when BomComponent[Level] is getting the data and enter into the Line 3 ???

BTW thanks Dave.

Hi Subrata,

BomCompenent[Level] is set on the OnPreDataItem then the first BomCompenent[Level].NEXT in Line 2 is getting the information for Line 3. I think the debugger will have a problem with line 2 as it’s a WHILE statement and a BEGIN. It is showing the excution of the BEGIN (and subsequent) statement(s)

Hi Subrata,

If any of the answers solved your problem, then please log in and click “Verify Solution” next to that answer. This way we know who helped you and that you have been helped. If you still have your problem, then please supply more information.