skorc123
27th February 2007, 14:33
Hi,

I have a problem.

I have a single table with some fields where two of them are in a parent-child relationship...
Since recursion is not implemented in Baan I am somewhat lost in how to navigate the table to achive desireable result.

see below:

Table
field1 |field2
-------------
x1 | z1
x1 | y1
x1 | v1
y1 | c1
c1 | b1
v1 | n1

Desirable result with X1 being top element:
x1
x1.z1
x1.y1
x1.v1
x1.y1.c1
x1.y1.c1.b1
x1.v1.n1

any ideas?

Regards, Zoran

mark_h
27th February 2007, 14:56
First - the code and utilities forum is for sharing code and the tools forum is for questions relating to the tools arena.

So having said that - you can read this table just like a BOM reporting session. You can use aliases to read the same table multiple times. All you have to do is track the level you are at. I recommend looking at any BOM reporting source code you might have and modeling your code off of that.

vahdani
1st March 2007, 08:14
Hi,

recursion can be done! Take a look at chjagge's wonderful solution here. (http://www.baanboard.com/baanboard/showthread.php?t=22850&highlight=recursion)