• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

[HELPED] vvtreeds array size

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [HELPED] vvtreeds array size

    The problem I'm having is you use vvtreeds to pass to vvOut with an array size of 999. I have many more records than that. But vvtreeds is such large data structure, if I expand array much past 999 I get RPG error about exceeding max space allowed for array.

    But I only use a couple of fields in vvtreeds and the Fields on Tree Store are much fewer than fields (and space) in vvtreeds. I'm guessing your vvOut pgm translates from vvtreeds to the fields needed in Tree Store. So I'm trying to figure out what my limit of tree nodes might really be. I have about 5450 records on my BOM file that I was hoping to send in one display. Do you think I'm out of luck here or do you know a workaround I can do to get by the array size of vvtreeds?

  • #2
    Check out the tree examples 'Dynamic Load'. It requests the data for each node when you expand it.

    Sending 5450 records is too much.

    Comment


    • #3
      Instead of a tree, would it be possible to show the Bill of Materials in a paging grid? It would be possible to construct a SQL statement that explodes all of the child nodes in one statement and you can use the start and limit to ouput pages of the BOM.
      Code:
      WITH BOM (level, parent, child, qtyReq, expkey) AS
      
      (SELECT 1, ROOT.BOMprod, ROOT.BOMchild, ROOT.qtyReq, CAST(ROOT.BOMprod as varchar(1024))
      FROM yourBOMMaster ROOT
      WHERE ROOT.BOMChild = :RequestedItem
      UNION ALL 
      SELECT PARENT.LEVEL+1, CHILD.BOMProd, CHILD.BOMChild, CHILD.BOMqtyReq, 
        CAST(trim(CHILD.BOMprod) || '' | '' || trim(PARENT.expKey) AS VARCHAR(1024))
        FROM BOM Parent, yourBOMfile CHILD
        WHERE PARENT.parent = CHILD.BOMChild) 
      
      SELECT BOM.level, BOM.parent, BOM.child, BOM.qtyReq, BOM.expkey, IM.ItemDesc
      FROM BOM join yourItemMaster IM on BOM.parent = IM.product
      ORDER BY 1,3,2;
      This SQL statement will output the BOM for the :RequestedItem and show the BOM Level (with the Requested Item as Level 1) and the exploded BOM. The column exp is the "exploded Key " and will show the parent | parent | child relationship on each record. It isn't required in the output and is here just as an example.

      Using this you would not have to send 5,000 rows to the client, just a 'page' at a time.

      Comment


      • #4
        This question spawned from attempt to create a visualization diagram, that is why limiting data not really an option. We are what is known as a "V" plant, where the item we initially create can be used to produce 100 items we actually ship, just depends on how we process it upstream. I was attempting to create a visual map of how our initial item gets processed, show how many initial items have similar upstream processing. That is why trying to process all data at once, so someone could compare the trees themselves.

        This was simply wrong approach to try that visualization and that is OK. I just wanted to understand what my limits were working with trees the way vvOut provides the data. Thanks for your alternative ideas when needing a true tree application.

        Comment

        Working...
        X