Indented BOM 4GL

Try using the bomsequence index when accessing Bill of Material
records. You might also want to use function fill(".",bomlevel) to
get the indentation effect.
4GL Gurus:

Has anyone created an Indented BOM report in Progress? We are trying to
mass convert Bills of Material to Excel format. Right now I am dumping the
entire Part, PartMtl, and PartRev fields to an export, and using Visual
basic to extract the records for a given assembly.

The condensed visualbasic code below works fairly simply. First, I read all
the partmtl records where partnum = parent. For each partmtl record, the
partrev and part records are pulled, and they are storred as a row in a
temporarry array.

That temporary array is dumped into excel (I'm still trying optimizing that
code), then the temporary array is searched for assembly part numbers, and
another instance of MakeXLBom is launched for each of the assembly part
numbers.

This works, but every time you create a new BOM and want to export it to
excel, you have to wait 5 minutes for vantage to update the dbf's on the
network.

As an alternative, I have been utilizing the temporary text files generated
by the canned bom report, and importing the records into excel.

What I want to do is write a 4gl program that will export only the records
needed for a particular assembly, and all child assemblies therein. The
logic I used in visual basic, with a function launching another instance of
itself, crashes 4GL. It seems that a 4GL procedure cannot call itself.

Any ideas? Let me know....

Thaddeus





Private Sub MakeXLBom(Parent As String, level As Integer, Optional printkids
As Boolean = False)

dim tmparray() 'locally declared.

if level > 10 then error ("Somethings up. Shoot the programmer.")
.........

For x = mtlrecord& To nrecsPartMtl&

[ ..........get combined record from the partmtl, partrev, and part dbf
files......]


tmparray(numitems, 1) = mtlArray$(6)
tmparray(numitems, 2) = mtlArray$(3)
tmparray(numitems, 3) = partArray$(3)
tmparray(numitems, 4) = partArray$(1) 'partnum
tmparray(numitems, 5) = revArray$(2)
tmparray(numitems, 6) = partArray$(2)

next x

[..........Dump tmparray records to excel file.....]

If printkids = true Then

For y = 1 To numitems ' read thru the list of parts, and launch
MakeXLBom for

If tmparray(y, 4) < "08" Then 'all our assembly part numbers are
preceded by "00 thru "07"

MakeXLBom tmparray(y, 4), level + 1, true

end if
Next y



End If

End Sub